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.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@664642 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2008-06-09 07:15:50 +00:00
parent b57e9b6fd4
commit 08c4a79f5c
1 changed files with 18 additions and 18 deletions

View File

@ -667,17 +667,17 @@ public void testRound() throws Exception {
assertEquals("round second-2 failed", assertEquals("round second-2 failed",
dateTimeParser.parse("November 18, 2001 1:23:11.000"), dateTimeParser.parse("November 18, 2001 1:23:11.000"),
DateUtils.round(date2, Calendar.SECOND)); DateUtils.round(date2, Calendar.SECOND));
assertEquals("truncate ampm-1 failed", assertEquals("round ampm-1 failed",
dateTimeParser.parse("February 3, 2002 00:00:00.000"), dateTimeParser.parse("February 3, 2002 00:00:00.000"),
DateUtils.round(dateAmPm1, Calendar.AM_PM)); DateUtils.round(dateAmPm1, Calendar.AM_PM));
assertEquals("truncate ampm-2 failed", assertEquals("round ampm-2 failed",
dateTimeParser.parse("February 4, 2002 00:00:00.000"), dateTimeParser.parse("February 3, 2002 12:00:00.000"),
DateUtils.round(dateAmPm2, Calendar.AM_PM)); 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"), dateTimeParser.parse("February 3, 2002 12:00:00.000"),
DateUtils.round(dateAmPm3, Calendar.AM_PM)); DateUtils.round(dateAmPm3, Calendar.AM_PM));
assertEquals("truncate ampm-4 failed", assertEquals("round ampm-4 failed",
dateTimeParser.parse("February 4, 2002 12:00:00.000"), dateTimeParser.parse("February 4, 2002 00:00:00.000"),
DateUtils.round(dateAmPm4, Calendar.AM_PM)); DateUtils.round(dateAmPm4, Calendar.AM_PM));
// tests for public static Date round(Object date, int field) // tests for public static Date round(Object date, int field)
@ -729,17 +729,17 @@ public void testRound() throws Exception {
assertEquals("round calendar second-2 failed", assertEquals("round calendar second-2 failed",
dateTimeParser.parse("November 18, 2001 1:23:11.000"), dateTimeParser.parse("November 18, 2001 1:23:11.000"),
DateUtils.round((Object) cal2, Calendar.SECOND)); 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"), dateTimeParser.parse("February 3, 2002 00:00:00.000"),
DateUtils.round((Object) dateAmPm1, Calendar.AM_PM)); DateUtils.round((Object) dateAmPm1, Calendar.AM_PM));
assertEquals("truncate ampm-2 failed", assertEquals("round ampm-2 failed",
dateTimeParser.parse("February 4, 2002 00:00:00.000"), dateTimeParser.parse("February 3, 2002 12:00:00.000"),
DateUtils.round((Object) dateAmPm2, Calendar.AM_PM)); 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"), dateTimeParser.parse("February 3, 2002 12:00:00.000"),
DateUtils.round((Object) dateAmPm3, Calendar.AM_PM)); DateUtils.round((Object) dateAmPm3, Calendar.AM_PM));
assertEquals("truncate ampm-4 failed", assertEquals("round ampm-4 failed",
dateTimeParser.parse("February 4, 2002 12:00:00.000"), dateTimeParser.parse("February 4, 2002 00:00:00.000"),
DateUtils.round((Object) dateAmPm4, Calendar.AM_PM)); DateUtils.round((Object) dateAmPm4, Calendar.AM_PM));
try { try {
@ -763,17 +763,17 @@ public void testRound() throws Exception {
fail(); fail();
} catch(IllegalArgumentException ex) {} } catch(IllegalArgumentException ex) {}
assertEquals("truncate ampm-1 failed", assertEquals("round ampm-1 failed",
dateTimeParser.parse("February 3, 2002 00:00:00.000"), dateTimeParser.parse("February 3, 2002 00:00:00.000"),
DateUtils.round((Object) calAmPm1, Calendar.AM_PM)); DateUtils.round((Object) calAmPm1, Calendar.AM_PM));
assertEquals("truncate ampm-2 failed", assertEquals("round ampm-2 failed",
dateTimeParser.parse("February 4, 2002 00:00:00.000"), dateTimeParser.parse("February 3, 2002 12:00:00.000"),
DateUtils.round((Object) calAmPm2, Calendar.AM_PM)); 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"), dateTimeParser.parse("February 3, 2002 12:00:00.000"),
DateUtils.round((Object) calAmPm3, Calendar.AM_PM)); DateUtils.round((Object) calAmPm3, Calendar.AM_PM));
assertEquals("truncate ampm-4 failed", assertEquals("round ampm-4 failed",
dateTimeParser.parse("February 4, 2002 12:00:00.000"), dateTimeParser.parse("February 4, 2002 00:00:00.000"),
DateUtils.round((Object) calAmPm4, Calendar.AM_PM)); DateUtils.round((Object) calAmPm4, Calendar.AM_PM));
// Fix for http://issues.apache.org/bugzilla/show_bug.cgi?id=25560 // Fix for http://issues.apache.org/bugzilla/show_bug.cgi?id=25560