本文整理汇总了Java中java.time.LocalDate.datesUntil方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDate.datesUntil方法的具体用法?Java LocalDate.datesUntil怎么用?Java LocalDate.datesUntil使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.time.LocalDate
的用法示例。
在下文中一共展示了LocalDate.datesUntil方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test_datesUntil_staticType
import java.time.LocalDate; //导入方法依赖的package包/类
@Test
public void test_datesUntil_staticType() {
// Test the types of the Stream and elements of the stream
LocalDate date = date(2015, 2, 10);
Stream<LocalDate> stream = date.datesUntil(date.plusDays(5));
long sum = stream.mapToInt(LocalDate::getDayOfMonth).sum();
assertEquals(sum, 60, "sum of 10, 11, 12, 13, 14 is wrong");
}
示例2: test_datesUntil_nullEnd
import java.time.LocalDate; //导入方法依赖的package包/类
@Test(expectedExceptions=NullPointerException.class)
public void test_datesUntil_nullEnd() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(null);
}
示例3: test_datesUntil_nullEndStep
import java.time.LocalDate; //导入方法依赖的package包/类
@Test(expectedExceptions=NullPointerException.class)
public void test_datesUntil_nullEndStep() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(null, Period.ofDays(1));
}
示例4: test_datesUntil_nullStep
import java.time.LocalDate; //导入方法依赖的package包/类
@Test(expectedExceptions=NullPointerException.class)
public void test_datesUntil_nullStep() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, null);
}
示例5: test_datesUntil_zeroStep
import java.time.LocalDate; //导入方法依赖的package包/类
@Test(expectedExceptions=IllegalArgumentException.class)
public void test_datesUntil_zeroStep() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, Period.ZERO);
}
示例6: test_datesUntil_oppositeSign
import java.time.LocalDate; //导入方法依赖的package包/类
@Test(expectedExceptions=IllegalArgumentException.class)
public void test_datesUntil_oppositeSign() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, Period.of(1, 0, -1));
}
示例7: test_datesUntil_oppositeSign2
import java.time.LocalDate; //导入方法依赖的package包/类
@Test(expectedExceptions=IllegalArgumentException.class)
public void test_datesUntil_oppositeSign2() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, Period.of(0, -1, 1));
}