test/java/time/tck/java/time/zone/TCKZoneOffsetTransition.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.temporal.Year;
  63 import java.time.zone.*;
  64 
  65 import static java.time.temporal.ChronoUnit.HOURS;
  66 import static org.testng.Assert.assertEquals;
  67 
  68 import java.io.IOException;
  69 
  70 import tck.java.time.AbstractTCKTest;
  71 import java.time.Duration;
  72 import java.time.LocalDateTime;
  73 import java.time.ZoneOffset;
  74 

  75 import org.testng.annotations.Test;
  76 
  77 /**
  78  * Test ZoneOffsetTransition.
  79  */
  80 @Test
  81 public class TCKZoneOffsetTransition extends AbstractTCKTest {
  82 
  83     private static final ZoneOffset OFFSET_0100 = ZoneOffset.ofHours(1);
  84     private static final ZoneOffset OFFSET_0200 = ZoneOffset.ofHours(2);
  85     private static final ZoneOffset OFFSET_0230 = ZoneOffset.ofHoursMinutes(2, 30);
  86     private static final ZoneOffset OFFSET_0300 = ZoneOffset.ofHours(3);
  87     private static final ZoneOffset OFFSET_0400 = ZoneOffset.ofHours(4);
  88 
  89     //-----------------------------------------------------------------------
  90     // factory
  91     //-----------------------------------------------------------------------
  92     @Test(expectedExceptions=NullPointerException.class, groups={"tck"})
  93     public void test_factory_nullTransition() {
  94         ZoneOffsetTransition.of(null, OFFSET_0100, OFFSET_0200);




  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 java.time.temporal.ChronoUnit.HOURS;
  63 import static org.testng.Assert.assertEquals;
  64 


  65 import tck.java.time.AbstractTCKTest;
  66 import java.time.Duration;
  67 import java.time.LocalDateTime;
  68 import java.time.ZoneOffset;
  69 import java.time.Year;
  70 import java.time.zone.ZoneOffsetTransition;
  71 import org.testng.annotations.Test;
  72 
  73 /**
  74  * Test ZoneOffsetTransition.
  75  */
  76 @Test
  77 public class TCKZoneOffsetTransition extends AbstractTCKTest {
  78 
  79     private static final ZoneOffset OFFSET_0100 = ZoneOffset.ofHours(1);
  80     private static final ZoneOffset OFFSET_0200 = ZoneOffset.ofHours(2);
  81     private static final ZoneOffset OFFSET_0230 = ZoneOffset.ofHoursMinutes(2, 30);
  82     private static final ZoneOffset OFFSET_0300 = ZoneOffset.ofHours(3);
  83     private static final ZoneOffset OFFSET_0400 = ZoneOffset.ofHours(4);
  84 
  85     //-----------------------------------------------------------------------
  86     // factory
  87     //-----------------------------------------------------------------------
  88     @Test(expectedExceptions=NullPointerException.class, groups={"tck"})
  89     public void test_factory_nullTransition() {
  90         ZoneOffsetTransition.of(null, OFFSET_0100, OFFSET_0200);