use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method factory_parse_plus.
@Test(dataProvider = "parseSuccess")
public void factory_parse_plus(String text, Period expected) {
Period p = Period.parse("+" + text);
assertEquals(p, expected);
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method test_plusMonths_overflowTooSmall.
@Test(expectedExceptions = ArithmeticException.class)
public void test_plusMonths_overflowTooSmall() {
Period test = Period.ofMonths(Integer.MIN_VALUE);
test.plusMonths(-1);
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method test_multipliedBy_overflowTooBig.
@Test(expectedExceptions = ArithmeticException.class)
public void test_multipliedBy_overflowTooBig() {
Period test = Period.ofYears(Integer.MAX_VALUE / 2 + 1);
test.multipliedBy(2);
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method test_minusDays_overflowTooSmall.
@Test(expectedExceptions = ArithmeticException.class)
public void test_minusDays_overflowTooSmall() {
Period test = Period.ofDays(Integer.MIN_VALUE);
test.minusDays(1);
}
use of java.time.Period in project jdk8u_jdk by JetBrains.
the class TCKPeriod method test_good_getUnit.
@Test(dataProvider = "GoodTemporalUnit")
public void test_good_getUnit(long amount, TemporalUnit unit) {
Period period = Period.of(2, 2, 2);
long actual = period.get(unit);
assertEquals(actual, amount, "Value of unit: " + unit);
}
Aggregations