You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ba...@apache.org on 2006/06/19 14:47:29 UTC

svn commit: r415316 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java

Author: bayard
Date: Mon Jun 19 05:47:28 2006
New Revision: 415316

URL: http://svn.apache.org/viewvc?rev=415316&view=rev
Log:
Added unit test for LANG-140 - thanks to Yu Peng for the test case

Modified:
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java?rev=415316&r1=415315&r2=415316&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java (original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Mon Jun 19 05:47:28 2006
@@ -19,6 +19,7 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
 import java.util.Calendar;
+import java.util.Date;
 import java.util.TimeZone;
 
 import junit.framework.Test;
@@ -395,6 +396,18 @@
                 DurationFormatUtils.y, 1)));
         DurationFormatUtils.Token numToken = new DurationFormatUtils.Token(new Integer(1), 4);
         assertTrue("Token with Number value not equal to itself. ", numToken.equals(numToken));
+    }
+
+
+    // http://issues.apache.org/bugzilla/show_bug.cgi?id=38401
+    public void testBugzilla38401() {
+        Calendar cal1 = Calendar.getInstance();
+        cal1.set(2006, 0, 26, 18, 47, 34);
+        Calendar cal2 = Calendar.getInstance();
+        cal2.set(2006, 1, 26, 10, 47, 34);
+
+        System.err.println("WAS: " + DurationFormatUtils.formatPeriod(cal1.getTime().getTime(), cal2.getTime().getTime(), "yyyy/MM/dd HH:mm:ss SSS") );
+        assertEquals( "0000/00/30 16:00:00 000", DurationFormatUtils.formatPeriod(cal1.getTime().getTime(), cal2.getTime().getTime(), "yyyy/MM/dd HH:mm:ss SSS") );
     }
 
     private void assertArrayEquals(DurationFormatUtils.Token[] obj1, DurationFormatUtils.Token[] obj2) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org