changeset 50542:b6ff4cd463e3

8204342: methods in java.time s TCKZoneRules OpenJDK test miss Test annotation Summary: Added Test annotation to test methods Reviewed-by: rriggs, naoto
author vtheeyarath
date Tue, 12 Jun 2018 22:23:35 -0700
parents cf88c15d9171
children ad42438983ee a1a3d41b6c13
files test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java
diffstat 1 files changed, 51 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java	Wed Jun 13 08:44:23 2018 -0700
+++ b/test/jdk/java/time/tck/java/time/zone/TCKZoneRules.java	Tue Jun 12 22:23:35 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -112,11 +112,13 @@
         return ZoneId.of("Europe/London").getRules();
     }
 
+    @Test
     public void test_London() {
         ZoneRules test = europeLondon();
         assertEquals(test.isFixedOffset(), false);
     }
 
+    @Test
     public void test_London_preTimeZones() {
         ZoneRules test = europeLondon();
         ZonedDateTime old = createZDT(1800, 1, 1, ZoneOffset.UTC);
@@ -129,6 +131,7 @@
         assertEquals(test.isDaylightSavings(instant), false);
     }
 
+    @Test
     public void test_London_getOffset() {
         ZoneRules test = europeLondon();
         assertEquals(test.getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC)), OFFSET_ZERO);
@@ -145,6 +148,7 @@
         assertEquals(test.getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC)), OFFSET_ZERO);
     }
 
+    @Test
     public void test_London_getOffset_toDST() {
         ZoneRules test = europeLondon();
         assertEquals(test.getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC)), OFFSET_ZERO);
@@ -160,6 +164,7 @@
         assertEquals(test.getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_PONE);
     }
 
+    @Test
     public void test_London_getOffset_fromDST() {
         ZoneRules test = europeLondon();
         assertEquals(test.getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC)), OFFSET_PONE);
@@ -175,6 +180,7 @@
         assertEquals(test.getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_ZERO);
     }
 
+    @Test
     public void test_London_getOffsetInfo() {
         ZoneRules test = europeLondon();
         checkOffset(test, createLDT(2008, 1, 1), OFFSET_ZERO, 1);
@@ -191,6 +197,7 @@
         checkOffset(test, createLDT(2008, 12, 1), OFFSET_ZERO, 1);
     }
 
+    @Test
     public void test_London_getOffsetInfo_toDST() {
         ZoneRules test = europeLondon();
         checkOffset(test, createLDT(2008, 3, 24), OFFSET_ZERO, 1);
@@ -206,6 +213,7 @@
         checkOffset(test, LocalDateTime.of(2008, 3, 30, 2, 0, 0, 0), OFFSET_PONE, 1);
     }
 
+    @Test
     public void test_London_getOffsetInfo_fromDST() {
         ZoneRules test = europeLondon();
         checkOffset(test, createLDT(2008, 10, 24), OFFSET_PONE, 1);
@@ -221,6 +229,7 @@
         checkOffset(test, LocalDateTime.of(2008, 10, 26, 2, 0, 0, 0), OFFSET_ZERO, 1);
     }
 
+    @Test
     public void test_London_getOffsetInfo_gap() {
         ZoneRules test = europeLondon();
         final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 1, 0, 0, 0);
@@ -246,6 +255,7 @@
         assertEquals(trans.hashCode(), otherTrans.hashCode());
     }
 
+    @Test
     public void test_London_getOffsetInfo_overlap() {
         ZoneRules test = europeLondon();
         final LocalDateTime dateTime = LocalDateTime.of(2008, 10, 26, 1, 0, 0, 0);
@@ -272,6 +282,7 @@
         assertEquals(trans.hashCode(), otherTrans.hashCode());
     }
 
+    @Test
     public void test_London_getStandardOffset() {
         ZoneRules test = europeLondon();
         ZonedDateTime zdt = createZDT(1840, 1, 1, ZoneOffset.UTC);
@@ -288,6 +299,7 @@
         }
     }
 
+    @Test
     public void test_London_getTransitions() {
         ZoneRules test = europeLondon();
         List<ZoneOffsetTransition> trans = test.getTransitions();
@@ -365,6 +377,7 @@
         assertEquals(it.hasNext(), false);
     }
 
+    @Test
     public void test_London_getTransitionRules() {
         ZoneRules test = europeLondon();
         List<ZoneOffsetTransitionRule> rules = test.getTransitionRules();
@@ -392,6 +405,7 @@
     }
 
     //-----------------------------------------------------------------------
+    @Test
     public void test_London_nextTransition_historic() {
         ZoneRules test = europeLondon();
         List<ZoneOffsetTransition> trans = test.getTransitions();
@@ -408,6 +422,7 @@
         }
     }
 
+    @Test
     public void test_London_nextTransition_rulesBased() {
         ZoneRules test = europeLondon();
         List<ZoneOffsetTransitionRule> rules = test.getTransitionRules();
@@ -429,6 +444,7 @@
         }
     }
 
+    @Test
     public void test_London_nextTransition_lastYear() {
         ZoneRules test = europeLondon();
         List<ZoneOffsetTransitionRule> rules = test.getTransitionRules();
@@ -437,6 +453,7 @@
     }
 
     //-----------------------------------------------------------------------
+    @Test
     public void test_London_previousTransition_historic() {
         ZoneRules test = europeLondon();
         List<ZoneOffsetTransition> trans = test.getTransitions();
@@ -455,6 +472,7 @@
         }
     }
 
+    @Test
     public void test_London_previousTransition_rulesBased() {
         ZoneRules test = europeLondon();
         List<ZoneOffsetTransitionRule> rules = test.getTransitionRules();
@@ -492,11 +510,13 @@
         return ZoneId.of("Europe/Paris").getRules();
     }
 
+    @Test
     public void test_Paris() {
         ZoneRules test = europeParis();
         assertEquals(test.isFixedOffset(), false);
     }
 
+    @Test
     public void test_Paris_preTimeZones() {
         ZoneRules test = europeParis();
         ZonedDateTime old = createZDT(1800, 1, 1, ZoneOffset.UTC);
@@ -509,6 +529,7 @@
         assertEquals(test.isDaylightSavings(instant), false);
     }
 
+    @Test
     public void test_Paris_getOffset() {
         ZoneRules test = europeParis();
         assertEquals(test.getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC)), OFFSET_PONE);
@@ -525,6 +546,7 @@
         assertEquals(test.getOffset(createInstant(2008, 12, 1, ZoneOffset.UTC)), OFFSET_PONE);
     }
 
+    @Test
     public void test_Paris_getOffset_toDST() {
         ZoneRules test = europeParis();
         assertEquals(test.getOffset(createInstant(2008, 3, 24, ZoneOffset.UTC)), OFFSET_PONE);
@@ -540,6 +562,7 @@
         assertEquals(test.getOffset(createInstant(2008, 3, 30, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_PTWO);
     }
 
+    @Test
     public void test_Paris_getOffset_fromDST() {
         ZoneRules test = europeParis();
         assertEquals(test.getOffset(createInstant(2008, 10, 24, ZoneOffset.UTC)), OFFSET_PTWO);
@@ -555,6 +578,7 @@
         assertEquals(test.getOffset(createInstant(2008, 10, 26, 1, 0, 0, 0, ZoneOffset.UTC)), OFFSET_PONE);
     }
 
+    @Test
     public void test_Paris_getOffsetInfo() {
         ZoneRules test = europeParis();
         checkOffset(test, createLDT(2008, 1, 1), OFFSET_PONE, 1);
@@ -571,6 +595,7 @@
         checkOffset(test, createLDT(2008, 12, 1), OFFSET_PONE, 1);
     }
 
+    @Test
     public void test_Paris_getOffsetInfo_toDST() {
         ZoneRules test = europeParis();
         checkOffset(test, createLDT(2008, 3, 24), OFFSET_PONE, 1);
@@ -586,6 +611,7 @@
         checkOffset(test, LocalDateTime.of(2008, 3, 30, 3, 0, 0, 0), OFFSET_PTWO, 1);
     }
 
+    @Test
     public void test_Paris_getOffsetInfo_fromDST() {
         ZoneRules test = europeParis();
         checkOffset(test, createLDT(2008, 10, 24), OFFSET_PTWO, 1);
@@ -601,6 +627,7 @@
         checkOffset(test, LocalDateTime.of(2008, 10, 26, 3, 0, 0, 0), OFFSET_PONE, 1);
     }
 
+    @Test
     public void test_Paris_getOffsetInfo_gap() {
         ZoneRules test = europeParis();
         final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 30, 2, 0, 0, 0);
@@ -624,6 +651,7 @@
         assertEquals(trans.hashCode(), otherTrans.hashCode());
     }
 
+    @Test
     public void test_Paris_getOffsetInfo_overlap() {
         ZoneRules test = europeParis();
         final LocalDateTime dateTime = LocalDateTime.of(2008, 10, 26, 2, 0, 0, 0);
@@ -648,6 +676,7 @@
         assertEquals(trans.hashCode(), otherTrans.hashCode());
     }
 
+    @Test
     public void test_Paris_getStandardOffset() {
         ZoneRules test = europeParis();
         ZonedDateTime zdt = createZDT(1840, 1, 1, ZoneOffset.UTC);
@@ -675,11 +704,13 @@
         return ZoneId.of("America/New_York").getRules();
     }
 
+    @Test
     public void test_NewYork() {
         ZoneRules test = americaNewYork();
         assertEquals(test.isFixedOffset(), false);
     }
 
+    @Test
     public void test_NewYork_preTimeZones() {
         ZoneRules test = americaNewYork();
         ZonedDateTime old = createZDT(1800, 1, 1, ZoneOffset.UTC);
@@ -692,6 +723,7 @@
         assertEquals(test.isDaylightSavings(instant), false);
     }
 
+    @Test
     public void test_NewYork_getOffset() {
         ZoneRules test = americaNewYork();
         ZoneOffset offset = ZoneOffset.ofHours(-5);
@@ -721,6 +753,7 @@
         assertEquals(test.getOffset(createInstant(2008, 12, 28, offset)), ZoneOffset.ofHours(-5));
     }
 
+    @Test
     public void test_NewYork_getOffset_toDST() {
         ZoneRules test = americaNewYork();
         ZoneOffset offset = ZoneOffset.ofHours(-5);
@@ -736,6 +769,7 @@
         assertEquals(test.getOffset(createInstant(2008, 3, 9, 2, 0, 0, 0, offset)), ZoneOffset.ofHours(-4));
     }
 
+    @Test
     public void test_NewYork_getOffset_fromDST() {
         ZoneRules test = americaNewYork();
         ZoneOffset offset = ZoneOffset.ofHours(-4);
@@ -751,6 +785,7 @@
         assertEquals(test.getOffset(createInstant(2008, 11, 2, 2, 0, 0, 0, offset)), ZoneOffset.ofHours(-5));
     }
 
+    @Test
     public void test_NewYork_getOffsetInfo() {
         ZoneRules test = americaNewYork();
         checkOffset(test, createLDT(2008, 1, 1), ZoneOffset.ofHours(-5), 1);
@@ -779,6 +814,7 @@
         checkOffset(test, createLDT(2008, 12, 28), ZoneOffset.ofHours(-5), 1);
     }
 
+    @Test
     public void test_NewYork_getOffsetInfo_toDST() {
         ZoneRules test = americaNewYork();
         checkOffset(test, createLDT(2008, 3, 8), ZoneOffset.ofHours(-5), 1);
@@ -793,6 +829,7 @@
         checkOffset(test, LocalDateTime.of(2008, 3, 9, 3, 0, 0, 0), ZoneOffset.ofHours(-4), 1);
     }
 
+    @Test
     public void test_NewYork_getOffsetInfo_fromDST() {
         ZoneRules test = americaNewYork();
         checkOffset(test, createLDT(2008, 11, 1), ZoneOffset.ofHours(-4), 1);
@@ -807,6 +844,7 @@
         checkOffset(test, LocalDateTime.of(2008, 11, 2, 2, 0, 0, 0), ZoneOffset.ofHours(-5), 1);
     }
 
+    @Test
     public void test_NewYork_getOffsetInfo_gap() {
         ZoneRules test = americaNewYork();
         final LocalDateTime dateTime = LocalDateTime.of(2008, 3, 9, 2, 0, 0, 0);
@@ -830,6 +868,7 @@
         assertEquals(trans.hashCode(), otherTrans.hashCode());
     }
 
+    @Test
     public void test_NewYork_getOffsetInfo_overlap() {
         ZoneRules test = americaNewYork();
         final LocalDateTime dateTime = LocalDateTime.of(2008, 11, 2, 1, 0, 0, 0);
@@ -854,6 +893,7 @@
         assertEquals(trans.hashCode(), otherTrans.hashCode());
     }
 
+    @Test
     public void test_NewYork_getStandardOffset() {
         ZoneRules test = americaNewYork();
         ZonedDateTime dateTime = createZDT(1860, 1, 1, ZoneOffset.UTC);
@@ -875,6 +915,7 @@
         return ZoneId.of("Asia/Kathmandu").getRules();
     }
 
+    @Test
     public void test_Kathmandu_nextTransition_historic() {
         ZoneRules test = asiaKathmandu();
         List<ZoneOffsetTransition> trans = test.getTransitions();
@@ -891,6 +932,7 @@
         }
     }
 
+    @Test
     public void test_Kathmandu_nextTransition_noRules() {
         ZoneRules test = asiaKathmandu();
         List<ZoneOffsetTransition> trans = test.getTransitions();
@@ -906,6 +948,7 @@
         return ZoneId.of("Pacific/Apia").getRules();
     }
 
+    @Test
     public void test_Apia_nextTransition_historic() {
         ZoneRules test = pacificApia();
         List<ZoneOffsetTransition> trans = test.getTransitions();
@@ -922,6 +965,7 @@
         }
     }
 
+    @Test
     public void test_Apia_jumpOverInternationalDateLine_M10_to_P14() {
         // transition occurred at 2011-12-30T00:00-10:00
         ZoneRules test = pacificApia();
@@ -940,6 +984,7 @@
         assertEquals(zdt.plusHours(2).toLocalDateTime(), LocalDateTime.of(2011, 12, 31, 1, 0));
     }
 
+    @Test
     public void test_Apia_jumpForwardOverInternationalDateLine_P12_to_M12() {
         // transition occurred at 1892-07-04T00:00+12:33:04
         ZoneRules test = pacificApia();
@@ -974,6 +1019,7 @@
     //-----------------------------------------------------------------------
     // of()
     //-----------------------------------------------------------------------
+    @Test
     public void test_of(){
         //used for standard offset
         ZoneOffset stdOffset1 = ZoneOffset.UTC;
@@ -1049,6 +1095,7 @@
     //-----------------------------------------------------------------------
     // equals() / hashCode()
     //-----------------------------------------------------------------------
+    @Test
     public void test_equals() {
         ZoneRules test1 = europeLondon();
         ZoneRules test2 = europeParis();
@@ -1065,14 +1112,17 @@
         assertEquals(test2.hashCode() == test2b.hashCode(), true);
     }
 
+    @Test
     public void test_equals_null() {
         assertEquals(europeLondon().equals(null), false);
     }
 
+    @Test
     public void test_equals_notZoneRules() {
         assertEquals(europeLondon().equals("Europe/London"), false);
     }
 
+    @Test
     public void test_toString() {
         assertEquals(europeLondon().toString().contains("ZoneRules"), true);
     }