Java Code Examples for java.time.LocalDate#datesUntil()
The following examples show how to use
java.time.LocalDate#datesUntil() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TCKLocalDate.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
@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"); }
Example 2
Source File: TCKLocalDate.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=NullPointerException.class) public void test_datesUntil_nullEnd() { LocalDate date = date(2015, 1, 31); date.datesUntil(null); }
Example 3
Source File: TCKLocalDate.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=NullPointerException.class) public void test_datesUntil_nullEndStep() { LocalDate date = date(2015, 1, 31); date.datesUntil(null, Period.ofDays(1)); }
Example 4
Source File: TCKLocalDate.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=NullPointerException.class) public void test_datesUntil_nullStep() { LocalDate date = date(2015, 1, 31); date.datesUntil(date, null); }
Example 5
Source File: TCKLocalDate.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=IllegalArgumentException.class) public void test_datesUntil_zeroStep() { LocalDate date = date(2015, 1, 31); date.datesUntil(date, Period.ZERO); }
Example 6
Source File: TCKLocalDate.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=IllegalArgumentException.class) public void test_datesUntil_oppositeSign() { LocalDate date = date(2015, 1, 31); date.datesUntil(date, Period.of(1, 0, -1)); }
Example 7
Source File: TCKLocalDate.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=IllegalArgumentException.class) public void test_datesUntil_oppositeSign2() { LocalDate date = date(2015, 1, 31); date.datesUntil(date, Period.of(0, -1, 1)); }