| | |
| | | def.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS); |
| | | } |
| | | |
| | | @Test(expectedExceptions = IllegalPropertyValueStringException.class) |
| | | @Test(expectedExceptions = PropertyException.class) |
| | | public void testAllowUnlimitedIsFalse() { |
| | | DurationPropertyDefinition.Builder builder = createTestBuilder(); |
| | | builder.setAllowUnlimited(false); |
| | |
| | | def.decodeValue("unlimited", PropertyDefinitionsOptions.NO_VALIDATION_OPTIONS); |
| | | } |
| | | |
| | | @Test(expectedExceptions = IllegalPropertyValueException.class) |
| | | @Test(expectedExceptions = PropertyException.class) |
| | | public void testAllowUnlimitedIsFalseNumValue() { |
| | | DurationPropertyDefinition.Builder builder = createTestBuilder(); |
| | | builder.setAllowUnlimited(false); |
| | |
| | | } |
| | | |
| | | @Test(dataProvider = "illegalValidateValueData", expectedExceptions = { AssertionError.class, |
| | | NullPointerException.class, IllegalPropertyValueException.class }) |
| | | NullPointerException.class, PropertyException.class }) |
| | | public void testValidateValueIllegal(Long lowLimitInMillis, Long highLimitInMillis, |
| | | boolean isAllowUnlimited, Long valueInSeconds) { |
| | | DurationPropertyDefinition.Builder builder = createTestBuilder(); |
| | |
| | | return true; |
| | | } |
| | | @SuppressWarnings("unused") |
| | | public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws UnknownPropertyDefinitionException { |
| | | public Boolean visitUnknown(PropertyDefinition<?> d, Void o) throws PropertyException { |
| | | return false; |
| | | } |
| | | }; |
| | |
| | | }; |
| | | } |
| | | |
| | | @Test(dataProvider = "decodeValueDataIllegal", expectedExceptions = { IllegalPropertyValueStringException.class }) |
| | | @Test(dataProvider = "decodeValueDataIllegal", expectedExceptions = { PropertyException.class }) |
| | | public void testDecodeValue(String valueToDecode) { |
| | | DurationPropertyDefinition.Builder builder = createTestBuilder(); |
| | | builder.setAllowUnlimited(false); |