use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method test_normalized_max.
@Test(expectedExceptions = ArithmeticException.class)
public void test_normalized_max() {
Period base = Period.of(Integer.MAX_VALUE, 12, 0);
base.normalized();
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method test_minusMonths_overflowTooBig.
@Test(expectedExceptions = ArithmeticException.class)
public void test_minusMonths_overflowTooBig() {
Period test = Period.ofMonths(Integer.MAX_VALUE);
test.minusMonths(-1);
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_periodUntil_LocalDate.
@Test(dataProvider = "until")
public void test_periodUntil_LocalDate(int y1, int m1, int d1, int y2, int m2, int d2, int ye, int me, int de) {
LocalDate start = LocalDate.of(y1, m1, d1);
LocalDate end = LocalDate.of(y2, m2, d2);
Period test = start.until(end);
assertEquals(test.getYears(), ye);
assertEquals(test.getMonths(), me);
assertEquals(test.getDays(), de);
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method test_minusYears_overflowTooBig.
@Test(expectedExceptions = ArithmeticException.class)
public void test_minusYears_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE);
test.minusYears(-1);
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method factory_parse_lowerCase.
@Test(dataProvider = "parseSuccess")
public void factory_parse_lowerCase(String text, Period expected) {
Period p = Period.parse(text.toLowerCase(Locale.ENGLISH));
assertEquals(p, expected);
}
Aggregations