poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cen...@apache.org
Subject svn commit: r1612786 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
Date Wed, 23 Jul 2014 07:55:48 GMT
Author: centic
Date: Wed Jul 23 07:55:48 2014
New Revision: 1612786

URL: http://svn.apache.org/r1612786
Log:
Fix test to make it work on different date as well

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

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1612786&r1=1612785&r2=1612786&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Wed Jul
23 07:55:48 2014
@@ -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.N
 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 
     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) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message