From: Javen O'Neal Date: Mon, 2 Nov 2015 09:23:12 +0000 (+0000) Subject: don't leave behind files when running unit tests. In the future this should be revisi... X-Git-Tag: REL_3_14_BETA1~169 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d593be901fdee63fa88758228fba915daf6f2496;p=poi.git don't leave behind files when running unit tests. In the future this should be revisited to verify POI isn't writing workbooks that are unopenable/corrupt by applications that read POI's formats (MS Office, OpenOffice, LibreOffice, etc) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1711920 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java b/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java index ade19a3846..d6e442fd62 100644 --- a/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java +++ b/src/ooxml/testcases/org/apache/poi/ss/formula/TestFormulaParser.java @@ -114,11 +114,15 @@ public class TestFormulaParser extends TestCase { XSSFTestDataSamples.writeOutAndReadBack(wb).close(); // Manually check to make sure file isn't corrupted + // TODO: develop a process for occasionally manually reviewing workbooks + // to verify workbooks are not corrupted + /* final File fileIn = XSSFTestDataSamples.getSampleFile(testFile); final File reSavedFile = new File(fileIn.getParentFile(), fileIn.getName().replace(".xlsm", "-saved.xlsm")); final FileOutputStream fos = new FileOutputStream(reSavedFile); wb.write(fos); fos.close(); + */ } finally { wb.close(); } diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java index 35576cac6d..9dd2af8189 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java @@ -161,11 +161,15 @@ public final class TestFormulaParser extends TestCase { assertEqualsIgnoreCase("yourFunc", wb2.getName("yourFunc").getNameName()); // Manually check to make sure file isn't corrupted + // TODO: develop a process for occasionally manually reviewing workbooks + // to verify workbooks are not corrupted + /* final File fileIn = HSSFTestDataSamples.getSampleFile(testFile); final File reSavedFile = new File(fileIn.getParentFile(), fileIn.getName().replace(".xls", "-saved.xls")); FileOutputStream fos = new FileOutputStream(reSavedFile); wb2.write(fos); fos.close(); + */ } finally { wb2.close(); }