From 36ee486049431de912b1ac3e3d7d9ada2a304614 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Wed, 12 Aug 2015 19:52:22 +0000 Subject: [PATCH] More consistent test-file output for Excel testing git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1695605 13f79535-47bb-0310-9956-ffa450edef68 --- .../hssf/usermodel/TestFormulaEvaluatorBugs.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java index d191bdac8c..b18cfe9ce3 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestFormulaEvaluatorBugs.java @@ -48,11 +48,13 @@ import org.apache.poi.ss.util.CellReference; * */ public final class TestFormulaEvaluatorBugs extends TestCase { - private static final boolean OUTPUT_TEST_FILES = false; + private static boolean OUTPUT_TEST_FILES = false; private String tmpDirName; protected void setUp() { tmpDirName = System.getProperty("java.io.tmpdir"); + OUTPUT_TEST_FILES = Boolean.parseBoolean( + System.getProperty("org.apache.poi.test.output_test_files", "False")); } /** @@ -529,10 +531,12 @@ public final class TestFormulaEvaluatorBugs extends TestCase { cell = row.getCell(CellReference.convertColStringToIndex("H")); assertEquals("A", cell.getStringCellValue()); - // Enable this block to write out, and check in Excel -//FileOutputStream out = new FileOutputStream("/tmp/test.xls"); -//wb.write(out); -//out.close(); + // Enable this to write out + check in Excel + if (OUTPUT_TEST_FILES) { + FileOutputStream out = new FileOutputStream("/tmp/test.xls"); + wb.write(out); + out.close(); + } } private Ptg[] getPtgs(HSSFCell cell) { assertEquals(HSSFCell.CELL_TYPE_FORMULA, cell.getCellType()); -- 2.39.5