commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1207110 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
Date Mon, 28 Nov 2011 12:42:03 GMT
Author: nick
Date: Mon Nov 28 12:42:01 2011
New Revision: 1207110

URL: http://svn.apache.org/viewvc?rev=1207110&view=rev
Log:
Unit tests for VALIDATOR-296 - / and ! in domain part of emails

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

Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java?rev=1207110&r1=1207109&r2=1207110&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
(original)
+++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
Mon Nov 28 12:42:01 2011
@@ -206,6 +206,25 @@ public class EmailValidatorTest extends 
              noLocal.isValid("joe@localhost")
        );
     }
+    
+    /**
+     * VALIDATOR-296 - A / or a ! is valid in the user part,
+     *  but not in the domain part 
+     */
+    public void testEmailWithSlashes() {
+       assertTrue(
+             "/ and ! valid in username",
+             validator.isValid("joe!/blow@apache.org")
+       );
+       assertFalse(
+             "/ not valid in domain",
+             validator.isValid("joe@ap/ache.org")
+       );
+       assertFalse(
+             "! not valid in domain",
+             validator.isValid("joe@apac!he.org")
+       );
+    }
 
     /**
      * Write this test according to parts of RFC, as opposed to the type of character



Mime
View raw message