test/java/time/tck/java/time/zone/TCKZoneOffsetTransitionRule.java

Print this page




  42  *    and/or other materials provided with the distribution.
  43  *
  44  *  * Neither the name of JSR-310 nor the names of its contributors
  45  *    may be used to endorse or promote products derived from this software
  46  *    without specific prior written permission.
  47  *
  48  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  49  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  50  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  51  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  52  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  53  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  54  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  55  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  56  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  57  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  58  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  59  */
  60 package tck.java.time.zone;
  61 
  62 import java.time.ZoneId;
  63 import java.time.zone.*;
  64 import test.java.time.zone.*;
  65 
  66 import static org.testng.Assert.assertEquals;
  67 
  68 import java.io.ByteArrayOutputStream;
  69 import java.io.DataOutputStream;
  70 import java.io.IOException;
  71 
  72 import tck.java.time.AbstractTCKTest;
  73 import java.time.DayOfWeek;
  74 import java.time.LocalDateTime;
  75 import java.time.LocalTime;
  76 import java.time.Month;
  77 import java.time.ZoneOffset;


  78 import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition;
  79 
  80 import org.testng.annotations.Test;
  81 
  82 /**
  83  * Test ZoneOffsetTransitionRule.
  84  */
  85 @Test
  86 public class TCKZoneOffsetTransitionRule extends AbstractTCKTest {
  87 
  88     private static final LocalTime TIME_0100 = LocalTime.of(1, 0);
  89     private static final ZoneOffset OFFSET_0200 = ZoneOffset.ofHours(2);
  90     private static final ZoneOffset OFFSET_0300 = ZoneOffset.ofHours(3);
  91 
  92     //-----------------------------------------------------------------------
  93     // factory
  94     //-----------------------------------------------------------------------
  95     @Test(expectedExceptions=NullPointerException.class, groups={"tck"})
  96     public void test_factory_nullMonth() {
  97         ZoneOffsetTransitionRule.of(




  42  *    and/or other materials provided with the distribution.
  43  *
  44  *  * Neither the name of JSR-310 nor the names of its contributors
  45  *    may be used to endorse or promote products derived from this software
  46  *    without specific prior written permission.
  47  *
  48  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  49  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  50  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  51  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  52  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  53  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  54  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  55  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  56  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  57  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  58  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  59  */
  60 package tck.java.time.zone;
  61 




  62 import static org.testng.Assert.assertEquals;
  63 




  64 import tck.java.time.AbstractTCKTest;
  65 import java.time.DayOfWeek;
  66 import java.time.LocalDateTime;
  67 import java.time.LocalTime;
  68 import java.time.Month;
  69 import java.time.ZoneOffset;
  70 import java.time.zone.ZoneOffsetTransition;
  71 import java.time.zone.ZoneOffsetTransitionRule;
  72 import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition;
  73 
  74 import org.testng.annotations.Test;
  75 
  76 /**
  77  * Test ZoneOffsetTransitionRule.
  78  */
  79 @Test
  80 public class TCKZoneOffsetTransitionRule extends AbstractTCKTest {
  81 
  82     private static final LocalTime TIME_0100 = LocalTime.of(1, 0);
  83     private static final ZoneOffset OFFSET_0200 = ZoneOffset.ofHours(2);
  84     private static final ZoneOffset OFFSET_0300 = ZoneOffset.ofHours(3);
  85 
  86     //-----------------------------------------------------------------------
  87     // factory
  88     //-----------------------------------------------------------------------
  89     @Test(expectedExceptions=NullPointerException.class, groups={"tck"})
  90     public void test_factory_nullMonth() {
  91         ZoneOffsetTransitionRule.of(