本文整理匯總了Java中java.time.calendrical.DateTime.MinusAdjuster類的典型用法代碼示例。如果您正苦於以下問題:Java MinusAdjuster類的具體用法?Java MinusAdjuster怎麽用?Java MinusAdjuster使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MinusAdjuster類屬於java.time.calendrical.DateTime包,在下文中一共展示了MinusAdjuster類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test_minus_Adjuster
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster() {
MinusAdjuster p = Period.ofTime(0, 0, 62, 3);
LocalTime t = this.TEST_12_30_40_987654321.minus(p);
assertEquals(t, LocalTime.of(12, 29, 38, 987654318));
}
示例2: test_minus_Adjuster_positiveHours
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_positiveHours() {
MinusAdjuster period = MockSimplePeriod.of(7, ChronoUnit.HOURS);
LocalTime t = this.TEST_12_30_40_987654321.minus(period);
assertEquals(t, LocalTime.of(5, 30, 40, 987654321));
}
示例3: test_minus_Adjuster_negativeMinutes
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_negativeMinutes() {
MinusAdjuster period = MockSimplePeriod.of(-25, ChronoUnit.MINUTES);
LocalTime t = this.TEST_12_30_40_987654321.minus(period);
assertEquals(t, LocalTime.of(12, 55, 40, 987654321));
}
示例4: test_minus_Adjuster_big1
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_big1() {
MinusAdjuster p = Period.ofTime(0, 0, 0, Long.MAX_VALUE);
LocalTime t = this.TEST_12_30_40_987654321.minus(p);
assertEquals(t, this.TEST_12_30_40_987654321.minusNanos(Long.MAX_VALUE));
}
示例5: test_minus_Adjuster_zero
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_zero() {
MinusAdjuster p = Period.ZERO;
LocalTime t = this.TEST_12_30_40_987654321.minus(p);
assertEquals(t, this.TEST_12_30_40_987654321);
}
示例6: test_minus_Adjuster_wrap
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_wrap() {
MinusAdjuster p = Period.ofTime(1, 0, 0);
LocalTime t = LocalTime.of(0, 30).minus(p);
assertEquals(t, LocalTime.of(23, 30));
}
示例7: test_minus_adjuster_null
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_adjuster_null() {
this.TEST_DATE_TIME.minus((MinusAdjuster) null);
}
示例8: test_minus_adjuster_null
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_adjuster_null() {
this.TEST_2007_07_15_12_30_40_987654321.minus((MinusAdjuster) null);
}
示例9: test_minus_Adjuster_dateNotAllowed
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" }, expectedExceptions = DateTimeException.class)
public void test_minus_Adjuster_dateNotAllowed() {
MinusAdjuster period = MockSimplePeriod.of(7, ChronoUnit.MONTHS);
this.TEST_12_30_40_987654321.minus(period);
}
示例10: test_minus_Adjuster_null
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_Adjuster_null() {
this.TEST_12_30_40_987654321.minus((MinusAdjuster) null);
}
示例11: test_plus_MinusAdjuster_null
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_plus_MinusAdjuster_null() {
this.TEST_2007_07_15_PONE.minus((MinusAdjuster) null);
}
示例12: test_minus_MinusAdjuster_null
import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_MinusAdjuster_null() {
this.TEST_11_30_59_500_PONE.minus((MinusAdjuster) null);
}