[threeten-dev] Please help to review new test code for java.time.calendars.ThaiBuddhistChronology
Stephen Colebourne
scolebourne at joda.org
Wed Jan 30 01:13:29 PST 2013
Looks good to me.
Stephen
On 30 January 2013 07:20, Patrick Zhang <patrick.zhang at oracle.com> wrote:
>
>
> Hi Team,
>
> Please help to review below new added test case:
> http://cr.openjdk.java.net/~pzhang/JSR310/java/time/calendars/ThaiBuddhistChronology/webrev/
>
> test result:
> http://cr.openjdk.java.net/~pzhang/JSR310/java/time/calendars/ThaiBuddhistChronology/TestThaiBuddhistChronology.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 we use both dateYearDay(year, doy) and date(era, year, month,
> dom) to construct same ISO date to confirm it works well.
> As negative test case, some non-leapYear/02/29 are added in "badDates" data
> provider and it should throw DateTimeException.
>
> 2. According to description of javadoc, we can confirm below formula should
> work:
> prolepticYear(ERA_BE, a) = a
> prolepticYear(ERA_BEFORE_BE, a) = 1-a
> prolepticYear(ERA_BE, a) = "ISO prolepticYear" + 543
>
> And we can confirm isLeapYear(prolepticYear) should return same value with
> Year.of(prolepticYear - 543).isLeap() safely.
>
> Above logic has been verified in test_prolepticYear().
>
> Regards
> Patrick
>
>
More information about the threeten-dev
mailing list