Search in sources :

Example 46 with MonthDay

use of java.time.MonthDay in project JDK8 by ABHSY.

the class DataExcample2 method testData.

@Test
public void testData() {
    LocalDate of = LocalDate.of(2014, 4, 1);
    // System.out.print(of.equals(today));
    LocalDate localDate = today.plusDays(1);
    // boolean after = localDate.isAfter(of);
    System.out.print(localDate.isBefore(of));
    LocalDate datebirth = LocalDate.of(1994, 4, 1);
    MonthDay of1 = MonthDay.of(datebirth.getMonth(), datebirth.getDayOfMonth());
    MonthDay currentMonthDay = MonthDay.from(today);
}
Also used : MonthDay(java.time.MonthDay) LocalDate(java.time.LocalDate) Test(org.junit.Test)

Example 47 with MonthDay

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

the class TCKMonthDay method test_with_Month_noChangeEqual.

@Test
public void test_with_Month_noChangeEqual() {
    MonthDay test = MonthDay.of(6, 30);
    assertEquals(test.with(Month.JUNE), test);
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test)

Example 48 with MonthDay

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

the class TCKMonthDay method now_Clock.

// -----------------------------------------------------------------------
// now(Clock)
// -----------------------------------------------------------------------
@Test
public void now_Clock() {
    Instant instant = LocalDateTime.of(2010, 12, 31, 0, 0).toInstant(ZoneOffset.UTC);
    Clock clock = Clock.fixed(instant, ZoneOffset.UTC);
    MonthDay test = MonthDay.now(clock);
    assertEquals(test.getMonth(), Month.DECEMBER);
    assertEquals(test.getDayOfMonth(), 31);
}
Also used : Instant(java.time.Instant) MonthDay(java.time.MonthDay) Clock(java.time.Clock) Test(org.junit.Test)

Example 49 with MonthDay

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

the class TCKMonthDay method test_adjustDate_equal.

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

Example 50 with MonthDay

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

the class TCKMonthDay method factory_parse_success.

@Test()
@UseDataProvider("provider_goodParseData")
public void factory_parse_success(String text, MonthDay expected) {
    MonthDay monthDay = MonthDay.parse(text);
    assertEquals(monthDay, expected);
}
Also used : MonthDay(java.time.MonthDay) Test(org.junit.Test) UseDataProvider(com.tngtech.java.junit.dataprovider.UseDataProvider)

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