Search in sources :

Example 26 with MonthDay

use of java.time.MonthDay in project jdk8u_jdk by JetBrains.

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.testng.annotations.Test)

Example 27 with MonthDay

use of java.time.MonthDay in project jdk8u_jdk by JetBrains.

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.testng.annotations.Test)

Example 28 with MonthDay

use of java.time.MonthDay in project jdk8u_jdk by JetBrains.

the class TCKMonthDay method factory_parse_formatter.

//-----------------------------------------------------------------------
// parse(DateTimeFormatter)
//-----------------------------------------------------------------------
@Test
public void factory_parse_formatter() {
    DateTimeFormatter f = DateTimeFormatter.ofPattern("M d");
    MonthDay test = MonthDay.parse("12 3", f);
    assertEquals(test, MonthDay.of(12, 3));
}
Also used : MonthDay(java.time.MonthDay) DateTimeFormatter(java.time.format.DateTimeFormatter) Test(org.testng.annotations.Test)

Aggregations

MonthDay (java.time.MonthDay)28 Test (org.testng.annotations.Test)25 LocalDate (java.time.LocalDate)4 IOException (java.io.IOException)1 Clock (java.time.Clock)1 Instant (java.time.Instant)1 YearMonth (java.time.YearMonth)1 ZoneId (java.time.ZoneId)1 DateTimeFormatter (java.time.format.DateTimeFormatter)1 Test (org.junit.Test)1