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
This commit is contained in:
Javen O'Neal 2015-11-02 09:23:12 +00:00
parent e88fac62ef
commit 3c18d6aa7b
2 changed files with 8 additions and 0 deletions

View File

@ -114,11 +114,15 @@ public class TestFormulaParser extends TestCase {
XSSFTestDataSamples.writeOutAndReadBack(wb).close(); XSSFTestDataSamples.writeOutAndReadBack(wb).close();
// Manually check to make sure file isn't corrupted // 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 fileIn = XSSFTestDataSamples.getSampleFile(testFile);
final File reSavedFile = new File(fileIn.getParentFile(), fileIn.getName().replace(".xlsm", "-saved.xlsm")); final File reSavedFile = new File(fileIn.getParentFile(), fileIn.getName().replace(".xlsm", "-saved.xlsm"));
final FileOutputStream fos = new FileOutputStream(reSavedFile); final FileOutputStream fos = new FileOutputStream(reSavedFile);
wb.write(fos); wb.write(fos);
fos.close(); fos.close();
*/
} finally { } finally {
wb.close(); wb.close();
} }

View File

@ -161,11 +161,15 @@ public final class TestFormulaParser extends TestCase {
assertEqualsIgnoreCase("yourFunc", wb2.getName("yourFunc").getNameName()); assertEqualsIgnoreCase("yourFunc", wb2.getName("yourFunc").getNameName());
// Manually check to make sure file isn't corrupted // 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 fileIn = HSSFTestDataSamples.getSampleFile(testFile);
final File reSavedFile = new File(fileIn.getParentFile(), fileIn.getName().replace(".xls", "-saved.xls")); final File reSavedFile = new File(fileIn.getParentFile(), fileIn.getName().replace(".xls", "-saved.xls"));
FileOutputStream fos = new FileOutputStream(reSavedFile); FileOutputStream fos = new FileOutputStream(reSavedFile);
wb2.write(fos); wb2.write(fos);
fos.close(); fos.close();
*/
} finally { } finally {
wb2.close(); wb2.close();
} }