]> source.dussan.org Git - poi.git/commitdiff
Fix test to make it work on different date as well
authorDominik Stadler <centic@apache.org>
Wed, 23 Jul 2014 07:55:48 +0000 (07:55 +0000)
committerDominik Stadler <centic@apache.org>
Wed, 23 Jul 2014 07:55:48 +0000 (07:55 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1612786 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

index fcf2b51629a10609a5dc9bde6204914c54707cde..891a1bd789322f8304f4072178bdc3c105ca0d3b 100644 (file)
@@ -26,6 +26,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.util.Calendar;
 import java.util.List;
 
 import org.apache.poi.EncryptedDocumentException;
@@ -40,6 +41,7 @@ import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.ss.formula.WorkbookEvaluator;
 import org.apache.poi.ss.formula.eval.ErrorEval;
+import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.formula.functions.Function;
 import org.apache.poi.ss.usermodel.*;
@@ -1753,12 +1755,11 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
     public void testBug56688_4() {
         XSSFWorkbook excel = XSSFTestDataSamples.openSampleWorkbook("56688_4.xlsx");
         
-//        Calendar calendar = Calendar.getInstance();
-//        calendar.add(Calendar.MONTH, 2);
-//        double excelDate = DateUtil.getExcelDate(calendar.getTime());
-//        NumberEval eval = new NumberEval(Math.floor(excelDate));
-//        checkValue(excel, eval.getStringValue() + ".0");
-        checkValue(excel, "41904.0");
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.MONTH, 2);
+        double excelDate = DateUtil.getExcelDate(calendar.getTime());
+        NumberEval eval = new NumberEval(Math.floor(excelDate));
+        checkValue(excel, eval.getStringValue() + ".0");
     }
 
     private void checkValue(XSSFWorkbook excel, String expect) {