aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2014-12-25 09:16:44 +0000
committerDominik Stadler <centic@apache.org>2014-12-25 09:16:44 +0000
commit8daac21f87301870b0090a40fb0f617c25c8e500 (patch)
treeb4e2029caed54ed3682f55e8d07b1f1d00bfaea3 /src/testcases/org
parent4204f8211ec892dba4c605b30c26757b9e0be686 (diff)
downloadpoi-8daac21f87301870b0090a40fb0f617c25c8e500.tar.gz
poi-8daac21f87301870b0090a40fb0f617c25c8e500.zip
Add a test-suite which performs integration/stress tests which load and handle all stored test files in various ways.
It works by using handlers for each type of file which perform various operations on the files, e.g. loading, iterating content, modify, ... This will trigger changes which break working with the available test-files and thus provides another layer of regression testing which hopefully prevents some failures from making it into releases. It is runnable via a new ant-target 'test-integration' and also added to the jenkins-target. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1647885 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org')
-rw-r--r--src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java5
-rw-r--r--src/testcases/org/apache/poi/hssf/dev/TestReSave.java1
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java48
3 files changed, 54 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java b/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java
index a6fc85e4d4..c3730bc043 100644
--- a/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java
+++ b/src/testcases/org/apache/poi/hssf/dev/TestEFBiffViewer.java
@@ -32,8 +32,13 @@ public class TestEFBiffViewer extends BaseXLSIteratingTest {
SILENT_EXCLUDED.add("51832.xls"); // password
SILENT_EXCLUDED.add("xor-encryption-abc.xls"); // password, ty again later!
SILENT_EXCLUDED.add("43493.xls"); // HSSFWorkbook cannot open it as well
+ SILENT_EXCLUDED.add("44958_1.xls"); // known bad file
SILENT_EXCLUDED.add("46904.xls"); // Exception, too old
SILENT_EXCLUDED.add("47251_1.xls"); // Broken test file
+ SILENT_EXCLUDED.add("testEXCEL_4.xls"); // old unsupported format
+ SILENT_EXCLUDED.add("testEXCEL_5.xls"); // old unsupported format
+ SILENT_EXCLUDED.add("testEXCEL_95.xls"); // old unsupported format
+ SILENT_EXCLUDED.add("35897-type4.xls"); // unsupported encryption
}
@Override
diff --git a/src/testcases/org/apache/poi/hssf/dev/TestReSave.java b/src/testcases/org/apache/poi/hssf/dev/TestReSave.java
index cc124f449a..d42af8858f 100644
--- a/src/testcases/org/apache/poi/hssf/dev/TestReSave.java
+++ b/src/testcases/org/apache/poi/hssf/dev/TestReSave.java
@@ -37,6 +37,7 @@ public class TestReSave extends BaseXLSIteratingTest {
SILENT_EXCLUDED.add("43493.xls"); // HSSFWorkbook cannot open it as well
SILENT_EXCLUDED.add("46904.xls");
SILENT_EXCLUDED.add("51832.xls"); // password
+ SILENT_EXCLUDED.add("44958_1.xls"); // known bad file
}
@Override
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java
index 7b101affeb..b6a535347a 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java
@@ -24,6 +24,10 @@ import junit.framework.TestCase;
import org.apache.poi.hssf.HSSFTestDataSamples;
import org.apache.poi.hssf.record.RecordFormatException;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
/**
* @author aviks
@@ -74,4 +78,48 @@ public final class TestUnfixedBugs extends TestCase {
// Problem 3 - fixed and transfered
}
+
+ public void testFormulaRecordAggregate_1() throws Exception {
+ // fails at formula "=MEHRFACH.OPERATIONEN(E$3;$B$5;$D4)"
+ Workbook wb = HSSFTestDataSamples.openSampleWorkbook("44958_1.xls");
+ for(int i = 0;i < wb.getNumberOfSheets();i++) {
+ Sheet sheet = wb.getSheetAt(i);
+ assertNotNull(wb.getSheet(sheet.getSheetName()));
+ sheet.groupColumn((short) 4, (short) 5);
+ sheet.setColumnGroupCollapsed(4, true);
+ sheet.setColumnGroupCollapsed(4, false);
+
+ for(Row row : sheet) {
+ for(Cell cell : row) {
+ try {
+ cell.toString();
+ } catch (Exception e) {
+ throw new Exception("While handling: " + sheet.getSheetName() + "/" + row.getRowNum() + "/" + cell.getColumnIndex(), e);
+ }
+ }
+ }
+ }
+ }
+
+ public void testFormulaRecordAggregate() throws Exception {
+ // fails at formula "=MEHRFACH.OPERATIONEN(E$3;$B$5;$D4)"
+ Workbook wb = HSSFTestDataSamples.openSampleWorkbook("44958.xls");
+ for(int i = 0;i < wb.getNumberOfSheets();i++) {
+ Sheet sheet = wb.getSheetAt(i);
+ assertNotNull(wb.getSheet(sheet.getSheetName()));
+ sheet.groupColumn((short) 4, (short) 5);
+ sheet.setColumnGroupCollapsed(4, true);
+ sheet.setColumnGroupCollapsed(4, false);
+
+ for(Row row : sheet) {
+ for(Cell cell : row) {
+ try {
+ cell.toString();
+ } catch (Exception e) {
+ throw new Exception("While handling: " + sheet.getSheetName() + "/" + row.getRowNum() + "/" + cell.getColumnIndex(), e);
+ }
+ }
+ }
+ }
+ }
}