directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r709904 - in /directory: apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ shared/trunk/ldap/src/test/java/org/apache/...
Date Sun, 02 Nov 2008 18:52:00 GMT
Author: kayyagari
Date: Sun Nov  2 10:52:00 2008
New Revision: 709904

URL: http://svn.apache.org/viewvc?rev=709904&view=rev
Log:
o modified the booleansyntaxchecker to perform caseinsensitive check
o updted the booleansyntaxchecker's test case
o added the BooleanNormalizer to SystemNormalizerProducer

Modified:
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemNormalizerProducer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxCheckerTest.java

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemNormalizerProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemNormalizerProducer.java?rev=709904&r1=709903&r2=709904&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemNormalizerProducer.java
(original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemNormalizerProducer.java
Sun Nov  2 10:52:00 2008
@@ -27,8 +27,8 @@
 
 import org.apache.directory.server.schema.DnNormalizer;
 import org.apache.directory.server.schema.NameAndOptionalUIDNormalizer;
-import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.BooleanNormalizer;
 import org.apache.directory.shared.ldap.schema.CachingNormalizer;
 import org.apache.directory.shared.ldap.schema.DeepTrimNormalizer;
 import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
@@ -348,7 +348,7 @@
 
          */
 
-        normalizer = new NoOpNormalizer();
+        normalizer = new BooleanNormalizer();
         cb.schemaObjectProduced( this, "2.5.13.13", normalizer );
 
         /*

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java?rev=709904&r1=709903&r2=709904&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxChecker.java
Sun Nov  2 10:52:00 2008
@@ -90,6 +90,6 @@
             return false;
         }
         
-        return ( ( "TRUE".equals( strValue ) ) || ( "FALSE".equals( strValue ) ) );
+        return ( ( "TRUE".equalsIgnoreCase( strValue ) ) || ( "FALSE".equalsIgnoreCase( strValue
) ) );
     }
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxCheckerTest.java?rev=709904&r1=709903&r2=709904&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/BooleanSyntaxCheckerTest.java
Sun Nov  2 10:52:00 2008
@@ -55,16 +55,23 @@
     }
     
     
-    public void testWrongCase()
+    public void testWrongValue()
     {
-        assertFalse( checker.isValidSyntax( "fAlSe" ) );
-        assertFalse( checker.isValidSyntax( "tRue" ) );
-        assertFalse( checker.isValidSyntax( "false" ) );
         assertFalse( checker.isValidSyntax( "abc" ) );
+        assertFalse( checker.isValidSyntax( "123" ) );
     }
     
     
-    public void testCorrectCase()
+    public void testMixedCase()
+    {
+        assertTrue( checker.isValidSyntax( "fAlSe" ) );
+        assertTrue( checker.isValidSyntax( "tRue" ) );
+        assertTrue( checker.isValidSyntax( "false" ) );
+        assertTrue( checker.isValidSyntax( "true" ) );
+    }
+    
+    
+    public void testUpperCase()
     {
         assertTrue( checker.isValidSyntax( "FALSE" ) );
         assertTrue( checker.isValidSyntax( "TRUE" ) );



Mime
View raw message