directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r896579 [12/14] - in /directory/shared/trunk: ./ ldap/ ldap/src/main/antlr/ ldap/src/main/java/org/apache/directory/shared/ldap/ ldap/src/main/java/org/apache/directory/shared/ldap/codec/ ldap/src/main/java/org/apache/directory/shared/ldap/...
Date Wed, 06 Jan 2010 17:52:31 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITContentRuleDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITContentRuleDescriptionSchemaParserTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITContentRuleDescriptionSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITContentRuleDescriptionSchemaParserTest.java Wed Jan  6 17:52:15 2010
@@ -22,7 +22,7 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.DITContentRuleDescription;
+import org.apache.directory.shared.ldap.schema.DITContentRule;
 import org.apache.directory.shared.ldap.schema.parsers.DITContentRuleDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -115,99 +115,99 @@
     public void testAux() throws ParseException
     {
         String value = null;
-        DITContentRuleDescription dcrd = null;
+        DITContentRule ditContentRule = null;
 
         // no AUX
         value = "( 1.1 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 0, dcrd.getAuxiliaryObjectClasses().size() );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 0, ditContentRule.getAuxObjectClassOids().size() );
 
         // AUX simple numericoid
         value = "( 1.1 AUX 1.2.3 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "1.2.3", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "1.2.3", ditContentRule.getAuxObjectClassOids().get( 0 ) );
 
         // AUX simple descr
         value = "( 1.1 AUX top )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "top", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "top", ditContentRule.getAuxObjectClassOids().get( 0 ) );
 
         // AUX single numericoid
         value = "( 1.1 AUX ( 1.2.3.4.5 ) )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "1.2.3.4.5", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "1.2.3.4.5", ditContentRule.getAuxObjectClassOids().get( 0 ) );
 
         // AUX single descr
         value = "( 1.1 AUX ( A-Z-0-9 ) )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "A-Z-0-9", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "A-Z-0-9", ditContentRule.getAuxObjectClassOids().get( 0 ) );
 
         // AUX multi numericoid
         value = "( 1.1 AUX ( 1.2.3 $ 1.2.3.4.5 ) )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 2, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "1.2.3", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4.5", dcrd.getAuxiliaryObjectClasses().get( 1 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 2, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "1.2.3", ditContentRule.getAuxObjectClassOids().get( 0 ) );
+        assertEquals( "1.2.3.4.5", ditContentRule.getAuxObjectClassOids().get( 1 ) );
 
         // AUX multi descr
         value = "( 1.1 AUX ( top1 $ top2 ) )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 2, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "top1", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
-        assertEquals( "top2", dcrd.getAuxiliaryObjectClasses().get( 1 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 2, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "top1", ditContentRule.getAuxObjectClassOids().get( 0 ) );
+        assertEquals( "top2", ditContentRule.getAuxObjectClassOids().get( 1 ) );
 
         // AUX multi mixed
         value = "( 1.1 AUX ( top1 $ 1.2.3.4 $ top2 ) )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 3, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "top1", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4", dcrd.getAuxiliaryObjectClasses().get( 1 ) );
-        assertEquals( "top2", dcrd.getAuxiliaryObjectClasses().get( 2 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 3, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "top1", ditContentRule.getAuxObjectClassOids().get( 0 ) );
+        assertEquals( "1.2.3.4", ditContentRule.getAuxObjectClassOids().get( 1 ) );
+        assertEquals( "top2", ditContentRule.getAuxObjectClassOids().get( 2 ) );
 
         // AUX multi mixed no space
         value = "(1.1 AUX(TOP-1$1.2.3.4$TOP-2))";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 3, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "TOP-1", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4", dcrd.getAuxiliaryObjectClasses().get( 1 ) );
-        assertEquals( "TOP-2", dcrd.getAuxiliaryObjectClasses().get( 2 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 3, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "TOP-1", ditContentRule.getAuxObjectClassOids().get( 0 ) );
+        assertEquals( "1.2.3.4", ditContentRule.getAuxObjectClassOids().get( 1 ) );
+        assertEquals( "TOP-2", ditContentRule.getAuxObjectClassOids().get( 2 ) );
 
         // AUX multi mixed many spaces
         value = "(          1.1          AUX          (          top1          $          1.2.3.4$top2          )          )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 3, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "top1", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4", dcrd.getAuxiliaryObjectClasses().get( 1 ) );
-        assertEquals( "top2", dcrd.getAuxiliaryObjectClasses().get( 2 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 3, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "top1", ditContentRule.getAuxObjectClassOids().get( 0 ) );
+        assertEquals( "1.2.3.4", ditContentRule.getAuxObjectClassOids().get( 1 ) );
+        assertEquals( "top2", ditContentRule.getAuxObjectClassOids().get( 2 ) );
 
         // no quote allowed
         value = "( 1.1 AUX 'top' )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "top", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "top", ditContentRule.getAuxObjectClassOids().get( 0 ) );
 
         // quoted value
         value = "( 1.1 AUX '1.2.3.4' )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "1.2.3.4", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "1.2.3.4", ditContentRule.getAuxObjectClassOids().get( 0 ) );
 
         // no $ separator
         value = "( 1.1 AUX ( top1 top2 ) )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 2, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "top1", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
-        assertEquals( "top2", dcrd.getAuxiliaryObjectClasses().get( 1 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 2, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "top1", ditContentRule.getAuxObjectClassOids().get( 0 ) );
+        assertEquals( "top2", ditContentRule.getAuxObjectClassOids().get( 1 ) );
 
         // invalid character
         value = "( 1.1 AUX 1.2.3.4.A )";
         try
         {
-            dcrd = parser.parseDITContentRuleDescription( value );
+            ditContentRule = parser.parseDITContentRuleDescription( value );
             fail( "Exception expected, invalid AUX '1.2.3.4.A' (invalid character)" );
         }
         catch ( ParseException pe )
@@ -219,7 +219,7 @@
         value = "( 1.1 AUX )";
         try
         {
-            dcrd = parser.parseDITContentRuleDescription( value );
+            ditContentRule = parser.parseDITContentRuleDescription( value );
             fail( "Exception expected, no AUX value" );
         }
         catch ( ParseException pe )
@@ -233,7 +233,7 @@
             value = "( 1.1 AUX ( top1 $ -top2 ) )";
             try
             {
-                dcrd = parser.parseDITContentRuleDescription( value );
+                ditContentRule = parser.parseDITContentRuleDescription( value );
                 fail( "Exception expected, invalid AUX '-top' (starts with hypen)" );
             }
             catch ( ParseException pe )
@@ -254,33 +254,33 @@
     public void testMust() throws ParseException
     {
         String value = null;
-        DITContentRuleDescription dcrd = null;
+        DITContentRule ditContentRule = null;
 
         // no MUST
         value = "( 1.1 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 0, dcrd.getMustAttributeTypes().size() );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 0, ditContentRule.getMustAttributeTypeOids().size() );
 
         // MUST simple numericoid
         value = "( 1.1 MUST 1.2.3 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getMustAttributeTypes().size() );
-        assertEquals( "1.2.3", dcrd.getMustAttributeTypes().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getMustAttributeTypeOids().size() );
+        assertEquals( "1.2.3", ditContentRule.getMustAttributeTypeOids().get( 0 ) );
 
         // MUST mulitple
         value = "(1.1 MUST (cn\rsn       $11.22.33.44.55            objectClass\t))";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 4, dcrd.getMustAttributeTypes().size() );
-        assertEquals( "cn", dcrd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( "sn", dcrd.getMustAttributeTypes().get( 1 ) );
-        assertEquals( "11.22.33.44.55", dcrd.getMustAttributeTypes().get( 2 ) );
-        assertEquals( "objectClass", dcrd.getMustAttributeTypes().get( 3 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 4, ditContentRule.getMustAttributeTypeOids().size() );
+        assertEquals( "cn", ditContentRule.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( "sn", ditContentRule.getMustAttributeTypeOids().get( 1 ) );
+        assertEquals( "11.22.33.44.55", ditContentRule.getMustAttributeTypeOids().get( 2 ) );
+        assertEquals( "objectClass", ditContentRule.getMustAttributeTypeOids().get( 3 ) );
 
         // no MUST values
         value = "( 1.1 MUST )";
         try
         {
-            dcrd = parser.parseDITContentRuleDescription( value );
+            ditContentRule = parser.parseDITContentRuleDescription( value );
             fail( "Exception expected, no MUST value" );
         }
         catch ( ParseException pe )
@@ -294,7 +294,7 @@
             value = "( 1.1 MUST ( c_n ) )";
             try
             {
-                dcrd = parser.parseDITContentRuleDescription( value );
+                ditContentRule = parser.parseDITContentRuleDescription( value );
                 fail( "Exception expected, invalid value c_n" );
             }
             catch ( ParseException pe )
@@ -315,27 +315,27 @@
     public void testMay() throws ParseException
     {
         String value = null;
-        DITContentRuleDescription dcrd = null;
+        DITContentRule ditContentRule = null;
 
         // no MAY
         value = "( 1.1 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 0, dcrd.getMayAttributeTypes().size() );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 0, ditContentRule.getMayAttributeTypeOids().size() );
 
         // MAY simple numericoid
         value = "( 1.1 MAY 1.2.3 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getMayAttributeTypes().size() );
-        assertEquals( "1.2.3", dcrd.getMayAttributeTypes().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getMayAttributeTypeOids().size() );
+        assertEquals( "1.2.3", ditContentRule.getMayAttributeTypeOids().get( 0 ) );
 
         // MAY mulitple
         value = "(1.1 MAY (cn$sn       $11.22.33.44.55         $  objectClass   ))";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 4, dcrd.getMayAttributeTypes().size() );
-        assertEquals( "cn", dcrd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "sn", dcrd.getMayAttributeTypes().get( 1 ) );
-        assertEquals( "11.22.33.44.55", dcrd.getMayAttributeTypes().get( 2 ) );
-        assertEquals( "objectClass", dcrd.getMayAttributeTypes().get( 3 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 4, ditContentRule.getMayAttributeTypeOids().size() );
+        assertEquals( "cn", ditContentRule.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "sn", ditContentRule.getMayAttributeTypeOids().get( 1 ) );
+        assertEquals( "11.22.33.44.55", ditContentRule.getMayAttributeTypeOids().get( 2 ) );
+        assertEquals( "objectClass", ditContentRule.getMayAttributeTypeOids().get( 3 ) );
 
         if ( !parser.isQuirksMode() )
         {
@@ -343,7 +343,7 @@
             value = "( 1.1 MAY ( c_n ) )";
             try
             {
-                dcrd = parser.parseDITContentRuleDescription( value );
+                ditContentRule = parser.parseDITContentRuleDescription( value );
                 fail( "Exception expected, invalid value c_n" );
             }
             catch ( ParseException pe )
@@ -364,27 +364,27 @@
     public void testNot() throws ParseException
     {
         String value = null;
-        DITContentRuleDescription dcrd = null;
+        DITContentRule ditContentRule = null;
 
         // no NOT
         value = "( 1.1 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 0, dcrd.getNotAttributeTypes().size() );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 0, ditContentRule.getNotAttributeTypeOids().size() );
 
         // NOT simple numericoid
         value = "( 1.1 NOT 1.2.3 )";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 1, dcrd.getNotAttributeTypes().size() );
-        assertEquals( "1.2.3", dcrd.getNotAttributeTypes().get( 0 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 1, ditContentRule.getNotAttributeTypeOids().size() );
+        assertEquals( "1.2.3", ditContentRule.getNotAttributeTypeOids().get( 0 ) );
 
         // NOT mulitple
         value = "(1.1 NOT (cn\nsn\t$11.22.33.44.55         $  objectClass   ))";
-        dcrd = parser.parseDITContentRuleDescription( value );
-        assertEquals( 4, dcrd.getNotAttributeTypes().size() );
-        assertEquals( "cn", dcrd.getNotAttributeTypes().get( 0 ) );
-        assertEquals( "sn", dcrd.getNotAttributeTypes().get( 1 ) );
-        assertEquals( "11.22.33.44.55", dcrd.getNotAttributeTypes().get( 2 ) );
-        assertEquals( "objectClass", dcrd.getNotAttributeTypes().get( 3 ) );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
+        assertEquals( 4, ditContentRule.getNotAttributeTypeOids().size() );
+        assertEquals( "cn", ditContentRule.getNotAttributeTypeOids().get( 0 ) );
+        assertEquals( "sn", ditContentRule.getNotAttributeTypeOids().get( 1 ) );
+        assertEquals( "11.22.33.44.55", ditContentRule.getNotAttributeTypeOids().get( 2 ) );
+        assertEquals( "objectClass", ditContentRule.getNotAttributeTypeOids().get( 3 ) );
 
         if ( !parser.isQuirksMode() )
         {
@@ -392,7 +392,7 @@
             value = "( 1.1 NOT ( c_n ) )";
             try
             {
-                dcrd = parser.parseDITContentRuleDescription( value );
+                ditContentRule = parser.parseDITContentRuleDescription( value );
                 fail( "Exception expected, invalid value c_n" );
             }
             catch ( ParseException pe )
@@ -425,42 +425,42 @@
     public void testFull() throws ParseException
     {
         String value = null;
-        DITContentRuleDescription dcrd = null;
+        DITContentRule ditContentRule = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 NAME ( 'abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789' 'test' ) DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577' OBSOLETE AUX ( 2.3.4.5.6.7.8.9.0.1 $ abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 ) MUST ( 3.4.5.6.7.8.9.0.1.2 $ abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 ) MAY ( 4.5.6.7.8.9.0.1.2.3 $ abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 ) NOT ( 5.6.7.8.9.0.1.2.3.4 $ abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 ) X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
-        dcrd = parser.parseDITContentRuleDescription( value );
+        ditContentRule = parser.parseDITContentRuleDescription( value );
 
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", dcrd.getNumericOid() );
-        assertEquals( 2, dcrd.getNames().size() );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", dcrd.getNames().get( 0 ) );
-        assertEquals( "test", dcrd.getNames().get( 1 ) );
-        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", dcrd.getDescription() );
-        assertTrue( dcrd.isObsolete() );
-        assertEquals( 2, dcrd.getAuxiliaryObjectClasses().size() );
-        assertEquals( "2.3.4.5.6.7.8.9.0.1", dcrd.getAuxiliaryObjectClasses().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", dcrd
-            .getAuxiliaryObjectClasses().get( 1 ) );
-        assertEquals( 2, dcrd.getMustAttributeTypes().size() );
-        assertEquals( "3.4.5.6.7.8.9.0.1.2", dcrd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", dcrd.getMustAttributeTypes()
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", ditContentRule.getOid() );
+        assertEquals( 2, ditContentRule.getNames().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ditContentRule.getNames().get( 0 ) );
+        assertEquals( "test", ditContentRule.getNames().get( 1 ) );
+        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", ditContentRule.getDescription() );
+        assertTrue( ditContentRule.isObsolete() );
+        assertEquals( 2, ditContentRule.getAuxObjectClassOids().size() );
+        assertEquals( "2.3.4.5.6.7.8.9.0.1", ditContentRule.getAuxObjectClassOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ditContentRule
+            .getAuxObjectClassOids().get( 1 ) );
+        assertEquals( 2, ditContentRule.getMustAttributeTypeOids().size() );
+        assertEquals( "3.4.5.6.7.8.9.0.1.2", ditContentRule.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ditContentRule.getMustAttributeTypeOids()
             .get( 1 ) );
-        assertEquals( 2, dcrd.getMayAttributeTypes().size() );
-        assertEquals( "4.5.6.7.8.9.0.1.2.3", dcrd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", dcrd.getMayAttributeTypes()
+        assertEquals( 2, ditContentRule.getMayAttributeTypeOids().size() );
+        assertEquals( "4.5.6.7.8.9.0.1.2.3", ditContentRule.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ditContentRule.getMayAttributeTypeOids()
             .get( 1 ) );
-        assertEquals( 2, dcrd.getNotAttributeTypes().size() );
-        assertEquals( "5.6.7.8.9.0.1.2.3.4", dcrd.getNotAttributeTypes().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", dcrd.getNotAttributeTypes()
+        assertEquals( 2, ditContentRule.getNotAttributeTypeOids().size() );
+        assertEquals( "5.6.7.8.9.0.1.2.3.4", ditContentRule.getNotAttributeTypeOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ditContentRule.getNotAttributeTypeOids()
             .get( 1 ) );
-        assertEquals( 2, dcrd.getExtensions().size() );
-        assertNotNull( dcrd.getExtensions().get( "X-TEST-a" ) );
-        assertEquals( 2, dcrd.getExtensions().get( "X-TEST-a" ).size() );
-        assertEquals( "test1-1", dcrd.getExtensions().get( "X-TEST-a" ).get( 0 ) );
-        assertEquals( "test1-2", dcrd.getExtensions().get( "X-TEST-a" ).get( 1 ) );
-        assertNotNull( dcrd.getExtensions().get( "X-TEST-b" ) );
-        assertEquals( 2, dcrd.getExtensions().get( "X-TEST-b" ).size() );
-        assertEquals( "test2-1", dcrd.getExtensions().get( "X-TEST-b" ).get( 0 ) );
-        assertEquals( "test2-2", dcrd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( 2, ditContentRule.getExtensions().size() );
+        assertNotNull( ditContentRule.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, ditContentRule.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", ditContentRule.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", ditContentRule.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( ditContentRule.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, ditContentRule.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", ditContentRule.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", ditContentRule.getExtensions().get( "X-TEST-b" ).get( 1 ) );
     }
 
 
@@ -527,5 +527,4 @@
             parser.setQuirksMode( false );
         }
     }
-
 }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITStructureRuleDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITStructureRuleDescriptionSchemaParserTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITStructureRuleDescriptionSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/DITStructureRuleDescriptionSchemaParserTest.java Wed Jan  6 17:52:15 2010
@@ -22,7 +22,7 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.DITStructureRuleDescription;
+import org.apache.directory.shared.ldap.schema.DITStructureRule;
 import org.apache.directory.shared.ldap.schema.parsers.DITStructureRuleDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -67,7 +67,7 @@
     public void testNumericRuleId() throws ParseException
     {
         String value = null;
-        DITStructureRuleDescription dsrd = null;
+        DITStructureRule ditStructureRule = null;
 
         // null test
         value = null;
@@ -95,18 +95,18 @@
 
         // simple
         value = "( 1 FORM 1.1 )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( new Integer( 1 ), dsrd.getRuleId() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( 1, ditStructureRule.getRuleId() );
 
         // simple
         value = "( 1234567890 FORM 1.1 )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( new Integer( 1234567890 ), dsrd.getRuleId() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( 1234567890, ditStructureRule.getRuleId() );
 
         // simple with spaces
         value = "(      1234567890   FORM   1.1     )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( new Integer( 1234567890 ), dsrd.getRuleId() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( 1234567890, ditStructureRule.getRuleId() );
 
         // non-numeric not allowed
         value = "( test FORM 1.1 )";
@@ -192,48 +192,48 @@
     public void testForm() throws ParseException
     {
         String value = null;
-        DITStructureRuleDescription dsrd = null;
+        DITStructureRule ditStructureRule = null;
 
         // numeric oid
         value = "( 1 FORM 1.2.3.4.5.6.7.8.9.0 )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", ditStructureRule.getForm() );
 
         // numeric oid
         value = "(   1    FORM    123.4567.890    )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( "123.4567.890", dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( "123.4567.890", ditStructureRule.getForm() );
 
         // descr
         value = "( 1 FORM abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ditStructureRule.getForm() );
 
         // descr, no space
         value = "(1 FORMabc)";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( "abc", dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( "abc", ditStructureRule.getForm() );
 
         // descr, tab
         value = "\t(\t1\tFORM\tabc\t)\t";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( "abc", dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( "abc", ditStructureRule.getForm() );
 
         // quoted value
         value = "( 1 FORM '1.2.3.4.5.6.7.8.9.0' )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", ditStructureRule.getForm() );
 
         // no quote allowed
         value = "( 1 FORM ('test') )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( "test", dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( "test", ditStructureRule.getForm() );
 
         // invalid character
         value = "( 1 FORM 1.2.3.4.A )";
         try
         {
-            dsrd = parser.parseDITStructureRuleDescription( value );
+            ditStructureRule = parser.parseDITStructureRuleDescription( value );
             fail( "Exception expected, invalid FORM 1.2.3.4.A (invalid character)" );
         }
         catch ( ParseException pe )
@@ -245,7 +245,7 @@
         value = "( 1 FORM ( test1 test2 ) )";
         try
         {
-            dsrd = parser.parseDITStructureRuleDescription( value );
+            ditStructureRule = parser.parseDITStructureRuleDescription( value );
             fail( "Exception expected, FORM must be single valued" );
         }
         catch ( ParseException pe )
@@ -259,7 +259,7 @@
             value = "( 1 FORM -test ) )";
             try
             {
-                dsrd = parser.parseDITStructureRuleDescription( value );
+                ditStructureRule = parser.parseDITStructureRuleDescription( value );
                 fail( "Exception expected, invalid FORM '-test' (starts with hypen)" );
             }
             catch ( ParseException pe )
@@ -279,31 +279,31 @@
     public void testSup() throws ParseException
     {
         String value = null;
-        DITStructureRuleDescription dsrd = null;
+        DITStructureRule ditStructureRule = null;
 
         // no SUP
         value = "( 1 FORM 1.1 )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( 0, dsrd.getSuperRules().size() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( 0, ditStructureRule.getSuperRules().size() );
 
         // SUP simple number
         value = "( 1 FORM 1.1 SUP 1 )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( 1, dsrd.getSuperRules().size() );
-        assertEquals( new Integer( 1 ), dsrd.getSuperRules().get( 0 ) );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( 1, ditStructureRule.getSuperRules().size() );
+        assertEquals( new Integer( 1 ), ditStructureRule.getSuperRules().get( 0 ) );
 
         // SUP single number
         value = "( 1 FORM 1.1 SUP ( 1 ) )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( 1, dsrd.getSuperRules().size() );
-        assertEquals( new Integer( 1 ), dsrd.getSuperRules().get( 0 ) );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( 1, ditStructureRule.getSuperRules().size() );
+        assertEquals( new Integer( 1 ), ditStructureRule.getSuperRules().get( 0 ) );
 
         // SUP multi number
         value = "( 1 FORM 1.1 SUP(12345 67890))";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertEquals( 2, dsrd.getSuperRules().size() );
-        assertEquals( new Integer( 12345 ), dsrd.getSuperRules().get( 0 ) );
-        assertEquals( new Integer( 67890 ), dsrd.getSuperRules().get( 1 ) );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertEquals( 2, ditStructureRule.getSuperRules().size() );
+        assertEquals( new Integer( 12345 ), ditStructureRule.getSuperRules().get( 0 ) );
+        assertEquals( new Integer( 67890 ), ditStructureRule.getSuperRules().get( 1 ) );
 
         // non-numeric not allowed
         value = "( 1 FORM 1.1 SUP test )";
@@ -354,31 +354,31 @@
     public void testFull() throws ParseException
     {
         String value = null;
-        DITStructureRuleDescription dsrd = null;
+        DITStructureRule ditStructureRule = null;
 
         value = "( 1234567890 NAME ( 'abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789' 'test' ) DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577' OBSOLETE FORM 2.3.4.5.6.7.8.9.0.1 SUP ( 1 1234567890 5 ) X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
 
-        assertEquals( new Integer( 1234567890 ), dsrd.getRuleId() );
-        assertEquals( 2, dsrd.getNames().size() );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", dsrd.getNames().get( 0 ) );
-        assertEquals( "test", dsrd.getNames().get( 1 ) );
-        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", dsrd.getDescription() );
-        assertTrue( dsrd.isObsolete() );
-        assertEquals( "2.3.4.5.6.7.8.9.0.1", dsrd.getForm() );
-        assertEquals( 3, dsrd.getSuperRules().size() );
-        assertEquals( new Integer( 1 ), dsrd.getSuperRules().get( 0 ) );
-        assertEquals( new Integer( 1234567890 ), dsrd.getSuperRules().get( 1 ) );
-        assertEquals( new Integer( 5 ), dsrd.getSuperRules().get( 2 ) );
-        assertEquals( 2, dsrd.getExtensions().size() );
-        assertNotNull( dsrd.getExtensions().get( "X-TEST-a" ) );
-        assertEquals( 2, dsrd.getExtensions().get( "X-TEST-a" ).size() );
-        assertEquals( "test1-1", dsrd.getExtensions().get( "X-TEST-a" ).get( 0 ) );
-        assertEquals( "test1-2", dsrd.getExtensions().get( "X-TEST-a" ).get( 1 ) );
-        assertNotNull( dsrd.getExtensions().get( "X-TEST-b" ) );
-        assertEquals( 2, dsrd.getExtensions().get( "X-TEST-b" ).size() );
-        assertEquals( "test2-1", dsrd.getExtensions().get( "X-TEST-b" ).get( 0 ) );
-        assertEquals( "test2-2", dsrd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( 1234567890, ditStructureRule.getRuleId() );
+        assertEquals( 2, ditStructureRule.getNames().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ditStructureRule.getNames().get( 0 ) );
+        assertEquals( "test", ditStructureRule.getNames().get( 1 ) );
+        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", ditStructureRule.getDescription() );
+        assertTrue( ditStructureRule.isObsolete() );
+        assertEquals( "2.3.4.5.6.7.8.9.0.1", ditStructureRule.getForm() );
+        assertEquals( 3, ditStructureRule.getSuperRules().size() );
+        assertEquals( new Integer( 1 ), ditStructureRule.getSuperRules().get( 0 ) );
+        assertEquals( new Integer( 1234567890 ), ditStructureRule.getSuperRules().get( 1 ) );
+        assertEquals( new Integer( 5 ), ditStructureRule.getSuperRules().get( 2 ) );
+        assertEquals( 2, ditStructureRule.getExtensions().size() );
+        assertNotNull( ditStructureRule.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, ditStructureRule.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", ditStructureRule.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", ditStructureRule.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( ditStructureRule.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, ditStructureRule.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", ditStructureRule.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", ditStructureRule.getExtensions().get( "X-TEST-b" ).get( 1 ) );
     }
 
 
@@ -407,11 +407,11 @@
     public void testRequiredElements() throws ParseException
     {
         String value = null;
-        DITStructureRuleDescription dsrd = null;
+        DITStructureRule ditStructureRule = null;
 
         value = "( 1 FORM 1.1 )";
-        dsrd = parser.parseDITStructureRuleDescription( value );
-        assertNotNull( dsrd.getForm() );
+        ditStructureRule = parser.parseDITStructureRuleDescription( value );
+        assertNotNull( ditStructureRule.getForm() );
 
         value = "( 1 )";
         try

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java Wed Jan  6 17:52:15 2010
@@ -22,7 +22,7 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescription;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -113,22 +113,23 @@
     public void testFull() throws ParseException
     {
         String value = null;
-        LdapSyntaxDescription lsd = null;
+        LdapSyntax ldapSyntax = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577' X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
-        lsd = parser.parseLdapSyntaxDescription( value );
+        ldapSyntax = parser.parseLdapSyntaxDescription( value );
 
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", lsd.getNumericOid() );
-        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", lsd.getDescription() );
-        assertEquals( 2, lsd.getExtensions().size() );
-        assertNotNull( lsd.getExtensions().get( "X-TEST-a" ) );
-        assertEquals( 2, lsd.getExtensions().get( "X-TEST-a" ).size() );
-        assertEquals( "test1-1", lsd.getExtensions().get( "X-TEST-a" ).get( 0 ) );
-        assertEquals( "test1-2", lsd.getExtensions().get( "X-TEST-a" ).get( 1 ) );
-        assertNotNull( lsd.getExtensions().get( "X-TEST-b" ) );
-        assertEquals( 2, lsd.getExtensions().get( "X-TEST-b" ).size() );
-        assertEquals( "test2-1", lsd.getExtensions().get( "X-TEST-b" ).get( 0 ) );
-        assertEquals( "test2-2", lsd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", ldapSyntax.getOid() );
+        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", ldapSyntax.getDescription() );
+        assertEquals( 2, ldapSyntax.getExtensions().size() );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, ldapSyntax.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", ldapSyntax.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", ldapSyntax.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, ldapSyntax.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", ldapSyntax.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", ldapSyntax.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( value, ldapSyntax.getSpecification() );
     }
 
 
@@ -154,14 +155,15 @@
     public void testRfcBinary() throws ParseException
     {
         String value = "( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' X-NOT-HUMAN-READABLE 'TRUE' )";
-        LdapSyntaxDescription lsd = parser.parseLdapSyntaxDescription( value );
+        LdapSyntax ldapSyntax = parser.parseLdapSyntaxDescription( value );
 
-        assertEquals( "1.3.6.1.4.1.1466.115.121.1.5", lsd.getNumericOid() );
-        assertEquals( "Binary", lsd.getDescription() );
-        assertEquals( 1, lsd.getExtensions().size() );
-        assertNotNull( lsd.getExtensions().get( "X-NOT-HUMAN-READABLE" ) );
-        assertEquals( 1, lsd.getExtensions().get( "X-NOT-HUMAN-READABLE" ).size() );
-        assertEquals( "TRUE", lsd.getExtensions().get( "X-NOT-HUMAN-READABLE" ).get( 0 ) );
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.5", ldapSyntax.getOid() );
+        assertEquals( "Binary", ldapSyntax.getDescription() );
+        assertEquals( 1, ldapSyntax.getExtensions().size() );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-NOT-HUMAN-READABLE" ) );
+        assertEquals( 1, ldapSyntax.getExtensions().get( "X-NOT-HUMAN-READABLE" ).size() );
+        assertEquals( "TRUE", ldapSyntax.getExtensions().get( "X-NOT-HUMAN-READABLE" ).get( 0 ) );
+        assertEquals( value, ldapSyntax.getSpecification() );
     }
 
 
@@ -172,10 +174,11 @@
     public void testSyntaxWithExtensions() throws ParseException
     {
         String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 DESC 'bogus description' X-SCHEMA 'blah' X-IS-HUMAN-READABLE 'true' )";
-        LdapSyntaxDescription desc = parser.parseLdapSyntaxDescription( substrate );
-        assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", desc.getNumericOid() );
-        assertEquals( "bogus description", desc.getDescription() );
-        assertNotNull( desc.getExtensions().get( "X-IS-HUMAN-READABLE" ) );
+        LdapSyntax ldapSyntax = parser.parseLdapSyntaxDescription( substrate );
+        assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", ldapSyntax.getOid() );
+        assertEquals( "bogus description", ldapSyntax.getDescription() );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-IS-HUMAN-READABLE" ) );
+        assertEquals( substrate, ldapSyntax.getSpecification() );
     }
 
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleDescriptionSchemaParserTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleDescriptionSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleDescriptionSchemaParserTest.java Wed Jan  6 17:52:15 2010
@@ -22,7 +22,9 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription;
+import javax.naming.NamingException;
+
+import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -89,36 +91,36 @@
 
 
     @Test
-    public void testSyntax() throws ParseException
+    public void testSyntax() throws ParseException, NamingException
     {
         String value = null;
-        MatchingRuleDescription mrd = null;
+        MatchingRule matchingRule = null;
 
         // simple
         value = "( 1.1 SYNTAX 0.1.2.3.4.5.6.7.8.9 )";
-        mrd = parser.parseMatchingRuleDescription( value );
-        assertEquals( "0.1.2.3.4.5.6.7.8.9", mrd.getSyntax() );
+        matchingRule = parser.parseMatchingRuleDescription( value );
+        assertEquals( "0.1.2.3.4.5.6.7.8.9", matchingRule.getSyntaxOid() );
 
         // simple
         value = "(1.1 SYNTAX 123.456.789.0)";
-        mrd = parser.parseMatchingRuleDescription( value );
-        assertEquals( "123.456.789.0", mrd.getSyntax() );
+        matchingRule = parser.parseMatchingRuleDescription( value );
+        assertEquals( "123.456.789.0", matchingRule.getSyntaxOid() );
 
         // simple with spaces
         value = "( 1.1    SYNTAX    0.1.2.3.4.5.6.7.8.9    )";
-        mrd = parser.parseMatchingRuleDescription( value );
-        assertEquals( "0.1.2.3.4.5.6.7.8.9", mrd.getSyntax() );
+        matchingRule = parser.parseMatchingRuleDescription( value );
+        assertEquals( "0.1.2.3.4.5.6.7.8.9", matchingRule.getSyntaxOid() );
 
         // quoted value in parentheses
         value = "( 1.1    SYNTAX ('0.1.2.3.4.5.6.7.8.9')    )";
-        mrd = parser.parseMatchingRuleDescription( value );
-        assertEquals( "0.1.2.3.4.5.6.7.8.9", mrd.getSyntax() );
+        matchingRule = parser.parseMatchingRuleDescription( value );
+        assertEquals( "0.1.2.3.4.5.6.7.8.9", matchingRule.getSyntaxOid() );
 
         // SYNTAX must only appear once
         value = "( 1.1 SYNTAX 2.2 SYNTAX 3.3 )";
         try
         {
-            mrd = parser.parseMatchingRuleDescription( value );
+            matchingRule = parser.parseMatchingRuleDescription( value );
             fail( "Exception expected, SYNTAX appears twice" );
         }
         catch ( ParseException pe )
@@ -144,7 +146,7 @@
             value = "( 1.1 )";
             try
             {
-                mrd = parser.parseMatchingRuleDescription( value );
+                matchingRule = parser.parseMatchingRuleDescription( value );
                 fail( "Exception expected, SYNTAX is required" );
             }
             catch ( ParseException pe )
@@ -163,30 +165,30 @@
 
 
     @Test
-    public void testFull() throws ParseException
+    public void testFull() throws ParseException, NamingException
     {
         String value = null;
-        MatchingRuleDescription mrd = null;
+        MatchingRule matchingRule = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 NAME ( 'abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789' 'test' ) DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577' OBSOLETE SYNTAX 0.1.2.3.4.5.6.7.8.9 X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
-        mrd = parser.parseMatchingRuleDescription( value );
+        matchingRule = parser.parseMatchingRuleDescription( value );
 
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", mrd.getNumericOid() );
-        assertEquals( 2, mrd.getNames().size() );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", mrd.getNames().get( 0 ) );
-        assertEquals( "test", mrd.getNames().get( 1 ) );
-        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", mrd.getDescription() );
-        assertTrue( mrd.isObsolete() );
-        assertEquals( "0.1.2.3.4.5.6.7.8.9", mrd.getSyntax() );
-        assertEquals( 2, mrd.getExtensions().size() );
-        assertNotNull( mrd.getExtensions().get( "X-TEST-a" ) );
-        assertEquals( 2, mrd.getExtensions().get( "X-TEST-a" ).size() );
-        assertEquals( "test1-1", mrd.getExtensions().get( "X-TEST-a" ).get( 0 ) );
-        assertEquals( "test1-2", mrd.getExtensions().get( "X-TEST-a" ).get( 1 ) );
-        assertNotNull( mrd.getExtensions().get( "X-TEST-b" ) );
-        assertEquals( 2, mrd.getExtensions().get( "X-TEST-b" ).size() );
-        assertEquals( "test2-1", mrd.getExtensions().get( "X-TEST-b" ).get( 0 ) );
-        assertEquals( "test2-2", mrd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", matchingRule.getOid() );
+        assertEquals( 2, matchingRule.getNames().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", matchingRule.getNames().get( 0 ) );
+        assertEquals( "test", matchingRule.getNames().get( 1 ) );
+        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", matchingRule.getDescription() );
+        assertTrue( matchingRule.isObsolete() );
+        assertEquals( "0.1.2.3.4.5.6.7.8.9", matchingRule.getSyntaxOid() );
+        assertEquals( 2, matchingRule.getExtensions().size() );
+        assertNotNull( matchingRule.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, matchingRule.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", matchingRule.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", matchingRule.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( matchingRule.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, matchingRule.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", matchingRule.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", matchingRule.getExtensions().get( "X-TEST-b" ).get( 1 ) );
     }
 
 
@@ -212,14 +214,14 @@
      * @throws ParseException
      */
     @Test
-    public void testRequiredElements() throws ParseException
+    public void testRequiredElements() throws ParseException, NamingException
     {
         String value = null;
-        MatchingRuleDescription mrd = null;
+        MatchingRule matchingRule = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 SYNTAX 1.1 )";
-        mrd = parser.parseMatchingRuleDescription( value );
-        assertNotNull( mrd.getSyntax() );
+        matchingRule = parser.parseMatchingRuleDescription( value );
+        assertNotNull( matchingRule.getSyntaxOid() );
 
         if ( !parser.isQuirksMode() )
         {
@@ -242,34 +244,34 @@
     ////////////////////////////////////////////////////////////////
 
     @Test
-    public void testRfc1() throws ParseException
+    public void testRfc1() throws ParseException, NamingException
     {
         String value = "( 2.5.13.5 NAME 'caseExactMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )";
-        MatchingRuleDescription mrd = parser.parseMatchingRuleDescription( value );
+        MatchingRule matchingRule = parser.parseMatchingRuleDescription( value );
 
-        assertEquals( "2.5.13.5", mrd.getNumericOid() );
-        assertEquals( 1, mrd.getNames().size() );
-        assertEquals( "caseExactMatch", mrd.getNames().get( 0 ) );
-        assertNull( mrd.getDescription() );
-        assertFalse( mrd.isObsolete() );
-        assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", mrd.getSyntax() );
-        assertEquals( 0, mrd.getExtensions().size() );
+        assertEquals( "2.5.13.5", matchingRule.getOid() );
+        assertEquals( 1, matchingRule.getNames().size() );
+        assertEquals( "caseExactMatch", matchingRule.getNames().get( 0 ) );
+        assertNull( matchingRule.getDescription() );
+        assertFalse( matchingRule.isObsolete() );
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", matchingRule.getSyntaxOid() );
+        assertEquals( 0, matchingRule.getExtensions().size() );
     }
 
 
     @Test
-    public void testSun1() throws ParseException
+    public void testSun1() throws ParseException, NamingException
     {
         String value = "( 2.5.13.5 NAME 'caseExactMatch' DESC 'Case Exact Matching on Directory String [defined in X.520]' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )";
-        MatchingRuleDescription mrd = parser.parseMatchingRuleDescription( value );
+        MatchingRule matchingRule = parser.parseMatchingRuleDescription( value );
 
-        assertEquals( "2.5.13.5", mrd.getNumericOid() );
-        assertEquals( 1, mrd.getNames().size() );
-        assertEquals( "caseExactMatch", mrd.getNames().get( 0 ) );
-        assertEquals( "Case Exact Matching on Directory String [defined in X.520]", mrd.getDescription() );
-        assertFalse( mrd.isObsolete() );
-        assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", mrd.getSyntax() );
-        assertEquals( 0, mrd.getExtensions().size() );
+        assertEquals( "2.5.13.5", matchingRule.getOid() );
+        assertEquals( 1, matchingRule.getNames().size() );
+        assertEquals( "caseExactMatch", matchingRule.getNames().get( 0 ) );
+        assertEquals( "Case Exact Matching on Directory String [defined in X.520]", matchingRule.getDescription() );
+        assertFalse( matchingRule.isObsolete() );
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", matchingRule.getSyntaxOid() );
+        assertEquals( 0, matchingRule.getExtensions().size() );
     }
 
 
@@ -278,7 +280,7 @@
      * syntax, no DOTs allowed in NAME value. 
      */
     @Test
-    public void testSun2() throws ParseException
+    public void testSun2() throws ParseException, NamingException
     {
         String value = "( 1.3.6.1.4.1.42.2.27.9.4.34.3.6 NAME 'caseExactSubstringMatch-2.16.840.1.113730.3.3.2.11.3' DESC 'en' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )";
         if ( !parser.isQuirksMode() )
@@ -295,14 +297,14 @@
         }
         else
         {
-            MatchingRuleDescription mrd = parser.parseMatchingRuleDescription( value );
-            assertEquals( "1.3.6.1.4.1.42.2.27.9.4.34.3.6", mrd.getNumericOid() );
-            assertEquals( 1, mrd.getNames().size() );
-            assertEquals( "caseExactSubstringMatch-2.16.840.1.113730.3.3.2.11.3", mrd.getNames().get( 0 ) );
-            assertEquals( "en", mrd.getDescription() );
-            assertFalse( mrd.isObsolete() );
-            assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", mrd.getSyntax() );
-            assertEquals( 0, mrd.getExtensions().size() );
+            MatchingRule matchingRule = parser.parseMatchingRuleDescription( value );
+            assertEquals( "1.3.6.1.4.1.42.2.27.9.4.34.3.6", matchingRule.getOid() );
+            assertEquals( 1, matchingRule.getNames().size() );
+            assertEquals( "caseExactSubstringMatch-2.16.840.1.113730.3.3.2.11.3", matchingRule.getNames().get( 0 ) );
+            assertEquals( "en", matchingRule.getDescription() );
+            assertFalse( matchingRule.isObsolete() );
+            assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", matchingRule.getSyntaxOid() );
+            assertEquals( 0, matchingRule.getExtensions().size() );
         }
     }
 
@@ -327,7 +329,7 @@
      * Tests quirks mode.
      */
     @Test
-    public void testQuirksMode() throws ParseException
+    public void testQuirksMode() throws ParseException, NamingException
     {
         SchemaParserTestUtils.testQuirksMode( parser, "SYNTAX 1.1" );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleUseDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleUseDescriptionSchemaParserTest.java?rev=896579&r1=896578&r2=896579&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleUseDescriptionSchemaParserTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/MatchingRuleUseDescriptionSchemaParserTest.java Wed Jan  6 17:52:15 2010
@@ -22,7 +22,7 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleUseDescription;
+import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleUseDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -31,6 +31,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertNotNull;
 
 
@@ -92,96 +93,96 @@
     {
 
         String value = null;
-        MatchingRuleUseDescription mrud = null;
+        MatchingRuleUse matchingRuleUse = null;
 
         // APPLIES simple numericoid
         value = "( 1.1 APPLIES 1.2.3.4.5.6.7.8.9.0 )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 1, mrud.getApplicableAttributes().size() );
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", mrud.getApplicableAttributes().get( 0 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 1, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
 
         // SUP simple descr
         value = "( 1.1 APPLIES abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 1, mrud.getApplicableAttributes().size() );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", mrud
-            .getApplicableAttributes().get( 0 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 1, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", matchingRuleUse
+            .getApplicableAttributeOids().get( 0 ) );
 
         // APPLIES single numericoid
         value = "( 1.1 APPLIES ( 123.4567.890 ) )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 1, mrud.getApplicableAttributes().size() );
-        assertEquals( "123.4567.890", mrud.getApplicableAttributes().get( 0 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 1, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "123.4567.890", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
 
         // APPLIES single descr
         value = "(1.1 APPLIES(a-z-A-Z-0-9))";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 1, mrud.getApplicableAttributes().size() );
-        assertEquals( "a-z-A-Z-0-9", mrud.getApplicableAttributes().get( 0 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 1, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "a-z-A-Z-0-9", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
 
         // APPLIES multi numericoid
         value = "( 1.1 APPLIES ( 1.2.3 $ 4.5.6 $ 7.8.90 ) )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 3, mrud.getApplicableAttributes().size() );
-        assertEquals( "1.2.3", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "4.5.6", mrud.getApplicableAttributes().get( 1 ) );
-        assertEquals( "7.8.90", mrud.getApplicableAttributes().get( 2 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 3, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "1.2.3", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "4.5.6", matchingRuleUse.getApplicableAttributeOids().get( 1 ) );
+        assertEquals( "7.8.90", matchingRuleUse.getApplicableAttributeOids().get( 2 ) );
 
         // APPLIES multi descr
         value = "( 1.1 APPLIES ( test1 $ test2 ) )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 2, mrud.getApplicableAttributes().size() );
-        assertEquals( "test1", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "test2", mrud.getApplicableAttributes().get( 1 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 2, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "test1", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "test2", matchingRuleUse.getApplicableAttributeOids().get( 1 ) );
 
         // APPLIES multi mixed, tabs
         value = "\t(\t1.1\tAPPLIES\t(\ttest1\t$\t1.2.3.4\t$\ttest2\t)\t)\t";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 3, mrud.getApplicableAttributes().size() );
-        assertEquals( "test1", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "1.2.3.4", mrud.getApplicableAttributes().get( 1 ) );
-        assertEquals( "test2", mrud.getApplicableAttributes().get( 2 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 3, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "test1", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "1.2.3.4", matchingRuleUse.getApplicableAttributeOids().get( 1 ) );
+        assertEquals( "test2", matchingRuleUse.getApplicableAttributeOids().get( 2 ) );
 
         // APPLIES multi mixed no space
         value = "(1.1 APPLIES(TEST-1$1.2.3.4$TEST-2))";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 3, mrud.getApplicableAttributes().size() );
-        assertEquals( "TEST-1", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "1.2.3.4", mrud.getApplicableAttributes().get( 1 ) );
-        assertEquals( "TEST-2", mrud.getApplicableAttributes().get( 2 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 3, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "TEST-1", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "1.2.3.4", matchingRuleUse.getApplicableAttributeOids().get( 1 ) );
+        assertEquals( "TEST-2", matchingRuleUse.getApplicableAttributeOids().get( 2 ) );
 
         // APPLIES multi mixed many spaces
         value = "(          1.1          APPLIES          (          test1          $          1.2.3.4$test2          )          )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 3, mrud.getApplicableAttributes().size() );
-        assertEquals( "test1", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "1.2.3.4", mrud.getApplicableAttributes().get( 1 ) );
-        assertEquals( "test2", mrud.getApplicableAttributes().get( 2 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 3, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "test1", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "1.2.3.4", matchingRuleUse.getApplicableAttributeOids().get( 1 ) );
+        assertEquals( "test2", matchingRuleUse.getApplicableAttributeOids().get( 2 ) );
 
         // quoted value
         value = "( 1.1 APPLIES 'test' )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 1, mrud.getApplicableAttributes().size() );
-        assertEquals( "test", mrud.getApplicableAttributes().get( 0 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 1, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "test", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
 
         // quoted value
         value = "( 1.1 APPLIES '1.2.3.4' )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 1, mrud.getApplicableAttributes().size() );
-        assertEquals( "1.2.3.4", mrud.getApplicableAttributes().get( 0 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 1, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "1.2.3.4", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
 
         // no $ separator
         value = "( 1.1 APPLIES ( test1 test2 ) )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 2, mrud.getApplicableAttributes().size() );
-        assertEquals( "test1", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "test2", mrud.getApplicableAttributes().get( 1 ) );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 2, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "test1", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "test2", matchingRuleUse.getApplicableAttributeOids().get( 1 ) );
 
         // invalid character
         value = "( 1.1 APPLIES 1.2.3.4.A )";
         try
         {
-            mrud = parser.parseMatchingRuleUseDescription( value );
+            matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
             fail( "Exception expected, invalid APPLIES '1.2.3.4.A' (invalid character)" );
         }
         catch ( ParseException pe )
@@ -193,7 +194,7 @@
         value = "( 1.1 APPLIES )";
         try
         {
-            mrud = parser.parseMatchingRuleUseDescription( value );
+            matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
             fail( "Exception expected, no APPLIES value" );
         }
         catch ( ParseException pe )
@@ -205,7 +206,7 @@
         value = "( 1.1 APPLIES test1 APPLIES test2 )";
         try
         {
-            mrud = parser.parseMatchingRuleUseDescription( value );
+            matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
             fail( "Exception expected, APPLIES appears twice" );
         }
         catch ( ParseException pe )
@@ -219,7 +220,7 @@
             value = "( 1.1 )";
             try
             {
-                mrud = parser.parseMatchingRuleUseDescription( value );
+                matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
                 fail( "Exception expected, APPLIES is required" );
             }
             catch ( ParseException pe )
@@ -231,7 +232,7 @@
             value = "( 1.1 APPLIES ( test1 $ -test2 ) )";
             try
             {
-                mrud = parser.parseMatchingRuleUseDescription( value );
+                matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
                 fail( "Exception expected, invalid APPLIES '-test' (starts with hypen)" );
             }
             catch ( ParseException pe )
@@ -253,30 +254,30 @@
     public void testFull() throws ParseException
     {
         String value = null;
-        MatchingRuleUseDescription mrud = null;
+        MatchingRuleUse matchingRuleUse = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 NAME ( 'abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789' 'test' ) DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577' OBSOLETE APPLIES ( 0.1.2.3.4.5.6.7.8.9 $ abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 ) X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
 
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", mrud.getNumericOid() );
-        assertEquals( 2, mrud.getNames().size() );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", mrud.getNames().get( 0 ) );
-        assertEquals( "test", mrud.getNames().get( 1 ) );
-        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", mrud.getDescription() );
-        assertTrue( mrud.isObsolete() );
-        assertEquals( 2, mrud.getApplicableAttributes().size() );
-        assertEquals( "0.1.2.3.4.5.6.7.8.9", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", mrud
-            .getApplicableAttributes().get( 1 ) );
-        assertEquals( 2, mrud.getExtensions().size() );
-        assertNotNull( mrud.getExtensions().get( "X-TEST-a" ) );
-        assertEquals( 2, mrud.getExtensions().get( "X-TEST-a" ).size() );
-        assertEquals( "test1-1", mrud.getExtensions().get( "X-TEST-a" ).get( 0 ) );
-        assertEquals( "test1-2", mrud.getExtensions().get( "X-TEST-a" ).get( 1 ) );
-        assertNotNull( mrud.getExtensions().get( "X-TEST-b" ) );
-        assertEquals( 2, mrud.getExtensions().get( "X-TEST-b" ).size() );
-        assertEquals( "test2-1", mrud.getExtensions().get( "X-TEST-b" ).get( 0 ) );
-        assertEquals( "test2-2", mrud.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", matchingRuleUse.getOid() );
+        assertEquals( 2, matchingRuleUse.getNames().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", matchingRuleUse.getNames().get( 0 ) );
+        assertEquals( "test", matchingRuleUse.getNames().get( 1 ) );
+        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", matchingRuleUse.getDescription() );
+        assertTrue( matchingRuleUse.isObsolete() );
+        assertEquals( 2, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "0.1.2.3.4.5.6.7.8.9", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", matchingRuleUse
+            .getApplicableAttributeOids().get( 1 ) );
+        assertEquals( 2, matchingRuleUse.getExtensions().size() );
+        assertNotNull( matchingRuleUse.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, matchingRuleUse.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", matchingRuleUse.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", matchingRuleUse.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( matchingRuleUse.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, matchingRuleUse.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", matchingRuleUse.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", matchingRuleUse.getExtensions().get( "X-TEST-b" ).get( 1 ) );
     }
 
 
@@ -305,11 +306,11 @@
     public void testRequiredElements() throws ParseException
     {
         String value = null;
-        MatchingRuleUseDescription mrud = null;
+        MatchingRuleUse matchingRuleUse = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 APPLIES a )";
-        mrud = parser.parseMatchingRuleUseDescription( value );
-        assertEquals( 1, mrud.getApplicableAttributes().size() );
+        matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
+        assertEquals( 1, matchingRuleUse.getApplicableAttributeOids().size() );
 
         if ( !parser.isQuirksMode() )
         {
@@ -335,17 +336,17 @@
     public void testOpenldap1() throws ParseException
     {
         String value = "( 2.5.13.17 NAME 'octetStringMatch' APPLIES ( javaSerializedData $ userPassword ) )";
-        MatchingRuleUseDescription mrud = parser.parseMatchingRuleUseDescription( value );
+        MatchingRuleUse matchingRuleUse = parser.parseMatchingRuleUseDescription( value );
 
-        assertEquals( "2.5.13.17", mrud.getNumericOid() );
-        assertEquals( 1, mrud.getNames().size() );
-        assertEquals( "octetStringMatch", mrud.getNames().get( 0 ) );
-        assertEquals( "", mrud.getDescription() );
-        assertFalse( mrud.isObsolete() );
-        assertEquals( 2, mrud.getApplicableAttributes().size() );
-        assertEquals( "javaSerializedData", mrud.getApplicableAttributes().get( 0 ) );
-        assertEquals( "userPassword", mrud.getApplicableAttributes().get( 1 ) );
-        assertEquals( 0, mrud.getExtensions().size() );
+        assertEquals( "2.5.13.17", matchingRuleUse.getOid() );
+        assertEquals( 1, matchingRuleUse.getNames().size() );
+        assertEquals( "octetStringMatch", matchingRuleUse.getNames().get( 0 ) );
+        assertNull( matchingRuleUse.getDescription() );
+        assertFalse( matchingRuleUse.isObsolete() );
+        assertEquals( 2, matchingRuleUse.getApplicableAttributeOids().size() );
+        assertEquals( "javaSerializedData", matchingRuleUse.getApplicableAttributeOids().get( 0 ) );
+        assertEquals( "userPassword", matchingRuleUse.getApplicableAttributeOids().get( 1 ) );
+        assertEquals( 0, matchingRuleUse.getExtensions().size() );
     }
 
 



Mime
View raw message