diff options
author | Dominik Stadler <centic@apache.org> | 2015-05-12 06:27:11 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2015-05-12 06:27:11 +0000 |
commit | 704125aacf1940353110a43a9870e63cbdbac789 (patch) | |
tree | 541f556f58a47a2ecc10030729cb6619939ca3fa /src/testcases | |
parent | 229effd2ccfe7cafdb7697e5cbbceb066070c676 (diff) | |
download | poi-704125aacf1940353110a43a9870e63cbdbac789.tar.gz poi-704125aacf1940353110a43a9870e63cbdbac789.zip |
Adjust error message to have the same error across different types of Workbook and revert test to check on common error message again
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1678874 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java | 10 | ||||
-rw-r--r-- | src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java index 654db6aa0a..dafb481d3b 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFRow.java @@ -17,6 +17,8 @@ package org.apache.poi.hssf.usermodel; +import java.io.IOException; + import junit.framework.AssertionFailedError; import org.apache.poi.hssf.HSSFITestDataProvider; @@ -71,7 +73,7 @@ public final class TestHSSFRow extends BaseTestRow { assertEquals(-1, row.getLastCellNum()); } - public void testMoveCell() { + public void testMoveCell() throws IOException { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); HSSFRow row = sheet.createRow(0); @@ -115,9 +117,11 @@ public final class TestHSSFRow extends BaseTestRow { assertEquals(5, cellB2.getColumnIndex()); assertEquals(2, row.getFirstCellNum()); assertEquals(6, row.getLastCellNum()); + + workbook.close(); } - public void testRowHeight(){ + public void testRowHeight() throws IOException{ HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(); HSSFRow row = sheet.createRow(0); @@ -132,5 +136,7 @@ public final class TestHSSFRow extends BaseTestRow { row.setHeight((short) -1); assertEquals(row.getHeight(), sheet.getDefaultRowHeight()); assertEquals(row.getRowRecord().getBadFontHeight(), false); + + workbook.close(); } } diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java index ca59fa7f73..2ae096aa1a 100644 --- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java +++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestRow.java @@ -17,6 +17,7 @@ package org.apache.poi.ss.usermodel; +import java.io.IOException; import java.util.Iterator; import junit.framework.TestCase; @@ -138,7 +139,7 @@ public abstract class BaseTestRow extends TestCase { } catch (IllegalArgumentException e) { // expected during successful test assertTrue("Did not find expected error message, had: " + e, - e.getMessage().startsWith("Invalid row number -1")); + e.getMessage().startsWith("Invalid row number (-1)")); } //Test high row bound @@ -285,7 +286,7 @@ public abstract class BaseTestRow extends TestCase { assertEquals(Cell.CELL_TYPE_NUMERIC, row.getCell(5).getCellType()); } - public void testRowHeight() { + public void testRowHeight() throws IOException { Workbook workbook = _testDataProvider.createWorkbook(); Sheet sheet = workbook.createSheet(); Row row1 = sheet.createRow(0); |