Search in sources :

Example 6 with MonthDay

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

the class TCKMonthDay method test_hashCode.

//-----------------------------------------------------------------------
// hashCode()
//-----------------------------------------------------------------------
@Test(dataProvider = "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.testng.annotations.Test)

Example 7 with MonthDay

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

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

Example 8 with MonthDay

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

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

Example 9 with MonthDay

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

the class TestMonthDay method test_with_Month_noChangeSame.

@Test
public void test_with_Month_noChangeSame() {
    MonthDay test = MonthDay.of(6, 30);
    assertSame(test.with(Month.JUNE), test);
}
Also used : MonthDay(java.time.MonthDay) Test(org.testng.annotations.Test)

Example 10 with MonthDay

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

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.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