directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r486075 - /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxCheckerTest.java
Date Tue, 12 Dec 2006 09:53:18 GMT
Author: elecharny
Date: Tue Dec 12 01:53:17 2006
New Revision: 486075

URL: http://svn.apache.org/viewvc?view=rev&rev=486075
Log:
Fixed the test so that people which are not french can build the code :(

Modified:
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxCheckerTest.java

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxCheckerTest.java?view=diff&rev=486075&r1=486074&r2=486075
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxCheckerTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/PrintableStringSyntaxCheckerTest.java
Tue Dec 12 01:53:17 2006
@@ -44,39 +44,40 @@
     }
 
 
-    public void testWrongCase()
+    /**
+     * 
+     * Check that non printable Strings are not accepted. We created Strings
+     * which contains only one char which is not in the acceptable set of
+     * printable chars.
+     *
+     */
+    public void testWrongStrings()
     {
-        assertFalse( checker.isValidSyntax( "@" ) );
-        assertFalse( checker.isValidSyntax( "tRue#" ) );
-        assertFalse( checker.isValidSyntax( "&" ) );
-        assertFalse( checker.isValidSyntax( "Ž" ) );
-        assertFalse( checker.isValidSyntax( "\"" ) );
-        assertFalse( checker.isValidSyntax( "¤" ) );
-        assertFalse( checker.isValidSyntax( "" ) );
-        assertFalse( checker.isValidSyntax( "!" ) );
-        assertFalse( checker.isValidSyntax( "" ) );
-        assertFalse( checker.isValidSyntax( "ˆ" ) );
-        assertFalse( checker.isValidSyntax( "¡" ) );
-        assertFalse( checker.isValidSyntax( "_" ) );
-        assertFalse( checker.isValidSyntax( "#" ) );
-        assertFalse( checker.isValidSyntax( "<" ) );
-        assertFalse( checker.isValidSyntax( ">" ) );
-        assertFalse( checker.isValidSyntax( ";" ) );
-        assertFalse( checker.isValidSyntax( "" ) );
-        assertFalse( checker.isValidSyntax( "%" ) );
-        assertFalse( checker.isValidSyntax( "`" ) );
-        assertFalse( checker.isValidSyntax( "£" ) );
-        assertFalse( checker.isValidSyntax( "$" ) );
-        assertFalse( checker.isValidSyntax( "*" ) );
-        assertFalse( checker.isValidSyntax( "Û" ) );
-        assertFalse( checker.isValidSyntax( "^" ) );
-        assertFalse( checker.isValidSyntax( "¬" ) );
-        assertFalse( checker.isValidSyntax( "\\" ) );
-        assertFalse( checker.isValidSyntax( "|" ) );
-        assertFalse( checker.isValidSyntax( "«" ) );
-        assertFalse( checker.isValidSyntax( "ã" ) );
-        assertFalse( checker.isValidSyntax( "[" ) );
-        assertFalse( checker.isValidSyntax( "]" ) );
+        for ( int i = 0; i < 0x1F; i++ )
+        {
+            assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)i} ) ) );
+        }
+
+        for ( int i = 0x21; i < 0x26; i++ )
+        {
+            assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)i} ) ) );
+        }
+
+        for ( int i = 0x5B; i < 0x60; i++ )
+        {
+            assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)i} ) ) );
+        }
+
+        for ( int i = 0x7B; i < 0x7F; i++ )
+        {
+            assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)i} ) ) );
+        }
+
+        assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)0x2A} ) ) );
+        assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)0x3B} ) ) );
+        assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)0x3C} ) ) );
+        assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)0x3E} ) ) );
+        assertFalse( checker.isValidSyntax( new String( new byte[]{(byte)0x40} ) ) );
     }
     
     



Mime
View raw message