use of com.thinkbiganalytics.policy.validation.IPAddressValidator in project kylo by Teradata.
the class ValidatorTests method ipAddressTests.
@Test
public void ipAddressTests() {
IPAddressValidator validator = IPAddressValidator.instance();
Assert.assertTrue(validator.validate("106.72.28.74"));
Assert.assertTrue(validator.validate("156.243.130.166"));
Assert.assertTrue(validator.validate("28.55.168.128"));
Assert.assertTrue(validator.validate("185.81.160.85"));
Assert.assertTrue(validator.validate("158.137.238.6"));
Assert.assertTrue(validator.validate("141.122.136.144"));
Assert.assertTrue(validator.validate("104.179.97.82"));
Assert.assertTrue(validator.validate("28.77.158.48"));
Assert.assertTrue(validator.validate("72.129.239.24"));
Assert.assertTrue(validator.validate("51.211.70.30"));
Assert.assertFalse(validator.validate("51.211.70"));
Assert.assertFalse(validator.validate("51..211.70.30"));
Assert.assertFalse(validator.validate("a1.211.70.30"));
Assert.assertFalse(validator.validate("51.211.70.30.0"));
}
use of com.thinkbiganalytics.policy.validation.IPAddressValidator in project kylo by Teradata.
the class TestValidationTransformation method testIPAddressValidator.
@Test
public void testIPAddressValidator() {
IPAddressValidator validator = IPAddressValidator.instance();
FieldValidationRule uiModel = ValidatorAnnotationTransformer.instance().toUIModel(validator);
IPAddressValidator convertedValidator = fromUI(uiModel, IPAddressValidator.class);
Assert.assertEquals(validator, convertedValidator);
}
Aggregations