[threeten-dev] Please help to review new test code for java.time.calendars.JapaneseChronology

Patrick Zhang patrick.zhang at oracle.com
Tue Jan 29 22:46:03 PST 2013


Hi Team,

Please help to review below new added test case:
http://cr.openjdk.java.net/~pzhang/JSR310/java/time/calendars/JapaneseChronology/test/java/time/tck/java/time/calendars/TestJapaneseChronology.java.udiff.html 
<http://cr.openjdk.java.net/%7Epzhang/JSR310/java/time/calendars/HijrahChronology/test/java/time/tck/java/time/calendars/TestHijrahChronology.java.udiff.html>

test result:
http://cr.openjdk.java.net/~pzhang/JSR310/java/time/calendars/JapaneseChronology/TestJapaneseChronology.jtr 
<http://cr.openjdk.java.net/%7Epzhang/JSR310/java/time/calendars/HijrahChronology/TestHijrahChronology.jtr>

Description:
The new added test cases are used for prolepticYear(), datYearDay and 
isLeapYear().
1. As positive test case, some leapYear/02/29 are verified with 
according ISO date. And as negative test case, some non-leapYear/02/29 
are added in "badDates" data provider and it should throw 
DateTimeException. And we use both dateYearDay(year, doy) and date(era, 
year, month, dom) to construct same ISO date to confirm it works well.

2. Since prolepticYear of JapaneseChronology is same with ISO calendar 
system, then for all eras, we can confirm below formula should work:
     prolepticYear(ear, a) = a + era_diff

JapaneseChronology leap year is same with ISO leap year. Then we can 
confirm isLeapYear(prolepticYear) should return same value with 
Year.of(prolepticYear).isLeap() safely.

Above logic has been verified in test_prolepticYear().

Regards
Patrick


More information about the threeten-dev mailing list