Search in sources :

Example 1 with IPAddressValidator

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"));
}
Also used : IPAddressValidator(com.thinkbiganalytics.policy.validation.IPAddressValidator) Test(org.junit.Test)

Example 2 with IPAddressValidator

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);
}
Also used : IPAddressValidator(com.thinkbiganalytics.policy.validation.IPAddressValidator) FieldValidationRule(com.thinkbiganalytics.policy.rest.model.FieldValidationRule) Test(org.junit.Test)

Aggregations

IPAddressValidator (com.thinkbiganalytics.policy.validation.IPAddressValidator)2 Test (org.junit.Test)2 FieldValidationRule (com.thinkbiganalytics.policy.rest.model.FieldValidationRule)1