directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1447836 - in /directory/shared/trunk/ldap/model/src: main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/ test/java/org/apache/directory/api/ldap/model/schema/syntaxes/
Date Tue, 19 Feb 2013 17:34:12 GMT
Author: elecharny
Date: Tue Feb 19 17:34:11 2013
New Revision: 1447836

URL: http://svn.apache.org/r1447836
Log:
Relaxed the default TelephoneNumberSyntaxChecker to allow '#', '*', ',' and ';' in the numbers
(see DIRSERVER-1755)

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java?rev=1447836&r1=1447835&r2=1447836&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/TelephoneNumberSyntaxChecker.java
Tue Feb 19 17:34:11 2013
@@ -58,7 +58,7 @@ public class TelephoneNumberSyntaxChecke
     private List<Pattern> compiledREs;
 
     /** The default pattern used to check a TelephoneNumber */
-    private static final String DEFAULT_REGEXP = "^ *[+]? *((\\([0-9- ]+\\))|[0-9- ]+)+$";
+    private static final String DEFAULT_REGEXP = "^ *[+]? *((\\([0-9- ,;#*]+\\))|[0-9- ,;#*]+)+$";
 
     /** The compiled default pattern */
     private Pattern defaultPattern = Pattern.compile( DEFAULT_REGEXP );

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java?rev=1447836&r1=1447835&r2=1447836&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java
Tue Feb 19 17:34:11 2013
@@ -24,13 +24,13 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-import com.mycila.junit.concurrent.Concurrency;
-import com.mycila.junit.concurrent.ConcurrentJunitRunner;
-
 import org.apache.directory.api.ldap.model.schema.syntaxCheckers.TelephoneNumberSyntaxChecker;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
 
 /**
  * Test cases for NumericStringSyntaxChecker.
@@ -90,6 +90,7 @@ public class TelephoneNumberSyntaxChecke
         assertTrue( checker.isValidSyntax( "1 (2) 3" ) );
         assertTrue( checker.isValidSyntax( "+ 123 ( 456 )7891   12345" ) );
         assertTrue( checker.isValidSyntax( " 12 34 56 78 90 " ) );
+        assertTrue( checker.isValidSyntax( " + 12 34 ; 56* 78 90, # " ) );
     }
 
 



Mime
View raw message