下面列出了java.time.OffsetTime#withSecond ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Test
public void testTruncateTimeWithTimeZone()
{
OffsetTime result = WEIRD_TIME;
result = result.withNano(0);
assertFunction("date_trunc('second', " + WEIRD_TIME_LITERAL + ")", TIME_WITH_TIME_ZONE, toTimeWithTimeZone(result));
result = result.withSecond(0);
assertFunction("date_trunc('minute', " + WEIRD_TIME_LITERAL + ")", TIME_WITH_TIME_ZONE, toTimeWithTimeZone(result));
result = result.withMinute(0);
assertFunction("date_trunc('hour', " + WEIRD_TIME_LITERAL + ")", TIME_WITH_TIME_ZONE, toTimeWithTimeZone(result));
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}
@Test
public void test_withSecond_noChange() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(59);
assertEquals(test, base);
}
@Test
public void test_withSecond_normal() {
OffsetTime base = OffsetTime.of(11, 30, 59, 0, OFFSET_PONE);
OffsetTime test = base.withSecond(15);
assertEquals(test, OffsetTime.of(11, 30, 15, 0, OFFSET_PONE));
}