jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java
changeset 28848 824124d1cba5
parent 20795 8ec9e5b79828
child 41600 5abb663b1ca4
--- a/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java	Fri Feb 06 08:05:44 2015 -0800
+++ b/jdk/test/java/time/test/java/time/chrono/TestUmmAlQuraChronology.java	Fri Feb 06 17:29:11 2015 -0500
@@ -30,6 +30,7 @@
 import static java.time.temporal.ChronoField.MONTH_OF_YEAR;
 import static java.time.temporal.ChronoField.YEAR;
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
@@ -71,6 +72,7 @@
 /**
  * Tests for the Umm alQura chronology and data.
  * Note: The dates used for testing are just a sample of calendar data.
+ * @bug 8067800
  */
 @Test
 public class TestUmmAlQuraChronology {
@@ -530,6 +532,24 @@
         assertEquals(date.isLeapYear(), leapyear);
     }
 
+    // Data provider to verify that a given hijrah year is outside the range of supported years
+    // The values are dependent on the currently configured UmmAlQura calendar data
+    @DataProvider(name="OutOfRangeLeapYears")
+    Object[][] data_invalid_leapyears() {
+        return new Object[][] {
+                {1299},
+                {1601},
+                {Integer.MAX_VALUE},
+                {Integer.MIN_VALUE},
+        };
+    }
+
+    @Test(dataProvider="OutOfRangeLeapYears")
+    public void test_notLeapYears(int y) {
+        assertFalse(HijrahChronology.INSTANCE.isLeapYear(y), "Out of range leap year");
+    }
+
+
     // Date samples to convert HijrahDate to LocalDate and vice versa
     @DataProvider(name="samples")
     Object[][] data_samples() {