Search in sources :

Example 41 with Period

use of java.time.Period in project j2objc by google.

the class TCKPeriod method test_equals_otherClass.

public void test_equals_otherClass() {
    Period test = Period.of(1, 2, 3);
    assertEquals(test.equals(""), false);
}
Also used : Period(java.time.Period)

Example 42 with Period

use of java.time.Period in project j2objc by google.

the class TCKPeriod method test_normalized_min.

@Test(expected = ArithmeticException.class)
public void test_normalized_min() {
    Period base = Period.of(Integer.MIN_VALUE, -12, 0);
    base.normalized();
}
Also used : Period(java.time.Period) Test(org.junit.Test)

Example 43 with Period

use of java.time.Period in project j2objc by google.

the class TCKPeriod method test_plusMonths_overflowTooBig.

@Test(expected = ArithmeticException.class)
public void test_plusMonths_overflowTooBig() {
    Period test = Period.ofMonths(Integer.MAX_VALUE);
    test.plusMonths(1);
}
Also used : Period(java.time.Period) Test(org.junit.Test)

Example 44 with Period

use of java.time.Period in project j2objc by google.

the class TCKPeriod method test_multipliedBy_overflowTooSmall.

@Test(expected = ArithmeticException.class)
public void test_multipliedBy_overflowTooSmall() {
    Period test = Period.ofYears(Integer.MIN_VALUE / 2 - 1);
    test.multipliedBy(2);
}
Also used : Period(java.time.Period) Test(org.junit.Test)

Example 45 with Period

use of java.time.Period in project j2objc by google.

the class TCKPeriod method test_plusDays_overflowTooSmall.

@Test(expected = ArithmeticException.class)
public void test_plusDays_overflowTooSmall() {
    Period test = Period.ofDays(Integer.MIN_VALUE);
    test.plusDays(-1);
}
Also used : Period(java.time.Period) Test(org.junit.Test)

Aggregations

Period (java.time.Period)108 Test (org.junit.Test)38 Test (org.testng.annotations.Test)27 LocalDate (java.time.LocalDate)20 Duration (java.time.Duration)9 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)8 LocalDateTime (java.time.LocalDateTime)7 ZonedDateTime (java.time.ZonedDateTime)7 Date (java.util.Date)6 LocalTime (java.time.LocalTime)5 ZoneId (java.time.ZoneId)5 DateTimeFormatter (java.time.format.DateTimeFormatter)5 List (java.util.List)5 Test (org.junit.jupiter.api.Test)5 Instant (java.time.Instant)4 DateTimeParseException (java.time.format.DateTimeParseException)4 Temporal (java.time.temporal.Temporal)4 TemporalAmount (java.time.temporal.TemporalAmount)4 Arrays (java.util.Arrays)4 Collectors (java.util.stream.Collectors)4