Java Code Examples for java.time.chrono.HijrahDate#with()
The following examples show how to use
java.time.chrono.HijrahDate#with() .
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: TestUmmAlQuraChronology.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Test public void test_withDayOfYear() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1434, 1); for (int i = 1; i <= hd.lengthOfYear(); i++) { HijrahDate hd2 = hd.with(DAY_OF_YEAR, i); int doy = hd2.get(DAY_OF_YEAR); assertEquals(doy, i, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2); } }
Example 2
Source File: TestUmmAlQuraChronology.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Test public void test_withDayOfYear() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1434, 1); for (int i = 1; i <= hd.lengthOfYear(); i++) { HijrahDate hd2 = hd.with(DAY_OF_YEAR, i); int doy = hd2.get(DAY_OF_YEAR); assertEquals(doy, i, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2); } }
Example 3
Source File: TestUmmAlQuraChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
@Test public void test_withDayOfYear() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1434, 1); for (int i = 1; i <= hd.lengthOfYear(); i++) { HijrahDate hd2 = hd.with(DAY_OF_YEAR, i); int doy = hd2.get(DAY_OF_YEAR); assertEquals(doy, i, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2); } }
Example 4
Source File: TestUmmAlQuraChronology.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Test public void test_withDayOfYear() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1434, 1); for (int i = 1; i <= hd.lengthOfYear(); i++) { HijrahDate hd2 = hd.with(DAY_OF_YEAR, i); int doy = hd2.get(DAY_OF_YEAR); assertEquals(doy, i, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2); } }
Example 5
Source File: TestUmmAlQuraChronology.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Test public void test_withDayOfYear() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1434, 1); for (int i = 1; i <= hd.lengthOfYear(); i++) { HijrahDate hd2 = hd.with(DAY_OF_YEAR, i); int doy = hd2.get(DAY_OF_YEAR); assertEquals(doy, i, "with(DAY_OF_YEAR) incorrect for " + i + " " + hd2); } }
Example 6
Source File: TestUmmAlQuraChronology.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
@Test(dataProvider="monthDays") public void test_lastDayOfMonth(int year, int month, int numDays) { HijrahDate hDate = HijrahChronology.INSTANCE.date(year, month, 1); hDate = hDate.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(hDate.get(ChronoField.DAY_OF_MONTH), numDays); }
Example 7
Source File: TestUmmAlQuraChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }
Example 8
Source File: TestUmmAlQuraChronology.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooLarge() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, hd.lengthOfYear() + 1); }
Example 9
Source File: TestUmmAlQuraChronology.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooLarge() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, hd.lengthOfYear() + 1); }
Example 10
Source File: TestUmmAlQuraChronology.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }
Example 11
Source File: TestUmmAlQuraChronology.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Test(dataProvider="monthDays") public void test_lastDayOfMonth(int year, int month, int numDays) { HijrahDate hDate = HijrahChronology.INSTANCE.date(year, month, 1); hDate = hDate.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(hDate.get(ChronoField.DAY_OF_MONTH), numDays); }
Example 12
Source File: TestUmmAlQuraChronology.java From hottub with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }
Example 13
Source File: TestUmmAlQuraChronology.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }
Example 14
Source File: TestUmmAlQuraChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }
Example 15
Source File: TestUmmAlQuraChronology.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooLarge() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, hd.lengthOfYear() + 1); }
Example 16
Source File: TestUmmAlQuraChronology.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }
Example 17
Source File: TestUmmAlQuraChronology.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }
Example 18
Source File: TestUmmAlQuraChronology.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
@Test(dataProvider="monthDays") public void test_lastDayOfMonth(int year, int month, int numDays) { HijrahDate hDate = HijrahChronology.INSTANCE.date(year, month, 1); hDate = hDate.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(hDate.get(ChronoField.DAY_OF_MONTH), numDays); }
Example 19
Source File: TestUmmAlQuraChronology.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
@Test(dataProvider="monthDays") public void test_lastDayOfMonth(int year, int month, int numDays) { HijrahDate hDate = HijrahChronology.INSTANCE.date(year, month, 1); hDate = hDate.with(TemporalAdjusters.lastDayOfMonth()); assertEquals(hDate.get(ChronoField.DAY_OF_MONTH), numDays); }
Example 20
Source File: TestUmmAlQuraChronology.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
@Test(expectedExceptions=java.time.DateTimeException.class) public void test_withDayOfYearTooSmall() { HijrahDate hd = HijrahChronology.INSTANCE.dateYearDay(1435, 1); HijrahDate hd2 = hd.with(DAY_OF_YEAR, 0); }