public void testConstructor_long_long_minMax() throws Throwable { Interval test = new Interval(Long.MIN_VALUE, Long.MAX_VALUE); assertEquals(Long.MIN_VALUE, test.getStartMillis()); assertEquals(Long.MAX_VALUE, test.getEndMillis()); assertEquals(new DateTime(Long.MIN_VALUE), test.getStart()); assertEquals(new DateTime(Long.MAX_VALUE), test.getEnd()); assertEquals(ISOChronology.getInstance(), test.getChronology()); assertEquals(test, test.toInterval()); assertEquals( "-292275055-05-16T16:56:25.192+00:09:21/292278994-08-17T07:12:55.807Z", test.toString()); try { test.toDuration(); fail(); } catch (ArithmeticException ex) { } try { test.toDurationMillis(); fail(); } catch (ArithmeticException ex) { } try { test.toPeriod(); fail(); } catch (RuntimeException ex) { } }
public void testConstructor_long_long_min() throws Throwable { Interval test = new Interval(Long.MIN_VALUE, Long.MIN_VALUE + 9); assertEquals(Long.MIN_VALUE, test.getStartMillis()); assertEquals(Long.MIN_VALUE + 9, test.getEndMillis()); assertEquals(new DateTime(Long.MIN_VALUE), test.getStart()); assertEquals(new DateTime(Long.MIN_VALUE + 9), test.getEnd()); assertEquals(ISOChronology.getInstance(), test.getChronology()); assertEquals(test, test.toInterval()); assertEquals( "-292275055-05-16T16:56:25.192+00:09:21/-292275055-05-16T16:56:25.201+00:09:21", test.toString()); assertEquals(9, test.toDurationMillis()); assertEquals(new Duration(9), test.toDuration()); assertEquals(new Period(9), test.toPeriod()); }