poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1666718 - in /poi/trunk: src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java test-data/spreadsheet/56325a.xls
Date Sat, 14 Mar 2015 17:50:56 GMT
Author: centic
Date: Sat Mar 14 17:50:55 2015
New Revision: 1666718

URL: http://svn.apache.org/r1666718
Log:
Add second verification of bug 56325 to ensure it is really fixed

Added:
    poi/trunk/test-data/spreadsheet/56325a.xls
Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=1666718&r1=1666717&r2=1666718&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Sat Mar 14 17:50:55
2015
@@ -32,6 +32,7 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
@@ -71,6 +72,7 @@ import org.apache.poi.ss.usermodel.Name;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.util.TempFile;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -2526,6 +2528,33 @@ public final class TestBugs extends Base
         wb = HSSFTestDataSamples.writeOutAndReadBack(wb);
         assertEquals(0, wb.getNumberOfSheets());
     }
+
+    @Test
+    public void bug56325a() throws IOException {
+        HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("56325a.xls");
+        
+        HSSFSheet sheet = wb.cloneSheet(2);
+        wb.setSheetName(3, "Clone 1");
+        sheet.setRepeatingRows(CellRangeAddress.valueOf("2:3"));
+        wb.setPrintArea(3, "$A$4:$C$10");
+        
+        sheet = wb.cloneSheet(2);
+        wb.setSheetName(4, "Clone 2");
+        sheet.setRepeatingRows(CellRangeAddress.valueOf("2:3"));
+        wb.setPrintArea(4, "$A$4:$C$10");
+        
+        wb.removeSheetAt(2);
+
+        Workbook wbBack = HSSFTestDataSamples.writeOutAndReadBack(wb);
+        assertEquals(4, wbBack.getNumberOfSheets());
+        
+//        OutputStream fOut = new FileOutputStream("/tmp/56325a.xls");
+//        try {
+//        	wb.write(fOut);
+//        } finally {
+//        	fOut.close();
+//        }
+    }
     
     /**
      * Formulas which reference named ranges, either in other

Added: poi/trunk/test-data/spreadsheet/56325a.xls
URL: http://svn.apache.org/viewvc/poi/trunk/test-data/spreadsheet/56325a.xls?rev=1666718&view=auto
==============================================================================
Binary files poi/trunk/test-data/spreadsheet/56325a.xls (added) and poi/trunk/test-data/spreadsheet/56325a.xls
Sat Mar 14 17:50:55 2015 differ



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message