--- old/test/java/time/tck/java/time/chrono/TCKHijrahChronology.java 2016-10-12 17:39:37.000000000 +0530 +++ new/test/java/time/tck/java/time/chrono/TCKHijrahChronology.java 2016-10-12 17:39:36.000000000 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -549,4 +549,32 @@ public void test_equals_false() { assertFalse(HijrahChronology.INSTANCE.equals(IsoChronology.INSTANCE)); } + + @DataProvider(name="alignedDayOfWeekInMonthTestDates") + Object[][] data_alignedDayOfWeekInMonth() { + return new Object[][] { + {1437, 9, 1, 1, 1}, //Monday is the 1st day of Month + {1437, 10, 1, 1, 1}, //Any Other day is the 1st day of month + {1437, 10, 11, 2, 31}, + {1437, 10, 29, 5, 1}, + }; + } + + //----------------------------------------------------------------------- + // Test for aligned-week-of-month calculation based on the day-of-month + //----------------------------------------------------------------------- + @Test(dataProvider="alignedDayOfWeekInMonthTestDates") + public void test_alignedWeekOfMonth(int year, int month, int dom, int wom, int dowm) { + HijrahDate date = HijrahChronology.INSTANCE.date(year, month, dom); + assertEquals(date.getLong(ChronoField.ALIGNED_WEEK_OF_MONTH), wom); + } + + //----------------------------------------------------------------------- + // Test for aligned-day-of-week calculation based on the day-of-month + //----------------------------------------------------------------------- + @Test(dataProvider="alignedDayOfWeekInMonthTestDates") + public void test_alignedDayOfWeekInMonth(int year, int month, int dom, int wom, int dowm) { + HijrahDate date = HijrahChronology.INSTANCE.date(year, month, dom); + assertEquals(date.getLong(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH), dowm); + } }