import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
import java.io.BufferedInputStream;
import java.io.File;
@Test
public void testAllFiles() throws Exception {
+ if(handler == null) {
+ fail("Did not find a handler for file " + file);
+ }
+
System.out.println("Reading " + file + " with " + handler.getClass());
assertNotNull("Unknown file extension for file: " + file + ": " + getExtension(file), handler);
File inputFile = new File(ROOT_DIR, file);
package org.apache.poi.xssf.usermodel;
-import static org.junit.Assert.fail;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
super.bug60197_NamedRangesReferToCorrectSheetWhenSheetOrderIsChanged();
} catch (final RuntimeException e) {
final Throwable cause = e.getCause();
+ //noinspection StatementWithEmptyBody
if (cause instanceof IOException && cause.getMessage().equals("Stream closed")) {
// expected on the second time that _testDataProvider.writeOutAndReadBack(SXSSFWorkbook) is called
// if the test makes it this far, then we know that XSSFName sheet indices are updated when sheet
wb2.close();
}
-
+
@Test
public void testActiveCellBug56114() throws IOException {
Workbook wb = new HSSFWorkbook();
assertEquals(0, ((HSSFSheet)wb.getSheetAt(0)).getSheet().getActiveCellCol());
cell.setAsActiveCell();
+ cell.setCellValue("this should be active");
assertEquals(1, ((HSSFSheet)wb.getSheetAt(0)).getSheet().getActiveCellRow());
assertEquals(3, ((HSSFSheet)wb.getSheetAt(0)).getSheet().getActiveCellCol());
-// FileOutputStream fos = new FileOutputStream("/tmp/56114.xls");
-//
-// wb.write(fos);
-//
-// fos.close();
+ /*OutputStream fos = new FileOutputStream("c:/temp/56114.xls");
+ try {
+ wb.write(fos);
+ } finally {
+ fos.close();
+ }*/
Workbook wbBack = _testDataProvider.writeOutAndReadBack(wb);
wb.close();
assertEquals(3, ((HSSFSheet)wbBack.getSheetAt(0)).getSheet().getActiveCellRow());
assertEquals(3, ((HSSFSheet)wbBack.getSheetAt(0)).getSheet().getActiveCellCol());
-
-// fos = new FileOutputStream("/tmp/56114a.xls");
-//
-// wbBack.write(fos);
-//
-// fos.close();
+
+ /*fos = new FileOutputStream("c:/temp/56114a.xls");
+ try {
+ wb.write(fos);
+ } finally {
+ fos.close();
+ }*/
Workbook wbBack2 = _testDataProvider.writeOutAndReadBack(wbBack);
wbBack.close();
* the {@link StringRecord} following the {@link FormulaRecord} after the result type had been
* changed to number/boolean/error. Excel silently ignores the extra record, but some POI
* versions (prior to bug 46213 / r717883) crash instead.
- * @throws IOException
*/
@Test
public void testCachedTypeChange() throws IOException {