[threeten-dev] Please help to review new test code for java.time.calendars.HijrahChronology
Patrick Zhang
patrick.zhang at oracle.com
Wed Jan 30 21:27:57 PST 2013
Hi Roger,
Thanks for update. Is the new change only for Hijrah calendar?
Or I need to change test data for JapaneseChronology, MinguoChronology
and ThaiBuddhistChronology also?
If not, is it ok to push webrev for JapaneseChronology, MinguoChronology
and ThaiBuddhistChronology into threeten repo firstly?
Regards
Patrick
On 1/30/13 11:39 PM, Roger Riggs wrote:
> Hi Patrick,
>
> The data for these tests may need to change; we are expecting
> to replace the default Hijrah calendar with one defined by the Saudi
> government
> (Umm al-Qura).
> Also there will be another variant as well.
>
> The structure of the test is good and it will be easy to update.
>
> Thanks, Roger
>
>
>
> On 1/30/2013 1:26 AM, Patrick Zhang wrote:
>> Hi Team,
>>
>> Please help to review below new added test case:
>> http://cr.openjdk.java.net/~pzhang/JSR310/java/time/calendars/HijrahChronology/test/java/time/tck/java/time/calendars/TestHijrahChronology.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/HijrahChronology/TestHijrahChronology.jtr
>> <http://cr.openjdk.java.net/%7Epzhang/JSR310/java/time/calendars/HijrahChronology/TestHijrahChronology.jtr>
>>
>> Description:
>> The new added test cases are used for prolepticYear() and isLeapYear().
>> 1. As description of HijrahChronology, year
>> 2,5,7,10,,13,16,18,21,24,26 and 29 will be leap years. So add
>> test_isLeapYear() to check it. And for leap year, date(prolepticYear,
>> 12, 30) should be equal with dateYearDay(prolepticYear, 355). For
>> non-leap year, date(prolepticYear, 12, 29) should be equal with
>> dateYearDay(prolepticYear, 354).
>>
>> 2. We can get below table from definition of HijrahChronology:
>> ISO prolepticYear 618
>> 619
>> 620
>> 621
>> 622
>> 623
>> 624
>> ...
>> year of ERA_AH -2
>> -1
>> 0
>> 1
>> 2
>> 3
>> 4
>> ...
>> year of ERA_BEFORE_AH 3
>> 2
>> 1
>> 0
>> -1
>> -2
>> -3
>> ...
>>
>>
>> From above table, then we can get return value of prolepticYear():
>> prolepticYear(ERA_AH, a) = a;
>> prolepticYear(ERA_BEFORE_AH, a) + prolepticYear(ERA_AH, a) = 1;
>> It means prolepticYear(ERA_BEFORE_AH, a)= 1-a.
>>
>> Above logic has been verified in test_prolepticYear()
>>
>>
>> Regards
>> Patrick
>
> --
> Thanks, Roger
>
> Oracle Java Platform Group
>
> Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
> developing practices and products that help protect the environment
>
More information about the threeten-dev
mailing list