use of java.time.MonthDay in project jdk8u_jdk by JetBrains.
the class TestMonthDay method test_withDayOfMonth_noChangeSame.
@Test
public void test_withDayOfMonth_noChangeSame() {
MonthDay test = MonthDay.of(6, 30);
assertSame(test.withDayOfMonth(30), test);
}
use of java.time.MonthDay in project jdk8u_jdk by JetBrains.
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);
}
use of java.time.MonthDay in project jdk8u_jdk by JetBrains.
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);
}
use of java.time.MonthDay in project jdk8u_jdk by JetBrains.
the class TCKMonthDay method now_ZoneId.
@Test
public void now_ZoneId() {
ZoneId zone = ZoneId.of("UTC+01:02:03");
MonthDay expected = MonthDay.now(Clock.system(zone));
MonthDay test = MonthDay.now(zone);
for (int i = 0; i < 100; i++) {
if (expected.equals(test)) {
return;
}
expected = MonthDay.now(Clock.system(zone));
test = MonthDay.now(zone);
}
assertEquals(test, expected);
}
use of java.time.MonthDay in project jdk8u_jdk by JetBrains.
the class TCKMonthDay method test_toString.
@Test(dataProvider = "sampleToString")
public void test_toString(int m, int d, String expected) {
MonthDay test = MonthDay.of(m, d);
String str = test.toString();
assertEquals(str, expected);
}
Aggregations