Search in sources :

Example 51 with MonthDay

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

the class TCKMonthDay method now.

// -----------------------------------------------------------------------
// now()
// -----------------------------------------------------------------------
@Test
public void now() {
    MonthDay expected = MonthDay.now(Clock.systemDefaultZone());
    MonthDay test = MonthDay.now();
    for (int i = 0; i < 100; i++) {
        if (expected.equals(test)) {
            return;
        }
        expected = MonthDay.now(Clock.systemDefaultZone());
        test = MonthDay.now();
    }
    assertEquals(test, expected);
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test)

Example 52 with MonthDay

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

the class TCKMonthDay method test_atYear_int.

// -----------------------------------------------------------------------
// atYear(int)
// -----------------------------------------------------------------------
@Test
public void test_atYear_int() {
    MonthDay test = MonthDay.of(6, 30);
    assertEquals(test.atYear(2008), LocalDate.of(2008, 6, 30));
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test)

Example 53 with MonthDay

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

the class TCKMonthDay method test_isValidYear_june.

// -----------------------------------------------------------------------
// isValidYear(int)
// -----------------------------------------------------------------------
@Test
public void test_isValidYear_june() {
    MonthDay test = MonthDay.of(6, 30);
    assertEquals(test.isValidYear(2007), true);
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test)

Example 54 with MonthDay

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

the class TCKMonthDay method test_adjustDate_resolve.

@Test
public void test_adjustDate_resolve() {
    MonthDay test = MonthDay.of(2, 29);
    LocalDate date = LocalDate.of(2007, 6, 30);
    assertEquals(test.adjustInto(date), LocalDate.of(2007, 2, 28));
}
Also used : MonthDay(java.time.MonthDay) LocalDate(java.time.LocalDate) Test(org.junit.Test)

Example 55 with MonthDay

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

the class TCKMonthDay method test_atYear_int_leapYearAdjust.

@Test
public void test_atYear_int_leapYearAdjust() {
    MonthDay test = MonthDay.of(2, 29);
    assertEquals(test.atYear(2005), LocalDate.of(2005, 2, 28));
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test)

Aggregations

MonthDay (java.time.MonthDay)59 Test (org.junit.Test)27 Test (org.testng.annotations.Test)25 LocalDate (java.time.LocalDate)9 UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)4 DateTimeFormatter (java.time.format.DateTimeFormatter)3 Clock (java.time.Clock)2 Instant (java.time.Instant)2 ZoneId (java.time.ZoneId)2 Cache (com.google.common.cache.Cache)1 CacheBuilder (com.google.common.cache.CacheBuilder)1 Subscribe (com.google.common.eventbus.Subscribe)1 IOException (java.io.IOException)1 YearMonth (java.time.YearMonth)1 java.util (java.util)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Collectors (java.util.stream.Collectors)1 JDOUserException (javax.jdo.JDOUserException)1 PersistenceManager (javax.jdo.PersistenceManager)1 Transaction (javax.jdo.Transaction)1