commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r664642 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java
Date Mon, 09 Jun 2008 07:15:50 GMT
Author: bayard
Date: Mon Jun  9 00:15:50 2008
New Revision: 664642

URL: http://svn.apache.org/viewvc?rev=664642&view=rev
Log:
Fixing the unit test as described in LANG-440. The truncate tests for AM_PM had been copied
and were not testing againt the correct expected results. This will break the build. 

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

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java?rev=664642&r1=664641&r2=664642&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java Mon
Jun  9 00:15:50 2008
@@ -667,17 +667,17 @@
         assertEquals("round second-2 failed",
                 dateTimeParser.parse("November 18, 2001 1:23:11.000"),
                 DateUtils.round(date2, Calendar.SECOND));
-        assertEquals("truncate ampm-1 failed",
+        assertEquals("round ampm-1 failed",
                 dateTimeParser.parse("February 3, 2002 00:00:00.000"),
                 DateUtils.round(dateAmPm1, Calendar.AM_PM));
-        assertEquals("truncate ampm-2 failed",
-                dateTimeParser.parse("February 4, 2002 00:00:00.000"),
+        assertEquals("round ampm-2 failed",
+                dateTimeParser.parse("February 3, 2002 12:00:00.000"),
                 DateUtils.round(dateAmPm2, Calendar.AM_PM));
-        assertEquals("truncate ampm-3 failed",
+        assertEquals("round ampm-3 failed",
                 dateTimeParser.parse("February 3, 2002 12:00:00.000"),
                 DateUtils.round(dateAmPm3, Calendar.AM_PM));
-        assertEquals("truncate ampm-4 failed",
-                dateTimeParser.parse("February 4, 2002 12:00:00.000"),
+        assertEquals("round ampm-4 failed",
+                dateTimeParser.parse("February 4, 2002 00:00:00.000"),
                 DateUtils.round(dateAmPm4, Calendar.AM_PM));
 
         // tests for public static Date round(Object date, int field)
@@ -729,17 +729,17 @@
         assertEquals("round calendar second-2 failed",
                 dateTimeParser.parse("November 18, 2001 1:23:11.000"),
                 DateUtils.round((Object) cal2, Calendar.SECOND));
-        assertEquals("truncate ampm-1 failed",
+        assertEquals("round ampm-1 failed",
                 dateTimeParser.parse("February 3, 2002 00:00:00.000"),
                 DateUtils.round((Object) dateAmPm1, Calendar.AM_PM));
-        assertEquals("truncate ampm-2 failed",
-                dateTimeParser.parse("February 4, 2002 00:00:00.000"),
+        assertEquals("round ampm-2 failed",
+                dateTimeParser.parse("February 3, 2002 12:00:00.000"),
                 DateUtils.round((Object) dateAmPm2, Calendar.AM_PM));
-        assertEquals("truncate ampm-3 failed",
+        assertEquals("round ampm-3 failed",
                 dateTimeParser.parse("February 3, 2002 12:00:00.000"),
                 DateUtils.round((Object) dateAmPm3, Calendar.AM_PM));
-        assertEquals("truncate ampm-4 failed",
-                dateTimeParser.parse("February 4, 2002 12:00:00.000"),
+        assertEquals("round ampm-4 failed",
+                dateTimeParser.parse("February 4, 2002 00:00:00.000"),
                 DateUtils.round((Object) dateAmPm4, Calendar.AM_PM));
 
         try {
@@ -763,17 +763,17 @@
             fail();
         } catch(IllegalArgumentException ex) {}
 
-        assertEquals("truncate ampm-1 failed",
+        assertEquals("round ampm-1 failed",
                 dateTimeParser.parse("February 3, 2002 00:00:00.000"),
                 DateUtils.round((Object) calAmPm1, Calendar.AM_PM));
-        assertEquals("truncate ampm-2 failed",
-                dateTimeParser.parse("February 4, 2002 00:00:00.000"),
+        assertEquals("round ampm-2 failed",
+                dateTimeParser.parse("February 3, 2002 12:00:00.000"),
                 DateUtils.round((Object) calAmPm2, Calendar.AM_PM));
-        assertEquals("truncate ampm-3 failed",
+        assertEquals("round ampm-3 failed",
                 dateTimeParser.parse("February 3, 2002 12:00:00.000"),
                 DateUtils.round((Object) calAmPm3, Calendar.AM_PM));
-        assertEquals("truncate ampm-4 failed",
-                dateTimeParser.parse("February 4, 2002 12:00:00.000"),
+        assertEquals("round ampm-4 failed",
+                dateTimeParser.parse("February 4, 2002 00:00:00.000"),
                 DateUtils.round((Object) calAmPm4, Calendar.AM_PM));
         
         // Fix for http://issues.apache.org/bugzilla/show_bug.cgi?id=25560



Mime
View raw message