aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcases/org/apache')
-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);
+ }
+ }
+ }
+ }
+ }
}