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);
}
use of java.time.MonthDay in project jdk8u_jdk by JetBrains.
the class TCKMonthDay method test_adjustDate.
//-----------------------------------------------------------------------
// adjustInto()
//-----------------------------------------------------------------------
@Test
public void test_adjustDate() {
MonthDay test = MonthDay.of(6, 30);
LocalDate date = LocalDate.of(2007, 1, 1);
assertEquals(test.adjustInto(date), LocalDate.of(2007, 6, 30));
}
use of java.time.MonthDay in project jdk8u_jdk by JetBrains.
the class TCKMonthDay method test_withMonth_int_noChangeEqual.
@Test
public void test_withMonth_int_noChangeEqual() {
MonthDay test = MonthDay.of(6, 30);
assertEquals(test.withMonth(6), test);
}
Aggregations