use of java.time.Year in project jdk8u_jdk by JetBrains.
the class TCKYear method test_atMonth.
//-----------------------------------------------------------------------
// atMonth(Month)
//-----------------------------------------------------------------------
@Test
public void test_atMonth() {
Year test = Year.of(2008);
assertEquals(test.atMonth(Month.JUNE), YearMonth.of(2008, 6));
}
use of java.time.Year in project jdk8u_jdk by JetBrains.
the class TCKYear method test_atMonth_nullMonth.
@Test(expectedExceptions = NullPointerException.class)
public void test_atMonth_nullMonth() {
Year test = Year.of(2008);
test.atMonth((Month) null);
}
use of java.time.Year in project jdk8u_jdk by JetBrains.
the class TCKYear method test_plusYear_zero_equals.
@Test
public void test_plusYear_zero_equals() {
Year base = Year.of(2007);
assertEquals(base.plusYears(0), base);
}
use of java.time.Year in project jdk8u_jdk by JetBrains.
the class TCKYear method factory_parse_formatter.
//-----------------------------------------------------------------------
// parse(DateTimeFormatter)
//-----------------------------------------------------------------------
@Test
public void factory_parse_formatter() {
DateTimeFormatter f = DateTimeFormatter.ofPattern("y");
Year test = Year.parse("2010", f);
assertEquals(test, Year.of(2010));
}
use of java.time.Year in project jdk8u_jdk by JetBrains.
the class TCKYear method test_equals_same.
@Test
public void test_equals_same() {
Year test = Year.of(2011);
assertEquals(test.equals(test), true);
}
Aggregations