Skip to content

Commit

Permalink
add import, export test case for zss-1402
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkchen committed Sep 25, 2019
1 parent cc87077 commit b8eb6b8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion zss.test/src/test/java/org/zkoss/zss/model/ExporterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ public void columnTest() {
SBook book = ImExpTestUtil.loadBook(outFile, DEFAULT_BOOK_NAME);
columnTest(book);
}


@Test
public void columnDefaultWidthTest() {
File outFile = ImExpTestUtil.write(ImExpTestUtil.loadBook(COLUMN_WIDTH_FILE_UNDER_TEST, "XSSFBook"), EXPORTER_TYPE);
SBook book = ImExpTestUtil.loadBook(outFile, DEFAULT_BOOK_NAME);
assertEquals(89, book.getSheet(0).getDefaultColumnWidth());
}

@Test
public void lastChangedColumnTest() {
File outFile = ImExpTestUtil.write(ImExpTestUtil.loadBook(IMPORT_FILE_UNDER_TEST, "XSSFBook"), EXPORTER_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class ImExpTestBase {
protected URL CHART_IMPORT_FILE_UNDER_TEST = ImporterTest.class.getResource("book/chart.xlsx");
protected URL PICTURE_IMPORT_FILE_UNDER_TEST = ImporterTest.class.getResource("book/picture.xlsx");
protected URL FILTER_IMPORT_FILE_UNDER_TEST = ImporterTest.class.getResource("book/filter.xlsx");
protected URL COLUMN_WIDTH_FILE_UNDER_TEST = ImporterTest.class.getResource("book/customDefaultWidth.xlsx");
protected static String DEFAULT_BOOK_NAME = "PoiBook";

protected void hyperlinkTest(SBook book) {
Expand Down
8 changes: 7 additions & 1 deletion zss.test/src/test/java/org/zkoss/zss/model/ImporterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ public void columnTest(){
SBook book = ImExpTestUtil.loadBook(IMPORT_FILE_UNDER_TEST, "XSSFBook");
columnTest(book);
}


@Test
public void columnWidthTest(){
SBook book = ImExpTestUtil.loadBook(COLUMN_WIDTH_FILE_UNDER_TEST, "XSSFBook");
assertEquals(89, book.getSheet(0).getDefaultColumnWidth());
}

/**
* import last column that only has column width change but has all empty cells
*/
Expand Down
Binary file not shown.

0 comments on commit b8eb6b8

Please sign in to comment.