]> source.dussan.org Git - poi.git/commitdiff
Add additional checks to narrow down why this test fails when run via Maven
authorDominik Stadler <centic@apache.org>
Wed, 19 Aug 2015 13:28:23 +0000 (13:28 +0000)
committerDominik Stadler <centic@apache.org>
Wed, 19 Aug 2015 13:28:23 +0000 (13:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1696584 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/ss/formula/atp/TestWorkdayFunction.java

index 6deb235cd13dba0a572af126ca5aa6e3743efde1..417c56f303355333d63e5785dbc6a20e4e9aac50 100644 (file)
@@ -92,7 +92,11 @@ public class TestWorkdayFunction extends TestCase {
                StringEval stringEval = new StringEval(startDate);
                double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(new ValueEval[]{
                 stringEval, new NumberEval(days) }, EC)).getNumberValue();
-               assertEquals(expectedWorkDay, formatter.format(DateUtil.getJavaDate(numberValue)));
+               assertEquals(41544.0, numberValue);
+               
+               Date date = DateUtil.getJavaDate(numberValue);
+        assertEquals(new Date(113, 8, 27), date);
+        assertEquals(expectedWorkDay, formatter.format(date));
     }
     
     public void testReturnWorkdaysSpanningAWeekendAddingDays() {
@@ -102,7 +106,11 @@ public class TestWorkdayFunction extends TestCase {
                StringEval stringEval = new StringEval(startDate);
                double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(new ValueEval[]{
                 stringEval, new NumberEval(days) }, EC)).getNumberValue();
-               assertEquals(expectedWorkDay, formatter.format(DateUtil.getJavaDate(numberValue)));
+        assertEquals(41547.0, numberValue);
+
+        Date date = DateUtil.getJavaDate(numberValue);
+               assertEquals(new Date(113, 8, 30), date);
+        assertEquals(expectedWorkDay, formatter.format(date));
     }
     
     public void testReturnWorkdaysWhenStartIsWeekendAddingDays() {
@@ -112,7 +120,11 @@ public class TestWorkdayFunction extends TestCase {
                StringEval stringEval = new StringEval(startDate);
                double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(new ValueEval[]{
                 stringEval, new NumberEval(days) }, EC)).getNumberValue();
-               assertEquals(expectedWorkDay, formatter.format(DateUtil.getJavaDate(numberValue)));
+        assertEquals(41554.0, numberValue);
+
+        Date date = DateUtil.getJavaDate(numberValue);
+        assertEquals(new Date(113, 9, 7), date);
+        assertEquals(expectedWorkDay, formatter.format(date));
     }
     
     public void testReturnWorkdaysWhenStartIsWeekendSubtractingDays() {
@@ -122,7 +134,11 @@ public class TestWorkdayFunction extends TestCase {
                StringEval stringEval = new StringEval(startDate);
                double numberValue = ((NumberEval) WorkdayFunction.instance.evaluate(new ValueEval[]{
                 stringEval, new NumberEval(days) }, EC)).getNumberValue();
-               assertEquals(expectedWorkDay, formatter.format(DateUtil.getJavaDate(numberValue)));
+        assertEquals(41551.0, numberValue);
+
+        Date date = DateUtil.getJavaDate(numberValue);
+        assertEquals(new Date(113, 9, 4), date);
+        assertEquals(expectedWorkDay, formatter.format(date));
     }
 
     public void testReturnWorkdaysWithDaysTruncated() {