Java Code Examples for org.threeten.bp.temporal.TemporalAccessor#range()

The following examples show how to use org.threeten.bp.temporal.TemporalAccessor#range() . 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: AbstractDateTimeTest.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Test
public void basicTest_range_DateTimeField_unsupported() {
    for (TemporalAccessor sample : samples()) {
        for (TemporalField field : invalidFields()) {
            try {
                sample.range(field);
                fail("Failed on " + sample + " " + field);
            } catch (DateTimeException ex) {
                // expected
            }
        }
    }
}
 
Example 2
Source File: AbstractDateTimeTest.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Test
public void basicTest_range_DateTimeField_null() {
    for (TemporalAccessor sample : samples()) {
        try {
            sample.range(null);
            fail("Failed on " + sample);
        } catch (NullPointerException ex) {
            // expected
        }
    }
}