commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1781666 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
Date Sat, 04 Feb 2017 13:15:35 GMT
Author: sebb
Date: Sat Feb  4 13:15:35 2017
New Revision: 1781666

URL: http://svn.apache.org/viewvc?rev=1781666&view=rev
Log:
Add test to show how to fix VALIDATOR-412

Modified:
    commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java?rev=1781666&r1=1781665&r2=1781666&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
Sat Feb  4 13:15:35 2017
@@ -368,6 +368,18 @@ public class DomainValidatorTest extends
         assertTrue(validator.isValidGenericTld("com"));
     }
 
+    public void testVALIDATOR_412() {
+        assertFalse(validator.isValidGenericTld("local"));    	
+        assertFalse(validator.isValid("abc.local"));    	
+        assertFalse(validator.isValidGenericTld("pvt"));    	
+        assertFalse(validator.isValid("abc.pvt"));    	
+        DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"local", "pvt"});
+        assertTrue(validator.isValidGenericTld("local"));
+        assertTrue(validator.isValid("abc.local"));    	
+        assertTrue(validator.isValidGenericTld("pvt"));
+        assertTrue(validator.isValid("abc.pvt"));    	
+    }
+
     public void testCannotUpdate() {
         DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"ch"}); //
OK
         DomainValidator dv = DomainValidator.getInstance();



Mime
View raw message