use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class EnumerationValidatorTest method testHashCode.
@Test
public void testHashCode() {
final EnumerationValidator validator1 = new EnumerationValidator(Sets.newHashSet("first", "second"), false);
final EnumerationValidator validator2 = new EnumerationValidator(Sets.newHashSet("first", "second"), false);
assertThat(validator1.hashCode(), is(validator2.hashCode()));
}
use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class EnumerationValidatorTest method testEqualsSelf.
@Test
public void testEqualsSelf() {
final EnumerationValidator validator = new EnumerationValidator(Sets.newHashSet("first"), false);
assertThat(validator.equals(validator), is(true));
}
use of ddf.catalog.validation.impl.validator.EnumerationValidator in project ddf by codice.
the class ReportingMetacardValidatorImplTest method registerValidators.
private void registerValidators() {
registry.registerValidators(Metacard.TITLE, Sets.newHashSet(new SizeValidator(1, 20), new PatternValidator("[A-Z]+")));
registry.registerValidators(Metacard.MODIFIED, Sets.newHashSet(PastDateValidator.getInstance()));
registry.registerValidators(Metacard.EFFECTIVE, Sets.newHashSet(FutureDateValidator.getInstance()));
final EnumerationValidator enumerationValidator = new EnumerationValidator(Sets.newHashSet("application/xml", "text/xml"), false);
registry.registerValidators(Metacard.CONTENT_TYPE, Sets.newHashSet(enumerationValidator));
}
Aggregations