directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r662532 - in /directory/shared/trunk/ldap/src: main/antlr/ test/java/org/apache/directory/shared/ldap/schema/syntax/ test/java/org/apache/directory/shared/ldap/schema/syntax/parser/
Date Mon, 02 Jun 2008 19:40:13 GMT
Author: seelmann
Date: Mon Jun  2 12:40:13 2008
New Revision: 662532

URL: http://svn.apache.org/viewvc?rev=662532&view=rev
Log:
Partial fix for DIRSHARED-8:
o case insentivitity for keywords


Modified:
    directory/shared/trunk/ldap/src/main/antlr/schema-extension.g
    directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g
    directory/shared/trunk/ldap/src/main/antlr/schema-value.g
    directory/shared/trunk/ldap/src/main/antlr/schema.g
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java

Modified: directory/shared/trunk/ldap/src/main/antlr/schema-extension.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema-extension.g?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema-extension.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema-extension.g Mon Jun  2 12:40:13 2008
@@ -39,7 +39,7 @@
     k = 2 ;
     exportVocab=AntlrSchemaExtension ;
     charVocabulary = '\u0000'..'\uFFFE'; 
-    caseSensitive = true ;
+    caseSensitive = false ;
     defaultErrorHandler = false ;
 }
 
@@ -63,7 +63,7 @@
 XKEY : xstring:XSTRING { setText(xstring.getText().trim()); }; 
 XVALUES : values:VALUES { setText(values.getText().trim()); };
 
-protected XSTRING : ( "X-" ( 'a'..'z' | 'A'..'Z' | '-' | '_' )+ (WHSP)? ) ; 
+protected XSTRING : ( "x-" ( 'a'..'z' | '-' | '_' )+ (WHSP)? ) ; 
 protected VALUES : ( VALUE | '('  VALUE ( ('$')? VALUE )* ')' ) ;
 protected VALUE : (WHSP)? ( QUOTED_STRING ) (options {greedy=true;}: WHSP)? ;
 protected QUOTED_STRING : ( QUOTE (~'\'')* QUOTE ) ;

Modified: directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g Mon Jun  2 12:40:13 2008
@@ -38,7 +38,7 @@
     k = 2 ;
     exportVocab=AntlrSchemaQdstring ;
     charVocabulary = '\u0000'..'\uFFFE'; 
-    caseSensitive = true ;
+    caseSensitive = false ;
     defaultErrorHandler = false ;
 }
 

Modified: directory/shared/trunk/ldap/src/main/antlr/schema-value.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema-value.g?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema-value.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema-value.g Mon Jun  2 12:40:13 2008
@@ -38,7 +38,7 @@
     k = 3 ;
     exportVocab=AntlrSchemaValue ;
     charVocabulary = '\3'..'\377' ;
-    caseSensitive = true ;
+    caseSensitive = false ;
     defaultErrorHandler = false ;
 }
 
@@ -67,7 +67,7 @@
 DOLLAR : '$' ;
 LCURLY : '{' ;
 RCURLY : '}' ;
-DESCR : ( 'a'..'z' | 'A'..'Z' ) ( 'a'..'z' | 'A'..'Z' | '0'..'9' | '-' )* ;
+DESCR : ( 'a'..'z' ) ( 'a'..'z' | '0'..'9' | '-' )* ;
 LEN : LCURLY n:NUMBER RCURLY { setText(n.getText()); } ;
 
 NUMBER_OR_NUMERICOID :

Modified: directory/shared/trunk/ldap/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema.g?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema.g Mon Jun  2 12:40:13 2008
@@ -44,7 +44,7 @@
     k = 5 ;
     exportVocab=AntlrSchema ;
     charVocabulary = '\u0000'..'\uFFFE';
-    caseSensitive = true ;
+    caseSensitive = false ;
     defaultErrorHandler = false ;
 }
 
@@ -73,46 +73,45 @@
 
 LEN : LBRACKET ('0'..'9')+ RBRACKET ;
 
-SINGLE_VALUE : ( "SINGLE-VALUE" (WHSP)? ) ;
-COLLECTIVE : ( "COLLECTIVE" (WHSP)? ) ;
-NO_USER_MODIFICATION : ( "NO-USER-MODIFICATION" (WHSP)? ) ;
-
-OBSOLETE : ( "OBSOLETE" (WHSP)? ) ;
-ABSTRACT : ( "ABSTRACT" (WHSP)? ) ;
-STRUCTURAL : ( "STRUCTURAL" (WHSP)? ) ;
-AUXILIARY : ( "AUXILIARY" (WHSP)? ) ;
+SINGLE_VALUE : ( "single-value" (WHSP)? ) ;
+COLLECTIVE : ( "collective" (WHSP)? ) ;
+NO_USER_MODIFICATION : ( "no-user-modification" (WHSP)? ) ;
+
+OBSOLETE : ( "obsolete" (WHSP)? ) ;
+ABSTRACT : ( "abstract" (WHSP)? ) ;
+STRUCTURAL : ( "structural" (WHSP)? ) ;
+AUXILIARY : ( "auxiliary" (WHSP)? ) ;
 
 OBJECTCLASS : ( "objectclass" (WHSP)? ) ;
 ATTRIBUTETYPE : ( "attributetype" (WHSP)? ) ;
 
 STARTNUMERICOID : ( LPAR ( numericoid:VALUE ) ) { setText(numericoid.getText().trim()); }
;
-NAME : ( "NAME" (options {greedy=true;} : WHSP)? qdstrings:VALUES ) { setText(qdstrings.getText().trim());
} ;
-DESC : ( "DESC" (options {greedy=true;} : WHSP)? qdstring:VALUES ) { setText(qdstring.getText().trim());
} ;
-SUP : ( "SUP" (options {greedy=true;} : WHSP)? sup:VALUES ) { setText(sup.getText().trim());
} ;
-MUST : ( "MUST" (options {greedy=true;} : WHSP)? must:VALUES ) { setText(must.getText().trim());
} ;
-MAY : ( "MAY" (options {greedy=true;} : WHSP)? may:VALUES ) { setText(may.getText()); } ;
-AUX : ( "AUX" (options {greedy=true;} : WHSP)? aux:VALUES ) { setText(aux.getText()); } ;
-NOT : ( "NOT" (options {greedy=true;} : WHSP)? not:VALUES ) { setText(not.getText()); } ;
-FORM : ( "FORM" (options {greedy=true;} : WHSP)? form:VALUES ) { setText(form.getText());
} ;
-OC : ( "OC" (options {greedy=true;} : WHSP)? oc:VALUES ) { setText(oc.getText()); } ;
-EQUALITY : ( "EQUALITY" (options {greedy=true;} : WHSP)? equality:VALUES ) { setText(equality.getText().trim());
} ;
-ORDERING : ( "ORDERING" (options {greedy=true;} : WHSP)? ordering:VALUES ) { setText(ordering.getText().trim());
} ;
-SUBSTR : ( "SUBSTR" (options {greedy=true;} : WHSP)? substr:VALUES ) { setText(substr.getText().trim());
} ;
-SYNTAX : ( "SYNTAX" (options {greedy=true;} : WHSP)? syntax:VALUES (len:LEN)? ) { setText(syntax.getText().trim()
+ (len!=null?len.getText().trim():"")); } ;
-APPLIES : ( "APPLIES" (options {greedy=true;} : WHSP)? applies:VALUES ) { setText(applies.getText().trim());
} ;
-EXTENSION : x:( "X-" ( options {greedy=true;} : 'a'..'z' | 'A'..'Z' | '-' | '_' )+ (options
{greedy=true;} : WHSP)? VALUES ) ; 
-FQCN : ( "FQCN" (options {greedy=true;} : WHSP)? fqcn:FQCN_VALUE ) { setText(fqcn.getText().trim());
} ;
-BYTECODE : ( "BYTECODE" (options {greedy=true;} : WHSP)? bytecode:BYTECODE_VALUE ) { setText(bytecode.getText().trim());
} ;
+NAME : ( "name" (options {greedy=true;} : WHSP)? qdstrings:VALUES ) { setText(qdstrings.getText().trim());
} ;
+DESC : ( "desc" (options {greedy=true;} : WHSP)? qdstring:VALUES ) { setText(qdstring.getText().trim());
} ;
+SUP : ( "sup" (options {greedy=true;} : WHSP)? sup:VALUES ) { setText(sup.getText().trim());
} ;
+MUST : ( "must" (options {greedy=true;} : WHSP)? must:VALUES ) { setText(must.getText().trim());
} ;
+MAY : ( "may" (options {greedy=true;} : WHSP)? may:VALUES ) { setText(may.getText()); } ;
+AUX : ( "aux" (options {greedy=true;} : WHSP)? aux:VALUES ) { setText(aux.getText()); } ;
+NOT : ( "not" (options {greedy=true;} : WHSP)? not:VALUES ) { setText(not.getText()); } ;
+FORM : ( "form" (options {greedy=true;} : WHSP)? form:VALUES ) { setText(form.getText());
} ;
+OC : ( "oc" (options {greedy=true;} : WHSP)? oc:VALUES ) { setText(oc.getText()); } ;
+EQUALITY : ( "equality" (options {greedy=true;} : WHSP)? equality:VALUES ) { setText(equality.getText().trim());
} ;
+ORDERING : ( "ordering" (options {greedy=true;} : WHSP)? ordering:VALUES ) { setText(ordering.getText().trim());
} ;
+SUBSTR : ( "substr" (options {greedy=true;} : WHSP)? substr:VALUES ) { setText(substr.getText().trim());
} ;
+SYNTAX : ( "syntax" (options {greedy=true;} : WHSP)? syntax:VALUES (len:LEN)? ) { setText(syntax.getText().trim()
+ (len!=null?len.getText().trim():"")); } ;
+APPLIES : ( "applies" (options {greedy=true;} : WHSP)? applies:VALUES ) { setText(applies.getText().trim());
} ;
+EXTENSION : x:( "x-" ( options {greedy=true;} : 'a'..'z' | '-' | '_' )+ (options {greedy=true;}
: WHSP)? VALUES ) ; 
+FQCN : ( "fqcn" (options {greedy=true;} : WHSP)? fqcn:FQCN_VALUE ) { setText(fqcn.getText().trim());
} ;
+BYTECODE : ( "bytecode" (options {greedy=true;} : WHSP)? bytecode:BYTECODE_VALUE ) { setText(bytecode.getText().trim());
} ;
 
 protected VALUES : ( VALUE | LPAR  VALUE ( (DOLLAR)? VALUE )* RPAR ) ;
 protected VALUE : (WHSP)? ( QUOTED_STRING | UNQUOTED_STRING ) (options {greedy=true;}: WHSP)?
;
-protected UNQUOTED_STRING : (options{greedy=true;}: 'a'..'z' | 'A'..'Z' | '0'..'9' | '-'
| ';' | '.' )+ ;
+protected UNQUOTED_STRING : (options{greedy=true;}: 'a'..'z' | '0'..'9' | '-' | ';' | '.'
)+ ;
 protected QUOTED_STRING : ( QUOTE (~'\'')* QUOTE ) ;
 protected FQCN_VALUE : ( FQCN_IDENTIFIER ( '.' FQCN_IDENTIFIER )* ) ;
 protected FQCN_IDENTIFIER : ( FQCN_LETTER ( FQCN_LETTERORDIGIT )* ) ;
 protected FQCN_LETTER : 
        '\u0024' |
-       '\u0041'..'\u005a' |
        '\u005f' |
        '\u0061'..'\u007a' |
        '\u00c0'..'\u00d6' |
@@ -126,7 +125,6 @@
        '\uf900'..'\ufaff' ;
 protected FQCN_LETTERORDIGIT : 
        '\u0024' |
-       '\u0041'..'\u005a' |
        '\u005f' |
        '\u0061'..'\u007a' |
        '\u00c0'..'\u00d6' |
@@ -139,14 +137,14 @@
        '\u4e00'..'\u9fff' |
        '\uf900'..'\ufaff' |
        '\u0030'..'\u0039' ;
-protected BYTECODE_VALUE : ( 'a'..'z' | 'A'..'Z' | '0'..'9' | '+' | '/' | '=' )+ ;
+protected BYTECODE_VALUE : ( 'a'..'z' | '0'..'9' | '+' | '/' | '=' )+ ;
 
 
-USAGE : ( "USAGE" (WHSP)? ) ;
-USER_APPLICATIONS : ( "userApplications" (WHSP)? ) ;
-DIRECTORY_OPERATION : ( "directoryOperation" (WHSP)? ) ;
-DISTRIBUTED_OPERATION : ( "distributedOperation" (WHSP)? ) ;
-DSA_OPERATION : ( "dSAOperation" (WHSP)? ) ;
+USAGE : ( "usage" (WHSP)? ) ;
+USER_APPLICATIONS : ( "userapplications" (WHSP)? ) ;
+DIRECTORY_OPERATION : ( "directoryoperation" (WHSP)? ) ;
+DISTRIBUTED_OPERATION : ( "distributedoperation" (WHSP)? ) ;
+DSA_OPERATION : ( "dsaoperation" (WHSP)? ) ;
 
 /**
  * An antlr generated schema main parser.

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java
Mon Jun  2 12:40:13 2008
@@ -35,30 +35,41 @@
 {
     private DITContentRuleDescriptionSyntaxChecker checker = new DITContentRuleDescriptionSyntaxChecker();
 
+
     public void testValid()
     {
         assertTrue( checker.isValidSyntax( "( 2.5.6.4 )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule
for organization' )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule
for organization' OBSOLETE )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule
for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule
for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) )"
) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule
for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY
( l $ st )  )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule
for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY
( l $ st ) NOT ( 1.2.3.4.5.6.7.8.9.0 $ ou ) )" ) );
-        
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization'
OBSOLETE )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization'
OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization'
OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization'
OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY ( l $ st )  )"
) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization'
OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY ( l $ st ) NOT
( 1.2.3.4.5.6.7.8.9.0 $ ou ) )" ) );
 
         assertTrue( checker.isValidSyntax( "(2.5.6.4)" ) );
-        assertTrue( checker.isValidSyntax( "(   2.5.6.4     NAME   'organization'   DESC
  'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass
$ o )     MAY    (    l   $   st   ) NOT (1.2.3.4.5.6.7.8.9.0 $ ou))" ) );
+        assertTrue( checker
+            .isValidSyntax( "(   2.5.6.4     NAME   'organization'   DESC   'content rule
for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) 
   MAY    (    l   $   st   ) NOT (1.2.3.4.5.6.7.8.9.0 $ ou))" ) );
+
+        // lowercase NAME, DESC, AUX
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 name 'organization' desc 'content rule for organization'
aux ( pilotOrganization $  2.5.6.5 ) )" ) );
     }
 
+
     public void testInvalid()
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid OID
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -74,10 +85,6 @@
 
         // missing quotes
         assertFalse( checker.isValidSyntax( "( 2.5.6.4 NAME organization )" ) );
-
-        // lowercase NAME, DESC, AUX
-        assertFalse( checker.isValidSyntax( "( 2.5.6.4 name 'organization' desc 'content
rule for organization' aux ( pilotOrganization $  2.5.6.5 ) )" ) );
-
     }
 
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java
Mon Jun  2 12:40:13 2008
@@ -35,28 +35,40 @@
 {
     private DITStructureRuleDescriptionSyntaxChecker checker = new DITStructureRuleDescriptionSyntaxChecker();
 
+
     public void testValid()
     {
         assertTrue( checker.isValidSyntax( "( 2 FORM 2.5.15.3 )" ) );
         assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' FORM 2.5.15.3 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure
rule' FORM 2.5.15.3 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure
rule' OBSOLETE FORM 2.5.15.3 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure
rule' OBSOLETE FORM 2.5.15.3 SUP 1 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure
rule' OBSOLETE FORM 2.5.15.3 SUP ( 1 ) )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure
rule' OBSOLETE FORM 2.5.15.3 SUP ( 1 1234567890 5 ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' FORM
2.5.15.3 )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE
FORM 2.5.15.3 )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE
FORM 2.5.15.3 SUP 1 )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE
FORM 2.5.15.3 SUP ( 1 ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE
FORM 2.5.15.3 SUP ( 1 1234567890 5 ) )" ) );
 
         assertTrue( checker.isValidSyntax( "(2 FORM 2.5.15.3)" ) );
-        assertTrue( checker.isValidSyntax( "(   2   NAME    'organization'    DESC    'organization
structure rule'    OBSOLETE   FORM   2.5.15.3    SUP   (1 1234567890        5   ))" ) );
+        assertTrue( checker
+            .isValidSyntax( "(   2   NAME    'organization'    DESC    'organization structure
rule'    OBSOLETE   FORM   2.5.15.3    SUP   (1 1234567890        5   ))" ) );
+
+        // lowercase NAME, DESC, FORM
+        assertTrue( checker
+            .isValidSyntax( "( 2 name 'organization' desc 'organization structure rule' form
2.5.15.3 )" ) );
     }
 
+
     public void testInvalid()
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid ruleid
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -72,9 +84,6 @@
         // missing quotes
         assertFalse( checker.isValidSyntax( "( 2 NAME organization FORM 2.5.15.3 )" ) );
 
-        // lowercase NAME, DESC, FORM
-        assertFalse( checker.isValidSyntax( "( 2 name 'organization' desc 'organization structure
rule' form 2.5.15.3 )" ) );
-
         // missing FORM
         assertFalse( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure
rule' )" ) );
     }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java
Mon Jun  2 12:40:13 2008
@@ -40,12 +40,16 @@
     {
         assertTrue( checker.isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 )" ) ) );
         assertTrue( checker.isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory
String' )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory
String' X-ABC-DEF 'test' )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' X-ABC-DEF
'test' )" ) ) );
 
         // spaces
         assertTrue( checker.isValidSyntax( "(1.3.6.1.4.1.1466.115.121.1.15)" ) );
-        assertTrue( checker.isValidSyntax( "(      1.3.6.1.4.1.1466.115.121.1.15        DESC
'Directory String' X-ABC-DEF     'test'     )" ) );
-        
+        assertTrue( checker
+            .isValidSyntax( "(      1.3.6.1.4.1.1466.115.121.1.15        DESC 'Directory
String' X-ABC-DEF     'test'     )" ) );
+
+        // lowercase DESC
+        assertTrue( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 desc 'Directory
String' )" ) );
     }
 
 
@@ -53,10 +57,10 @@
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid OID
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -73,13 +77,11 @@
         // missing quotes
         assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC Directory
String )" ) );
 
-        // lowercase DESC
-        assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 desc 'Directory
String' )" ) );
-
         // invalid extension
         assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory
String' X-ABC-DEF )" ) );
-        assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory
String' X-ABC-123 'test' )" ) );
-        
+        assertFalse( checker
+            .isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' X-ABC-123
'test' )" ) );
+
     }
 
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java
Mon Jun  2 12:40:13 2008
@@ -40,13 +40,20 @@
     {
         assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 APPLIES userPassword )" ) ) );
         assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 APPLIES ( javaSerializedData $
userPassword ) )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' APPLIES
( javaSerializedData $ userPassword ) )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch'
APPLIES ( javaSerializedData $ userPassword ) )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch'
APPLIES ( javaSerializedData $ userPassword ) X-ABC-DEF 'test' )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' APPLIES ( javaSerializedData
$ userPassword ) )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch'
APPLIES ( javaSerializedData $ userPassword ) )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch'
APPLIES ( javaSerializedData $ userPassword ) X-ABC-DEF 'test' )" ) ) );
 
         // spaces
         assertTrue( checker.isValidSyntax( ( "(2.5.13.17 APPLIES userPassword)" ) ) );
-        assertTrue( checker.isValidSyntax( ( "(   2.5.13.17   NAME   'octetStringMatch' 
 DESC   'octetStringMatch'   APPLIES   (javaSerializedData   $    userPassword)  X-ABC-DEF
    'test'   )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "(   2.5.13.17   NAME   'octetStringMatch'   DESC   'octetStringMatch'
  APPLIES   (javaSerializedData   $    userPassword)  X-ABC-DEF     'test'   )" ) ) );
+
+        // lowercase DESC
+        assertTrue( checker.isValidSyntax( "( 2.5.13.17 desc 'Directory String' APPLIES userPassword
)" ) );
     }
 
 
@@ -54,10 +61,10 @@
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid OID
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -74,13 +81,10 @@
         // missing quotes
         assertFalse( checker.isValidSyntax( "( 2.5.13.17 DESC Directory String APPLIES userPassword
)" ) );
 
-        // lowercase DESC
-        assertFalse( checker.isValidSyntax( "( 2.5.13.17 desc 'Directory String' APPLIES
userPassword )" ) );
-
         // invalid extension
         assertFalse( checker.isValidSyntax( "( 2.5.13.17 APPLIES userPassword X-ABC-DEF )"
) );
         assertFalse( checker.isValidSyntax( "( 2.5.13.17 APPLIES userPassword X-ABC-123 'test'
)" ) );
-        
+
         // APPLIES is required
         assertFalse( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' )" ) )
);
     }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java?rev=662532&r1=662531&r2=662532&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java
Mon Jun  2 12:40:13 2008
@@ -254,17 +254,11 @@
         Assert.assertEquals( "test2", asd.getNames().get( 1 ) );
         Assert.assertEquals( "test3", asd.getNames().get( 2 ) );
 
-        // lowercase
+        // lowercase NAME
         value = "( " + oid + " " + required + " name 'test' )";
-        try
-        {
-            parser.parse( value );
-            Assert.fail( "Exception expected, NAME is lowercase" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        asd = parser.parse( value );
+        Assert.assertEquals( 1, asd.getNames().size() );
+        Assert.assertEquals( "test", asd.getNames().get( 0 ) );
 
         // unquoted
         value = "( " + oid + " " + required + " NAME test )";
@@ -385,18 +379,10 @@
         asd = parser.parse( value );
         Assert.assertEquals( "\\'\\", asd.getDescription() );
 
-        // lowercase
+        // lowercase DESC
         value = "( " + oid + " " + required + " desc 'Descripton' )";
-        try
-        {
-            parser.parse( value );
-            Assert.fail( "Exception expected, DESC is lowercase" );
-        }
-        catch ( ParseException pe )
-        {
-            Assert.assertTrue( true );
-        }
-
+        asd = parser.parse( value );
+        Assert.assertEquals( "Descripton", asd.getDescription() );
     }
 
 



Mime
View raw message