use of ddf.catalog.validation.impl.validator.SizeValidator in project ddf by codice.
the class SizeValidatorTest method testEqualsSelf.
@Test
public void testEqualsSelf() {
final SizeValidator validator = new SizeValidator(13, 1799);
assertThat(validator.equals(validator), is(true));
}
use of ddf.catalog.validation.impl.validator.SizeValidator in project ddf by codice.
the class SizeValidatorTest method testHashCode.
@Test
public void testHashCode() {
final SizeValidator validator1 = new SizeValidator(13, 1799);
final SizeValidator validator2 = new SizeValidator(13, 1799);
assertThat(validator1.hashCode(), is(validator2.hashCode()));
}
use of ddf.catalog.validation.impl.validator.SizeValidator in project ddf by codice.
the class SizeValidatorTest method testEqualsDifferentMax.
@Test
public void testEqualsDifferentMax() {
final SizeValidator validator1 = new SizeValidator(13, 1799);
final SizeValidator validator2 = new SizeValidator(13, 2000);
assertThat(validator1.equals(validator2), is(false));
assertThat(validator2.equals(validator1), is(false));
}
use of ddf.catalog.validation.impl.validator.SizeValidator 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