test/java/time/test/java/time/TestLocalTime.java
Print this page
*** 85,175 ****
assertEquals(time.getSecond(), s);
assertEquals(time.getNano(), n);
}
//-----------------------------------------------------------------------
! @Test(groups={"tck","implementation"})
public void constant_MIDNIGHT() {
check(LocalTime.MIDNIGHT, 0, 0, 0, 0);
}
! @Test(groups={"implementation"})
public void constant_MIDNIGHT_same() {
assertSame(LocalTime.MIDNIGHT, LocalTime.MIDNIGHT);
assertSame(LocalTime.MIDNIGHT, LocalTime.of(0, 0));
}
! @Test(groups={"tck","implementation"})
public void constant_MIDDAY() {
check(LocalTime.NOON, 12, 0, 0, 0);
}
! @Test(groups={"implementation"})
public void constant_MIDDAY_same() {
assertSame(LocalTime.NOON, LocalTime.NOON);
assertSame(LocalTime.NOON, LocalTime.of(12, 0));
}
//-----------------------------------------------------------------------
! @Test(groups={"tck","implementation"})
public void constant_MIN_TIME() {
check(LocalTime.MIN, 0, 0, 0, 0);
}
! @Test(groups={"implementation"})
public void constant_MIN_TIME_same() {
assertSame(LocalTime.MIN, LocalTime.of(0, 0));
}
! @Test(groups={"tck","implementation"})
public void constant_MAX_TIME() {
check(LocalTime.MAX, 23, 59, 59, 999999999);
}
! @Test(groups={"implementation"})
public void constant_MAX_TIME_same() {
assertSame(LocalTime.NOON, LocalTime.NOON);
assertSame(LocalTime.NOON, LocalTime.of(12, 0));
}
! @Test(groups={"implementation"})
public void factory_time_2ints_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.of(i, 0);
LocalTime test2 = LocalTime.of(i, 0);
assertSame(test1, test2);
}
}
! @Test(groups={"implementation"})
public void factory_time_3ints_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.of(i, 0, 0);
LocalTime test2 = LocalTime.of(i, 0, 0);
assertSame(test1, test2);
}
}
! @Test(groups={"implementation"})
public void factory_time_4ints_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.of(i, 0, 0, 0);
LocalTime test2 = LocalTime.of(i, 0, 0, 0);
assertSame(test1, test2);
}
}
! @Test(groups={"implementation"})
public void factory_ofSecondOfDay_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.ofSecondOfDay(i * 60L * 60L);
LocalTime test2 = LocalTime.of(i, 0);
assertSame(test1, test2);
}
}
! @Test(groups={"implementation"})
public void factory_ofNanoOfDay_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.ofNanoOfDay(i * 1000000000L * 60L * 60L);
LocalTime test2 = LocalTime.of(i, 0);
assertSame(test1, test2);
--- 85,175 ----
assertEquals(time.getSecond(), s);
assertEquals(time.getNano(), n);
}
//-----------------------------------------------------------------------
! @Test
public void constant_MIDNIGHT() {
check(LocalTime.MIDNIGHT, 0, 0, 0, 0);
}
! @Test
public void constant_MIDNIGHT_same() {
assertSame(LocalTime.MIDNIGHT, LocalTime.MIDNIGHT);
assertSame(LocalTime.MIDNIGHT, LocalTime.of(0, 0));
}
! @Test
public void constant_MIDDAY() {
check(LocalTime.NOON, 12, 0, 0, 0);
}
! @Test
public void constant_MIDDAY_same() {
assertSame(LocalTime.NOON, LocalTime.NOON);
assertSame(LocalTime.NOON, LocalTime.of(12, 0));
}
//-----------------------------------------------------------------------
! @Test
public void constant_MIN_TIME() {
check(LocalTime.MIN, 0, 0, 0, 0);
}
! @Test
public void constant_MIN_TIME_same() {
assertSame(LocalTime.MIN, LocalTime.of(0, 0));
}
! @Test
public void constant_MAX_TIME() {
check(LocalTime.MAX, 23, 59, 59, 999999999);
}
! @Test
public void constant_MAX_TIME_same() {
assertSame(LocalTime.NOON, LocalTime.NOON);
assertSame(LocalTime.NOON, LocalTime.of(12, 0));
}
! @Test
public void factory_time_2ints_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.of(i, 0);
LocalTime test2 = LocalTime.of(i, 0);
assertSame(test1, test2);
}
}
! @Test
public void factory_time_3ints_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.of(i, 0, 0);
LocalTime test2 = LocalTime.of(i, 0, 0);
assertSame(test1, test2);
}
}
! @Test
public void factory_time_4ints_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.of(i, 0, 0, 0);
LocalTime test2 = LocalTime.of(i, 0, 0, 0);
assertSame(test1, test2);
}
}
! @Test
public void factory_ofSecondOfDay_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.ofSecondOfDay(i * 60L * 60L);
LocalTime test2 = LocalTime.of(i, 0);
assertSame(test1, test2);
}
}
! @Test
public void factory_ofNanoOfDay_singletons() {
for (int i = 0; i < 24; i++) {
LocalTime test1 = LocalTime.ofNanoOfDay(i * 1000000000L * 60L * 60L);
LocalTime test2 = LocalTime.of(i, 0);
assertSame(test1, test2);