From a7a98a1e99b1f25ecea1882a10a281b977d5c785 Mon Sep 17 00:00:00 2001 From: roy wang Date: Mon, 29 Nov 2021 15:59:29 -0600 Subject: [PATCH] 20211130 update : add test case. --- .../cloud/cells/api/CellsCompressApiTest.java | 83 +++++++++++++++++++ .../cloud/cells/api/CellsReplaceApiTest.java | 77 +++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 src/androidTest/java/com/aspose/cloud/cells/api/CellsCompressApiTest.java create mode 100644 src/androidTest/java/com/aspose/cloud/cells/api/CellsReplaceApiTest.java diff --git a/src/androidTest/java/com/aspose/cloud/cells/api/CellsCompressApiTest.java b/src/androidTest/java/com/aspose/cloud/cells/api/CellsCompressApiTest.java new file mode 100644 index 0000000..5e4ca9d --- /dev/null +++ b/src/androidTest/java/com/aspose/cloud/cells/api/CellsCompressApiTest.java @@ -0,0 +1,83 @@ +/* + * Web API Swagger specification + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 1.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package com.aspose.cloud.cells.api; +import com.aspose.cloud.cells.client.ApiClient; +import com.aspose.cloud.cells.client.ApiException; +import com.aspose.cloud.cells.client.Configuration; +import com.aspose.cloud.cells.model.FilesResult; +import org.junit.Test; +import org.junit.Ignore; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for CellsShapesApi + */ + +public class CellsCompressApiTest { + + private LiteCellsApi api ; + + private String BOOK1 = "Book1.xlsx"; + private String MYDOC = "myDocument.xlsx"; + private String AssemblyTestXlsx = "assemblytest.xlsx"; + private String DataSourceXlsx = "datasource.xlsx"; + private String PivTestFile = "TestCase.xlsx"; + private String TEMPFOLDER = "JavaTest"; + private String SHEET1 = "Sheet1"; + private String SHEET2 = "Sheet2"; + private String SHEET3 = "Sheet3"; + private String SHEET4 = "Sheet4"; + private String SHEET5 = "Sheet5"; + private String SHEET6 = "Sheet6"; + private String SHEET7 = "Sheet7"; + private String SHEET8 = "Sheet8"; + private String CellName = "A1"; + private String RANGE = "A1:C10"; + private String CELLAREA = "A1:C10"; + + public CellsCompressApiTest(){ + try { + api = new LiteCellsApi(CellsApiUtil.GetClientId(),CellsApiUtil.GetClientSecret(),CellsApiUtil.GetAPIVersion(),CellsApiUtil.GetBaseUrl()); + } catch (ApiException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * Delete a shape in worksheet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void cellsPostCompressApiTest() throws ApiException { + + HashMap fileMap = new HashMap(); + fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) ); + fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) ); + FilesResult response = api.postCompress(fileMap, 88); + + // TODO: test validations + } + + +} diff --git a/src/androidTest/java/com/aspose/cloud/cells/api/CellsReplaceApiTest.java b/src/androidTest/java/com/aspose/cloud/cells/api/CellsReplaceApiTest.java new file mode 100644 index 0000000..f50217d --- /dev/null +++ b/src/androidTest/java/com/aspose/cloud/cells/api/CellsReplaceApiTest.java @@ -0,0 +1,77 @@ +/* + * Web API Swagger specification + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * OpenAPI spec version: 1.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package com.aspose.cloud.cells.api; +import com.aspose.cloud.cells.client.ApiClient; +import com.aspose.cloud.cells.client.ApiException; +import com.aspose.cloud.cells.client.Configuration; +import com.aspose.cloud.cells.model.FilesResult; +import org.junit.Test; +import org.junit.Ignore; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for CellsShapesApi + */ + +public class CellsReplaceApiTest { + + private LiteCellsApi api ; + + private String BOOK1 = "Book1.xlsx"; + private String MYDOC = "myDocument.xlsx"; + private String AssemblyTestXlsx = "assemblytest.xlsx"; + private String DataSourceXlsx = "datasource.xlsx"; + private String PivTestFile = "TestCase.xlsx"; + private String TEMPFOLDER = "JavaTest"; + private String SHEET1 = "Sheet1"; + private String SHEET2 = "Sheet2"; + private String SHEET3 = "Sheet3"; + private String SHEET4 = "Sheet4"; + private String SHEET5 = "Sheet5"; + private String SHEET6 = "Sheet6"; + private String SHEET7 = "Sheet7"; + private String SHEET8 = "Sheet8"; + private String CellName = "A1"; + private String RANGE = "A1:C10"; + private String CELLAREA = "A1:C10"; + + public CellsReplaceApiTest(){ + try { + api = new LiteCellsApi(CellsApiUtil.GetClientId(),CellsApiUtil.GetClientSecret(),CellsApiUtil.GetAPIVersion(),CellsApiUtil.GetBaseUrl()); + } catch (ApiException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + + @Test + public void cellsPostRepleaceApiTest() throws ApiException { + + HashMap fileMap = new HashMap(); + fileMap.put(AssemblyTestXlsx ,CellsApiUtil.GetFileHolder(AssemblyTestXlsx) ); + fileMap.put(DataSourceXlsx ,CellsApiUtil.GetFileHolder(DataSourceXlsx) ); + FilesResult response = api.postReplace(fileMap,"1","aspose.cells cloud",null,null); + + // TODO: test validations + } + + + +}