commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19364] New: - [Lang] time unit tests fail on Sundays
Date Sun, 27 Apr 2003 14:49:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19364>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19364

[Lang] time unit tests fail on Sundays

           Summary: [Lang] time unit tests fail on Sundays
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Lang
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: phil@steitz.com


The time unit tests fail when run on a Sunday:

test.time:
     [echo] Running time package tests ...
     [java] ...F.F................
     [java] Time: 4.394
     [java] There were 2 failures:
     [java] 1)
testParse(org.apache.commons.lang.time.CalendarUtilsTest)junit.framework.AssertionFailedError:
parse last Sunday expected Sun Apr 27 06:39:17 MST 2003 but got Sun Apr 20
06:39:17 MST 2003
     [java] 	at
org.apache.commons.lang.time.CalendarUtilsTest.assertEquals(CalendarUtilsTest.java:373)
     [java] 	at
org.apache.commons.lang.time.CalendarUtilsTest.testParse(CalendarUtilsTest.java:243)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] 2)
testWeekIterator(org.apache.commons.lang.time.CalendarUtilsTest)junit.framework.AssertionFailedError:
 expected Mon Apr 28 00:00:00 MST 2003 but got Mon Apr 21 00:00:00 MST 2003
     [java] 	at
org.apache.commons.lang.time.CalendarUtilsTest.assertEquals(CalendarUtilsTest.java:373)
     [java] 	at
org.apache.commons.lang.time.CalendarUtilsTest.assertWeekIterator(CalendarUtilsTest.java:346)
     [java] 	at
org.apache.commons.lang.time.CalendarUtilsTest.assertWeekIterator(CalendarUtilsTest.java:324)
     [java] 	at
org.apache.commons.lang.time.CalendarUtilsTest.testWeekIterator(CalendarUtilsTest.java:284)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Looks to me like the unit test code is checking the value of Calendar.DATE, when
it should be looking at Calendar.DAY_OF_WEEK (at line 237 and below) to decide
whether to make adjustments for today==Sunday.

When I fix this, testParse succeeds but testWeekIterator hangs at the statement
it = CalendarUtils.getCalendarIterator(now, CalendarUtils.RANGE_WEEK_RELATIVE);

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


Mime
View raw message