Search in sources :

Example 56 with MonthDay

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

the class TCKMonthDay method test_isValidYear_febNonLeap.

@Test
public void test_isValidYear_febNonLeap() {
    MonthDay test = MonthDay.of(2, 29);
    assertEquals(test.isValidYear(2007), false);
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test)

Example 57 with MonthDay

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

the class TCKMonthDay method test_hashCode.

// -----------------------------------------------------------------------
// hashCode()
// -----------------------------------------------------------------------
@Test()
@UseDataProvider("provider_sampleDates")
public void test_hashCode(int m, int d) {
    MonthDay a = MonthDay.of(m, d);
    assertEquals(a.hashCode(), a.hashCode());
    MonthDay b = MonthDay.of(m, d);
    assertEquals(a.hashCode(), b.hashCode());
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test) UseDataProvider(com.tngtech.java.junit.dataprovider.UseDataProvider)

Example 58 with MonthDay

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

the class TestMonthDay method test_withDayOfMonth_noChangeSame.

@Test
public void test_withDayOfMonth_noChangeSame() {
    MonthDay test = MonthDay.of(6, 30);
    assertSame(test.withDayOfMonth(30), test);
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test)

Example 59 with MonthDay

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

the class TestMonthDay method test_adjustDate_same.

@Test
public void test_adjustDate_same() {
    MonthDay test = MonthDay.of(6, 30);
    LocalDate date = LocalDate.of(2007, 6, 30);
    assertSame(test.adjustInto(date), date);
}
Also used : MonthDay(java.time.MonthDay) LocalDate(java.time.LocalDate) 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