Search in sources :

Example 1 with IntegerValidator

use of org.apache.sling.validation.impl.util.examplevalidators.IntegerValidator in project sling by apache.

the class ValidatorTypeUtilTest method testGetValidatorTypeOfDirectImplementations.

@SuppressWarnings("unchecked")
@Test
public void testGetValidatorTypeOfDirectImplementations() {
    Assert.assertThat((Class<String>) ValidatorTypeUtil.getValidatorType(new RegexValidator()), Matchers.equalTo(String.class));
    Assert.assertThat((Class<String>) ValidatorTypeUtil.getValidatorType(new StringValidator()), Matchers.equalTo(String.class));
    Assert.assertThat((Class<Integer>) ValidatorTypeUtil.getValidatorType(new IntegerValidator()), Matchers.equalTo(Integer.class));
}
Also used : IntegerValidator(org.apache.sling.validation.impl.util.examplevalidators.IntegerValidator) RegexValidator(org.apache.sling.validation.impl.validators.RegexValidator) ExtendedStringValidator(org.apache.sling.validation.impl.util.examplevalidators.ExtendedStringValidator) DerivedStringValidator(org.apache.sling.validation.impl.util.examplevalidators.DerivedStringValidator) StringValidator(org.apache.sling.validation.impl.util.examplevalidators.StringValidator) Test(org.junit.Test)

Aggregations

DerivedStringValidator (org.apache.sling.validation.impl.util.examplevalidators.DerivedStringValidator)1 ExtendedStringValidator (org.apache.sling.validation.impl.util.examplevalidators.ExtendedStringValidator)1 IntegerValidator (org.apache.sling.validation.impl.util.examplevalidators.IntegerValidator)1 StringValidator (org.apache.sling.validation.impl.util.examplevalidators.StringValidator)1 RegexValidator (org.apache.sling.validation.impl.validators.RegexValidator)1 Test (org.junit.Test)1