directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r808050 [2/2] - in /directory/shared/branches/shared-schema/ldap/src: main/antlr/ main/java/org/apache/directory/shared/ldap/schema/ main/java/org/apache/directory/shared/ldap/schema/parsers/ test/java/org/apache/directory/shared/ldap/schem...
Date Wed, 26 Aug 2009 15:22:34 GMT
Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ObjectClassDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ObjectClassDescriptionSchemaParserTest.java?rev=808050&r1=808049&r2=808050&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ObjectClassDescriptionSchemaParserTest.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/ObjectClassDescriptionSchemaParserTest.java Wed Aug 26 15:22:31 2009
@@ -22,8 +22,10 @@
 
 import java.text.ParseException;
 
+import javax.naming.NamingException;
+
+import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
-import org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescription;
 import org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -114,102 +116,102 @@
      * @throws ParseException
      */
     @Test
-    public void testSuperior() throws ParseException
+    public void testSuperior() throws ParseException, NamingException
     {
         String value = null;
-        ObjectClassDescription ocd = null;
+        ObjectClass objectClass = null;
 
         // no SUP
         value = "( 1.1 )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 0, ocd.getSuperiorObjectClasses().size() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 0, objectClass.getSuperiorOids().size() );
 
         // SUP simple numericoid
         value = "( 1.1 SUP 1.2.3 )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "1.2.3", ocd.getSuperiorObjectClasses().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "1.2.3", objectClass.getSuperiorOids().get( 0 ) );
 
         // SUP simple descr
         value = "( 1.1 SUP top )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
 
         // SUP single numericoid
         value = "( 1.1 SUP ( 1.2.3.4.5 ) )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "1.2.3.4.5", ocd.getSuperiorObjectClasses().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "1.2.3.4.5", objectClass.getSuperiorOids().get( 0 ) );
 
         // SUP single descr
         value = "( 1.1 SUP ( A-Z-0-9 ) )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "A-Z-0-9", ocd.getSuperiorObjectClasses().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "A-Z-0-9", objectClass.getSuperiorOids().get( 0 ) );
 
         // SUP multi numericoid
         value = "( 1.1 SUP ( 1.2.3 $ 1.2.3.4.5 ) )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 2, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "1.2.3", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4.5", ocd.getSuperiorObjectClasses().get( 1 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 2, objectClass.getSuperiorOids().size() );
+        assertEquals( "1.2.3", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( "1.2.3.4.5", objectClass.getSuperiorOids().get( 1 ) );
 
         // SUP multi descr
         value = "( 1.1 SUP ( top1 $ top2 ) )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 2, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top1", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( "top2", ocd.getSuperiorObjectClasses().get( 1 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 2, objectClass.getSuperiorOids().size() );
+        assertEquals( "top1", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( "top2", objectClass.getSuperiorOids().get( 1 ) );
 
         // SUP multi mixed, tabs
         value = "\t(\t1.1\tSUP\t(\ttop1\t$\t1.2.3.4\t$\ttop2\t)\t)\t";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 3, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top1", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4", ocd.getSuperiorObjectClasses().get( 1 ) );
-        assertEquals( "top2", ocd.getSuperiorObjectClasses().get( 2 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 3, objectClass.getSuperiorOids().size() );
+        assertEquals( "top1", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( "1.2.3.4", objectClass.getSuperiorOids().get( 1 ) );
+        assertEquals( "top2", objectClass.getSuperiorOids().get( 2 ) );
 
         // SUP multi mixed, no space
         value = "(1.1 SUP(TOP-1$1.2.3.4$TOP-2))";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 3, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "TOP-1", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4", ocd.getSuperiorObjectClasses().get( 1 ) );
-        assertEquals( "TOP-2", ocd.getSuperiorObjectClasses().get( 2 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 3, objectClass.getSuperiorOids().size() );
+        assertEquals( "TOP-1", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( "1.2.3.4", objectClass.getSuperiorOids().get( 1 ) );
+        assertEquals( "TOP-2", objectClass.getSuperiorOids().get( 2 ) );
 
         // SUP multi mixed many spaces
         value = "(          1.1          SUP          (          top1          $          1.2.3.4$top2          )          )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 3, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top1", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( "1.2.3.4", ocd.getSuperiorObjectClasses().get( 1 ) );
-        assertEquals( "top2", ocd.getSuperiorObjectClasses().get( 2 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 3, objectClass.getSuperiorOids().size() );
+        assertEquals( "top1", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( "1.2.3.4", objectClass.getSuperiorOids().get( 1 ) );
+        assertEquals( "top2", objectClass.getSuperiorOids().get( 2 ) );
 
         // quoted value
         value = "( 1.1 SUP 'top' )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
 
         // quoted value
         value = "( 1.1 SUP '1.2.3.4' )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "1.2.3.4", ocd.getSuperiorObjectClasses().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "1.2.3.4", objectClass.getSuperiorOids().get( 0 ) );
 
         // no $ separator
         value = "( 1.1 SUP ( top1 top2 ) )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 2, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top1", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( "top2", ocd.getSuperiorObjectClasses().get( 1 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 2, objectClass.getSuperiorOids().size() );
+        assertEquals( "top1", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( "top2", objectClass.getSuperiorOids().get( 1 ) );
 
         // invalid character
         value = "( 1.1 SUP 1.2.3.4.A )";
         try
         {
-            ocd = parser.parseObjectClassDescription( value );
+            objectClass = parser.parseObjectClassDescription( value );
             fail( "Exception expected, invalid SUP '1.2.3.4.A' (invalid character)" );
         }
         catch ( ParseException pe )
@@ -221,7 +223,7 @@
         value = "( 1.1 SUP )";
         try
         {
-            ocd = parser.parseObjectClassDescription( value );
+            objectClass = parser.parseObjectClassDescription( value );
             fail( "Exception expected, no SUP value" );
         }
         catch ( ParseException pe )
@@ -235,7 +237,7 @@
             value = "( 1.1 SUP ( top1 $ -top2 ) )";
             try
             {
-                ocd = parser.parseObjectClassDescription( value );
+                objectClass = parser.parseObjectClassDescription( value );
                 fail( "Exception expected, invalid SUP '-top' (starts with hypen)" );
             }
             catch ( ParseException pe )
@@ -255,38 +257,38 @@
     public void testKind() throws ParseException
     {
         String value = null;
-        ObjectClassDescription ocd = null;
+        ObjectClass objectClass = null;
 
         // DEFAULT is STRUCTURAL
         value = "( 1.1 )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
 
         // ABSTRACT
         value = "( 1.1 ABSTRACT )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( ObjectClassTypeEnum.ABSTRACT, ocd.getKind() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( ObjectClassTypeEnum.ABSTRACT, objectClass.getType() );
 
         // AUXILIARY, tab
         value = "\t(\t1.1\tAUXILIARY\t)\t";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( ObjectClassTypeEnum.AUXILIARY, ocd.getKind() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( ObjectClassTypeEnum.AUXILIARY, objectClass.getType() );
 
         // STRUCTURAL, no space
         value = "(1.1 STRUCTURAL)";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
 
         // STRUCTURAL, case-insensitive
         value = "(1.1 sTrUcTuRaL )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
 
         // invalid
         value = "( 1.1 FOO )";
         try
         {
-            ocd = parser.parseObjectClassDescription( value );
+            objectClass = parser.parseObjectClassDescription( value );
             fail( "Exception expected, invalid KIND value" );
         }
         catch ( ParseException pe )
@@ -306,42 +308,42 @@
     public void testMust() throws ParseException
     {
         String value = null;
-        ObjectClassDescription ocd = null;
+        ObjectClass objectClass = null;
 
         // no MUST
         value = "( 1.1 )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 0, ocd.getMustAttributeTypes().size() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 0, objectClass.getMustAttributeTypeOids().size() );
 
         // MUST simple numericoid
         value = "( 1.1 MUST 1.2.3 )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getMustAttributeTypes().size() );
-        assertEquals( "1.2.3", ocd.getMustAttributeTypes().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "1.2.3", objectClass.getMustAttributeTypeOids().get( 0 ) );
 
         // MUST multiple
         value = "(1.1 MUST(cn$sn\r$11.22.33.44.55         $  objectClass   ))";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 4, ocd.getMustAttributeTypes().size() );
-        assertEquals( "cn", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( "sn", ocd.getMustAttributeTypes().get( 1 ) );
-        assertEquals( "11.22.33.44.55", ocd.getMustAttributeTypes().get( 2 ) );
-        assertEquals( "objectClass", ocd.getMustAttributeTypes().get( 3 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 4, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "cn", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( "sn", objectClass.getMustAttributeTypeOids().get( 1 ) );
+        assertEquals( "11.22.33.44.55", objectClass.getMustAttributeTypeOids().get( 2 ) );
+        assertEquals( "objectClass", objectClass.getMustAttributeTypeOids().get( 3 ) );
 
         // MUST multiple, no $ separator
         value = "(1.1 MUST(cn sn\t'11.22.33.44.55'\n'objectClass'))";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 4, ocd.getMustAttributeTypes().size() );
-        assertEquals( "cn", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( "sn", ocd.getMustAttributeTypes().get( 1 ) );
-        assertEquals( "11.22.33.44.55", ocd.getMustAttributeTypes().get( 2 ) );
-        assertEquals( "objectClass", ocd.getMustAttributeTypes().get( 3 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 4, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "cn", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( "sn", objectClass.getMustAttributeTypeOids().get( 1 ) );
+        assertEquals( "11.22.33.44.55", objectClass.getMustAttributeTypeOids().get( 2 ) );
+        assertEquals( "objectClass", objectClass.getMustAttributeTypeOids().get( 3 ) );
 
         // no MUST values
         value = "( 1.1 MUST )";
         try
         {
-            ocd = parser.parseObjectClassDescription( value );
+            objectClass = parser.parseObjectClassDescription( value );
             fail( "Exception expected, no MUST value" );
         }
         catch ( ParseException pe )
@@ -355,7 +357,7 @@
             value = "( 1.1 MUST ( c_n ) )";
             try
             {
-                ocd = parser.parseObjectClassDescription( value );
+                objectClass = parser.parseObjectClassDescription( value );
                 fail( "Exception expected, invalid value c_n" );
             }
             catch ( ParseException pe )
@@ -376,36 +378,36 @@
     public void testMay() throws ParseException
     {
         String value = null;
-        ObjectClassDescription ocd = null;
+        ObjectClass objectClass = null;
 
         // no MAY
         value = "( 1.1 )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 0, ocd.getMayAttributeTypes().size() );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 0, objectClass.getMayAttributeTypeOids().size() );
 
         // MAY simple numericoid
         value = "( 1.1 MAY 1.2.3 )";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 1, ocd.getMayAttributeTypes().size() );
-        assertEquals( "1.2.3", ocd.getMayAttributeTypes().get( 0 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 1, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "1.2.3", objectClass.getMayAttributeTypeOids().get( 0 ) );
 
         // MAY multiple
         value = "(1.1 MAY(cn$sn       $11.22.33.44.55\n$  objectClass   ))";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 4, ocd.getMayAttributeTypes().size() );
-        assertEquals( "cn", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "sn", ocd.getMayAttributeTypes().get( 1 ) );
-        assertEquals( "11.22.33.44.55", ocd.getMayAttributeTypes().get( 2 ) );
-        assertEquals( "objectClass", ocd.getMayAttributeTypes().get( 3 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 4, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "cn", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "sn", objectClass.getMayAttributeTypeOids().get( 1 ) );
+        assertEquals( "11.22.33.44.55", objectClass.getMayAttributeTypeOids().get( 2 ) );
+        assertEquals( "objectClass", objectClass.getMayAttributeTypeOids().get( 3 ) );
 
         // MAY multiple, no $ separator, quoted
         value = "(1.1 MAY('cn' sn\t'11.22.33.44.55'\nobjectClass))";
-        ocd = parser.parseObjectClassDescription( value );
-        assertEquals( 4, ocd.getMayAttributeTypes().size() );
-        assertEquals( "cn", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "sn", ocd.getMayAttributeTypes().get( 1 ) );
-        assertEquals( "11.22.33.44.55", ocd.getMayAttributeTypes().get( 2 ) );
-        assertEquals( "objectClass", ocd.getMayAttributeTypes().get( 3 ) );
+        objectClass = parser.parseObjectClassDescription( value );
+        assertEquals( 4, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "cn", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "sn", objectClass.getMayAttributeTypeOids().get( 1 ) );
+        assertEquals( "11.22.33.44.55", objectClass.getMayAttributeTypeOids().get( 2 ) );
+        assertEquals( "objectClass", objectClass.getMayAttributeTypeOids().get( 3 ) );
 
         if ( !parser.isQuirksMode() )
         {
@@ -413,7 +415,7 @@
             value = "( 1.1 MAY ( c_n ) )";
             try
             {
-                ocd = parser.parseObjectClassDescription( value );
+                objectClass = parser.parseObjectClassDescription( value );
                 fail( "Exception expected, invalid value c_n" );
             }
             catch ( ParseException pe )
@@ -443,42 +445,42 @@
      * @throws ParseException
      */
     @Test
-    public void testFull() throws ParseException
+    public void testFull() throws ParseException, NamingException
     {
         String value = null;
-        ObjectClassDescription ocd = null;
+        ObjectClass objectClass = 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 SUP ( 2.3.4.5.6.7.8.9.0.1 $ abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 ) STRUCTURAL 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 ) X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
-        ocd = parser.parseObjectClassDescription( value );
+        objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", ocd.getNumericOid() );
-        assertEquals( 2, ocd.getNames().size() );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ocd.getNames().get( 0 ) );
-        assertEquals( "test", ocd.getNames().get( 1 ) );
-        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", ocd.getDescription() );
-        assertTrue( ocd.isObsolete() );
-        assertEquals( 2, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "2.3.4.5.6.7.8.9.0.1", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ocd
-            .getSuperiorObjectClasses().get( 1 ) );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
-        assertEquals( 2, ocd.getMustAttributeTypes().size() );
-        assertEquals( "3.4.5.6.7.8.9.0.1.2", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ocd.getMustAttributeTypes()
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", objectClass.getOid() );
+        assertEquals( 2, objectClass.getNames().size() );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", objectClass.getNames().get( 0 ) );
+        assertEquals( "test", objectClass.getNames().get( 1 ) );
+        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", objectClass.getDescription() );
+        assertTrue( objectClass.isObsolete() );
+        assertEquals( 2, objectClass.getSuperiorOids().size() );
+        assertEquals( "2.3.4.5.6.7.8.9.0.1", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", objectClass
+            .getSuperiorOids().get( 1 ) );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
+        assertEquals( 2, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "3.4.5.6.7.8.9.0.1.2", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", objectClass.getMustAttributeTypeOids()
             .get( 1 ) );
-        assertEquals( 2, ocd.getMayAttributeTypes().size() );
-        assertEquals( "4.5.6.7.8.9.0.1.2.3", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", ocd.getMayAttributeTypes()
+        assertEquals( 2, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "4.5.6.7.8.9.0.1.2.3", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", objectClass.getMayAttributeTypeOids()
             .get( 1 ) );
-        assertEquals( 2, ocd.getExtensions().size() );
-        assertNotNull( ocd.getExtensions().get( "X-TEST-a" ) );
-        assertEquals( 2, ocd.getExtensions().get( "X-TEST-a" ).size() );
-        assertEquals( "test1-1", ocd.getExtensions().get( "X-TEST-a" ).get( 0 ) );
-        assertEquals( "test1-2", ocd.getExtensions().get( "X-TEST-a" ).get( 1 ) );
-        assertNotNull( ocd.getExtensions().get( "X-TEST-b" ) );
-        assertEquals( 2, ocd.getExtensions().get( "X-TEST-b" ).size() );
-        assertEquals( "test2-1", ocd.getExtensions().get( "X-TEST-b" ).get( 0 ) );
-        assertEquals( "test2-2", ocd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( 2, objectClass.getExtensions().size() );
+        assertNotNull( objectClass.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, objectClass.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", objectClass.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", objectClass.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( objectClass.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, objectClass.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", objectClass.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", objectClass.getExtensions().get( "X-TEST-b" ).get( 1 ) );
     }
 
 
@@ -505,27 +507,27 @@
      * @throws ParseException
      */
     @Test
-    public void testIgnoreElementOrder() throws ParseException
+    public void testIgnoreElementOrder() throws ParseException, NamingException
     {
         String value = "( 2.5.6.6 STRUCTURAL MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) SUP top DESC 'RFC2256: a person' MUST ( sn $ cn ) NAME 'person' )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "2.5.6.6", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "person", ocd.getNames().get( 0 ) );
-        assertEquals( "RFC2256: a person", ocd.getDescription() );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
-        assertEquals( 2, ocd.getMustAttributeTypes().size() );
-        assertEquals( "sn", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( "cn", ocd.getMustAttributeTypes().get( 1 ) );
-        assertEquals( 4, ocd.getMayAttributeTypes().size() );
-        assertEquals( "userPassword", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "telephoneNumber", ocd.getMayAttributeTypes().get( 1 ) );
-        assertEquals( "seeAlso", ocd.getMayAttributeTypes().get( 2 ) );
-        assertEquals( "description", ocd.getMayAttributeTypes().get( 3 ) );
-        assertEquals( 0, ocd.getExtensions().size() );
+        assertEquals( "2.5.6.6", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "person", objectClass.getNames().get( 0 ) );
+        assertEquals( "RFC2256: a person", objectClass.getDescription() );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
+        assertEquals( 2, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "sn", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( "cn", objectClass.getMustAttributeTypeOids().get( 1 ) );
+        assertEquals( 4, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "userPassword", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "telephoneNumber", objectClass.getMayAttributeTypeOids().get( 1 ) );
+        assertEquals( "seeAlso", objectClass.getMayAttributeTypeOids().get( 2 ) );
+        assertEquals( "description", objectClass.getMayAttributeTypeOids().get( 3 ) );
+        assertEquals( 0, objectClass.getExtensions().size() );
 
     }
 
@@ -535,231 +537,231 @@
     ////////////////////////////////////////////////////////////////
 
     @Test
-    public void testRfcTop() throws ParseException
+    public void testRfcTop() throws ParseException, NamingException
     {
         String value = "( 2.5.6.0 NAME 'top' DESC 'top of the superclass chain' ABSTRACT MUST objectClass )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "2.5.6.0", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "top", ocd.getNames().get( 0 ) );
-        assertEquals( "top of the superclass chain", ocd.getDescription() );
-        assertEquals( 0, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( ObjectClassTypeEnum.ABSTRACT, ocd.getKind() );
-        assertEquals( 1, ocd.getMustAttributeTypes().size() );
-        assertEquals( "objectClass", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( 0, ocd.getMayAttributeTypes().size() );
-        assertEquals( 0, ocd.getExtensions().size() );
+        assertEquals( "2.5.6.0", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "top", objectClass.getNames().get( 0 ) );
+        assertEquals( "top of the superclass chain", objectClass.getDescription() );
+        assertEquals( 0, objectClass.getSuperiorOids().size() );
+        assertEquals( ObjectClassTypeEnum.ABSTRACT, objectClass.getType() );
+        assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "objectClass", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( 0, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( 0, objectClass.getExtensions().size() );
     }
 
 
     @Test
-    public void testRfcPerson() throws ParseException
+    public void testRfcPerson() throws ParseException, NamingException
     {
         String value = "( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "2.5.6.6", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "person", ocd.getNames().get( 0 ) );
-        assertEquals( "RFC2256: a person", ocd.getDescription() );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
-        assertEquals( 2, ocd.getMustAttributeTypes().size() );
-        assertEquals( "sn", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( "cn", ocd.getMustAttributeTypes().get( 1 ) );
-        assertEquals( 4, ocd.getMayAttributeTypes().size() );
-        assertEquals( "userPassword", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "telephoneNumber", ocd.getMayAttributeTypes().get( 1 ) );
-        assertEquals( "seeAlso", ocd.getMayAttributeTypes().get( 2 ) );
-        assertEquals( "description", ocd.getMayAttributeTypes().get( 3 ) );
-        assertEquals( 0, ocd.getExtensions().size() );
+        assertEquals( "2.5.6.6", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "person", objectClass.getNames().get( 0 ) );
+        assertEquals( "RFC2256: a person", objectClass.getDescription() );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
+        assertEquals( 2, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "sn", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( "cn", objectClass.getMustAttributeTypeOids().get( 1 ) );
+        assertEquals( 4, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "userPassword", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "telephoneNumber", objectClass.getMayAttributeTypeOids().get( 1 ) );
+        assertEquals( "seeAlso", objectClass.getMayAttributeTypeOids().get( 2 ) );
+        assertEquals( "description", objectClass.getMayAttributeTypeOids().get( 3 ) );
+        assertEquals( 0, objectClass.getExtensions().size() );
     }
 
 
     @Test
-    public void testRfcSimpleSecurityObject() throws ParseException
+    public void testRfcSimpleSecurityObject() throws ParseException, NamingException
     {
         String value = "( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject' DESC 'RFC1274: simple security object' SUP top AUXILIARY MUST userPassword )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "0.9.2342.19200300.100.4.19", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "simpleSecurityObject", ocd.getNames().get( 0 ) );
-        assertEquals( "RFC1274: simple security object", ocd.getDescription() );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( ObjectClassTypeEnum.AUXILIARY, ocd.getKind() );
-        assertEquals( 1, ocd.getMustAttributeTypes().size() );
-        assertEquals( "userPassword", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( 0, ocd.getMayAttributeTypes().size() );
-        assertEquals( 0, ocd.getExtensions().size() );
+        assertEquals( "0.9.2342.19200300.100.4.19", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "simpleSecurityObject", objectClass.getNames().get( 0 ) );
+        assertEquals( "RFC1274: simple security object", objectClass.getDescription() );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( ObjectClassTypeEnum.AUXILIARY, objectClass.getType() );
+        assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "userPassword", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( 0, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( 0, objectClass.getExtensions().size() );
     }
 
 
     @Test
-    public void testSunAlias() throws ParseException
+    public void testSunAlias() throws ParseException, NamingException
     {
         String value = "( 2.5.6.1 NAME 'alias' DESC 'Standard LDAP objectclass' SUP top ABSTRACT MUST aliasedObjectName X-ORIGIN 'RFC 2256' )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "2.5.6.1", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "alias", ocd.getNames().get( 0 ) );
-        assertEquals( "Standard LDAP objectclass", ocd.getDescription() );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( ObjectClassTypeEnum.ABSTRACT, ocd.getKind() );
-        assertEquals( 1, ocd.getMustAttributeTypes().size() );
-        assertEquals( "aliasedObjectName", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( 0, ocd.getMayAttributeTypes().size() );
+        assertEquals( "2.5.6.1", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "alias", objectClass.getNames().get( 0 ) );
+        assertEquals( "Standard LDAP objectclass", objectClass.getDescription() );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( ObjectClassTypeEnum.ABSTRACT, objectClass.getType() );
+        assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "aliasedObjectName", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( 0, objectClass.getMayAttributeTypeOids().size() );
 
-        assertEquals( 1, ocd.getExtensions().size() );
-        assertNotNull( ocd.getExtensions().get( "X-ORIGIN" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-ORIGIN" ).size() );
-        assertEquals( "RFC 2256", ocd.getExtensions().get( "X-ORIGIN" ).get( 0 ) );
+        assertEquals( 1, objectClass.getExtensions().size() );
+        assertNotNull( objectClass.getExtensions().get( "X-ORIGIN" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-ORIGIN" ).size() );
+        assertEquals( "RFC 2256", objectClass.getExtensions().get( "X-ORIGIN" ).get( 0 ) );
     }
 
 
     @Test
-    public void testNovellDcObject() throws ParseException
+    public void testNovellDcObject() throws ParseException, NamingException
     {
         String value = "( 1.3.6.1.4.1.1466.344 NAME 'dcObject' AUXILIARY MUST dc X-NDS_NAMING 'dc' X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "1.3.6.1.4.1.1466.344", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "dcObject", ocd.getNames().get( 0 ) );
-        assertNull( ocd.getDescription() );
-        assertEquals( 0, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( ObjectClassTypeEnum.AUXILIARY, ocd.getKind() );
-        assertEquals( 1, ocd.getMustAttributeTypes().size() );
-        assertEquals( "dc", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( 0, ocd.getMayAttributeTypes().size() );
-
-        assertEquals( 3, ocd.getExtensions().size() );
-        assertNotNull( ocd.getExtensions().get( "X-NDS_NAMING" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-NDS_NAMING" ).size() );
-        assertEquals( "dc", ocd.getExtensions().get( "X-NDS_NAMING" ).get( 0 ) );
-        assertNotNull( ocd.getExtensions().get( "X-NDS_NOT_CONTAINER" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-NDS_NOT_CONTAINER" ).size() );
-        assertEquals( "1", ocd.getExtensions().get( "X-NDS_NOT_CONTAINER" ).get( 0 ) );
-        assertNotNull( ocd.getExtensions().get( "X-NDS_NONREMOVABLE" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-NDS_NONREMOVABLE" ).size() );
-        assertEquals( "1", ocd.getExtensions().get( "X-NDS_NONREMOVABLE" ).get( 0 ) );
+        assertEquals( "1.3.6.1.4.1.1466.344", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "dcObject", objectClass.getNames().get( 0 ) );
+        assertNull( objectClass.getDescription() );
+        assertEquals( 0, objectClass.getSuperiorOids().size() );
+        assertEquals( ObjectClassTypeEnum.AUXILIARY, objectClass.getType() );
+        assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "dc", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( 0, objectClass.getMayAttributeTypeOids().size() );
+
+        assertEquals( 3, objectClass.getExtensions().size() );
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_NAMING" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-NDS_NAMING" ).size() );
+        assertEquals( "dc", objectClass.getExtensions().get( "X-NDS_NAMING" ).get( 0 ) );
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_NOT_CONTAINER" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-NDS_NOT_CONTAINER" ).size() );
+        assertEquals( "1", objectClass.getExtensions().get( "X-NDS_NOT_CONTAINER" ).get( 0 ) );
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_NONREMOVABLE" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-NDS_NONREMOVABLE" ).size() );
+        assertEquals( "1", objectClass.getExtensions().get( "X-NDS_NONREMOVABLE" ).get( 0 ) );
     }
 
 
     @Test
-    public void testNovellList() throws ParseException
+    public void testNovellList() throws ParseException, NamingException
     {
         String value = "( 2.16.840.1.113719.1.1.6.1.30 NAME 'List' SUP Top STRUCTURAL MUST cn MAY ( description $ l $ member $ ou $ o $ eMailAddress $ mailboxLocation $ mailboxID $ owner $ seeAlso $ fullName ) X-NDS_NAMING 'cn' X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' ) X-NDS_NOT_CONTAINER '1' X-NDS_NONREMOVABLE '1' X-NDS_ACL_TEMPLATES '2#entry#[Root Template]#member' )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "2.16.840.1.113719.1.1.6.1.30", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "List", ocd.getNames().get( 0 ) );
-        assertNull( ocd.getDescription() );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "Top", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
-        assertEquals( 1, ocd.getMustAttributeTypes().size() );
-        assertEquals( "cn", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( 11, ocd.getMayAttributeTypes().size() );
-        assertEquals( "description", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "fullName", ocd.getMayAttributeTypes().get( 10 ) );
-
-        assertEquals( 5, ocd.getExtensions().size() );
-        assertNotNull( ocd.getExtensions().get( "X-NDS_NAMING" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-NDS_NAMING" ).size() );
-        assertEquals( "cn", ocd.getExtensions().get( "X-NDS_NAMING" ).get( 0 ) );
-
-        assertNotNull( ocd.getExtensions().get( "X-NDS_NOT_CONTAINER" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-NDS_NOT_CONTAINER" ).size() );
-        assertEquals( "1", ocd.getExtensions().get( "X-NDS_NOT_CONTAINER" ).get( 0 ) );
-
-        assertNotNull( ocd.getExtensions().get( "X-NDS_NONREMOVABLE" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-NDS_NONREMOVABLE" ).size() );
-        assertEquals( "1", ocd.getExtensions().get( "X-NDS_NONREMOVABLE" ).get( 0 ) );
+        assertEquals( "2.16.840.1.113719.1.1.6.1.30", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "List", objectClass.getNames().get( 0 ) );
+        assertNull( objectClass.getDescription() );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "Top", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
+        assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "cn", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( 11, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "description", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "fullName", objectClass.getMayAttributeTypeOids().get( 10 ) );
+
+        assertEquals( 5, objectClass.getExtensions().size() );
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_NAMING" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-NDS_NAMING" ).size() );
+        assertEquals( "cn", objectClass.getExtensions().get( "X-NDS_NAMING" ).get( 0 ) );
+
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_NOT_CONTAINER" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-NDS_NOT_CONTAINER" ).size() );
+        assertEquals( "1", objectClass.getExtensions().get( "X-NDS_NOT_CONTAINER" ).get( 0 ) );
+
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_NONREMOVABLE" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-NDS_NONREMOVABLE" ).size() );
+        assertEquals( "1", objectClass.getExtensions().get( "X-NDS_NONREMOVABLE" ).get( 0 ) );
 
         // X-NDS_CONTAINMENT ( 'Organization' 'organizationalUnit' 'domain' )
-        assertNotNull( ocd.getExtensions().get( "X-NDS_CONTAINMENT" ) );
-        assertEquals( 3, ocd.getExtensions().get( "X-NDS_CONTAINMENT" ).size() );
-        assertEquals( "Organization", ocd.getExtensions().get( "X-NDS_CONTAINMENT" ).get( 0 ) );
-        assertEquals( "organizationalUnit", ocd.getExtensions().get( "X-NDS_CONTAINMENT" ).get( 1 ) );
-        assertEquals( "domain", ocd.getExtensions().get( "X-NDS_CONTAINMENT" ).get( 2 ) );
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_CONTAINMENT" ) );
+        assertEquals( 3, objectClass.getExtensions().get( "X-NDS_CONTAINMENT" ).size() );
+        assertEquals( "Organization", objectClass.getExtensions().get( "X-NDS_CONTAINMENT" ).get( 0 ) );
+        assertEquals( "organizationalUnit", objectClass.getExtensions().get( "X-NDS_CONTAINMENT" ).get( 1 ) );
+        assertEquals( "domain", objectClass.getExtensions().get( "X-NDS_CONTAINMENT" ).get( 2 ) );
 
         // X-NDS_ACL_TEMPLATES '2#entry#[Root Template]#member'
-        assertNotNull( ocd.getExtensions().get( "X-NDS_ACL_TEMPLATES" ) );
-        assertEquals( 1, ocd.getExtensions().get( "X-NDS_ACL_TEMPLATES" ).size() );
-        assertEquals( "2#entry#[Root Template]#member", ocd.getExtensions().get( "X-NDS_ACL_TEMPLATES" ).get( 0 ) );
+        assertNotNull( objectClass.getExtensions().get( "X-NDS_ACL_TEMPLATES" ) );
+        assertEquals( 1, objectClass.getExtensions().get( "X-NDS_ACL_TEMPLATES" ).size() );
+        assertEquals( "2#entry#[Root Template]#member", objectClass.getExtensions().get( "X-NDS_ACL_TEMPLATES" ).get( 0 ) );
     }
 
 
     @Test
-    public void testMicrosoftAds2000Locality() throws ParseException
+    public void testMicrosoftAds2000Locality() throws ParseException, NamingException
     {
         String value = "( 2.5.6.3 NAME 'locality' SUP top STRUCTURAL MUST (l ) MAY (st $ street $ searchGuide $ seeAlso ) )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "2.5.6.3", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "locality", ocd.getNames().get( 0 ) );
-        assertNull( ocd.getDescription() );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
-        assertEquals( 1, ocd.getMustAttributeTypes().size() );
-        assertEquals( "l", ocd.getMustAttributeTypes().get( 0 ) );
-        assertEquals( 4, ocd.getMayAttributeTypes().size() );
-        assertEquals( "st", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "street", ocd.getMayAttributeTypes().get( 1 ) );
-        assertEquals( "searchGuide", ocd.getMayAttributeTypes().get( 2 ) );
-        assertEquals( "seeAlso", ocd.getMayAttributeTypes().get( 3 ) );
-        assertEquals( 0, ocd.getExtensions().size() );
+        assertEquals( "2.5.6.3", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "locality", objectClass.getNames().get( 0 ) );
+        assertNull( objectClass.getDescription() );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
+        assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( "l", objectClass.getMustAttributeTypeOids().get( 0 ) );
+        assertEquals( 4, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "st", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "street", objectClass.getMayAttributeTypeOids().get( 1 ) );
+        assertEquals( "searchGuide", objectClass.getMayAttributeTypeOids().get( 2 ) );
+        assertEquals( "seeAlso", objectClass.getMayAttributeTypeOids().get( 3 ) );
+        assertEquals( 0, objectClass.getExtensions().size() );
     }
 
 
     @Test
-    public void testMicrosoftAds2003Msieee() throws ParseException
+    public void testMicrosoftAds2003Msieee() throws ParseException, NamingException
     {
         String value = "( 1.2.840.113556.1.5.240 NAME 'msieee80211-Policy' SUP top STRUCTURAL MAY (msieee80211-Data $ msieee80211-DataType $ msieee80211-ID ) )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "1.2.840.113556.1.5.240", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "msieee80211-Policy", ocd.getNames().get( 0 ) );
-        assertNull( ocd.getDescription() );
-        assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( "top", ocd.getSuperiorObjectClasses().get( 0 ) );
-        assertEquals( ObjectClassTypeEnum.STRUCTURAL, ocd.getKind() );
-        assertEquals( 0, ocd.getMustAttributeTypes().size() );
-        assertEquals( 3, ocd.getMayAttributeTypes().size() );
-        assertEquals( "msieee80211-Data", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "msieee80211-DataType", ocd.getMayAttributeTypes().get( 1 ) );
-        assertEquals( "msieee80211-ID", ocd.getMayAttributeTypes().get( 2 ) );
-        assertEquals( 0, ocd.getExtensions().size() );
+        assertEquals( "1.2.840.113556.1.5.240", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "msieee80211-Policy", objectClass.getNames().get( 0 ) );
+        assertNull( objectClass.getDescription() );
+        assertEquals( 1, objectClass.getSuperiorOids().size() );
+        assertEquals( "top", objectClass.getSuperiorOids().get( 0 ) );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
+        assertEquals( 0, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( 3, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "msieee80211-Data", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "msieee80211-DataType", objectClass.getMayAttributeTypeOids().get( 1 ) );
+        assertEquals( "msieee80211-ID", objectClass.getMayAttributeTypeOids().get( 2 ) );
+        assertEquals( 0, objectClass.getExtensions().size() );
     }
 
 
     @Test
-    public void testSiemensDirxX500Subschema() throws ParseException
+    public void testSiemensDirxX500Subschema() throws ParseException, NamingException
     {
         String value = "( 2.5.20.1 NAME 'x500subSchema' AUXILIARY MAY (dITStructureRules $ nameForms $ dITContentRules $ x500objectClasses $ x500attributeTypes $ matchingRules $ matchingRuleUse) )";
-        ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
+        ObjectClass objectClass = parser.parseObjectClassDescription( value );
 
-        assertEquals( "2.5.20.1", ocd.getNumericOid() );
-        assertEquals( 1, ocd.getNames().size() );
-        assertEquals( "x500subSchema", ocd.getNames().get( 0 ) );
-        assertNull( ocd.getDescription() );
-        assertEquals( 0, ocd.getSuperiorObjectClasses().size() );
-        assertEquals( ObjectClassTypeEnum.AUXILIARY, ocd.getKind() );
-        assertEquals( 0, ocd.getMustAttributeTypes().size() );
-        assertEquals( 7, ocd.getMayAttributeTypes().size() );
-        assertEquals( "dITStructureRules", ocd.getMayAttributeTypes().get( 0 ) );
-        assertEquals( "matchingRuleUse", ocd.getMayAttributeTypes().get( 6 ) );
-        assertEquals( 0, ocd.getExtensions().size() );
+        assertEquals( "2.5.20.1", objectClass.getOid() );
+        assertEquals( 1, objectClass.getNames().size() );
+        assertEquals( "x500subSchema", objectClass.getNames().get( 0 ) );
+        assertNull( objectClass.getDescription() );
+        assertEquals( 0, objectClass.getSuperiorOids().size() );
+        assertEquals( ObjectClassTypeEnum.AUXILIARY, objectClass.getType() );
+        assertEquals( 0, objectClass.getMustAttributeTypeOids().size() );
+        assertEquals( 7, objectClass.getMayAttributeTypeOids().size() );
+        assertEquals( "dITStructureRules", objectClass.getMayAttributeTypeOids().get( 0 ) );
+        assertEquals( "matchingRuleUse", objectClass.getMayAttributeTypeOids().get( 6 ) );
+        assertEquals( 0, objectClass.getExtensions().size() );
     }
 
 
@@ -783,14 +785,14 @@
      * Tests quirks mode.
      */
     @Test
-    public void testQuirksMode() throws ParseException
+    public void testQuirksMode() throws ParseException, NamingException
     {
         SchemaParserTestUtils.testQuirksMode( parser, "" );
 
         try
         {
             String value = null;
-            ObjectClassDescription ocd = null;
+            ObjectClass objectClass = null;
 
             parser.setQuirksMode( true );
 
@@ -819,34 +821,34 @@
 
             // NAME with special chars
             value = "( 1.2.3 NAME 't-e_s.t;' )";
-            ocd = parser.parseObjectClassDescription( value );
-            assertEquals( 1, ocd.getNames().size() );
-            assertEquals( "t-e_s.t;", ocd.getNames().get( 0 ) );
+            objectClass = parser.parseObjectClassDescription( value );
+            assertEquals( 1, objectClass.getNames().size() );
+            assertEquals( "t-e_s.t;", objectClass.getNames().get( 0 ) );
 
             // SUP with underscore
             value = "( 1.1 SUP te_st )";
-            ocd = parser.parseObjectClassDescription( value );
-            assertEquals( 1, ocd.getSuperiorObjectClasses().size() );
-            assertEquals( "te_st", ocd.getSuperiorObjectClasses().get( 0 ) );
+            objectClass = parser.parseObjectClassDescription( value );
+            assertEquals( 1, objectClass.getSuperiorOids().size() );
+            assertEquals( "te_st", objectClass.getSuperiorOids().get( 0 ) );
 
             // MAY with underscore
             value = "( 1.1 MAY te_st )";
-            ocd = parser.parseObjectClassDescription( value );
-            assertEquals( 1, ocd.getMayAttributeTypes().size() );
-            assertEquals( "te_st", ocd.getMayAttributeTypes().get( 0 ) );
+            objectClass = parser.parseObjectClassDescription( value );
+            assertEquals( 1, objectClass.getMayAttributeTypeOids().size() );
+            assertEquals( "te_st", objectClass.getMayAttributeTypeOids().get( 0 ) );
 
             // MUST with underscore
             value = "( 1.1 MUST te_st )";
-            ocd = parser.parseObjectClassDescription( value );
-            assertEquals( 1, ocd.getMustAttributeTypes().size() );
-            assertEquals( "te_st", ocd.getMustAttributeTypes().get( 0 ) );
+            objectClass = parser.parseObjectClassDescription( value );
+            assertEquals( 1, objectClass.getMustAttributeTypeOids().size() );
+            assertEquals( "te_st", objectClass.getMustAttributeTypeOids().get( 0 ) );
 
             // Netscape object class 
             value = "( nsAdminGroup-oid NAME 'nsAdminGroup' DESC 'Netscape defined objectclass' SUP top STRUCTURAL MUST cn MAY ( nsAdminGroupName $ description $ nsConfigRoot $ nsAdminSIEDN ) X-ORIGIN 'Netscape' )";
-            ocd = parser.parseObjectClassDescription( value );
-            assertEquals( "nsAdminGroup-oid", ocd.getNumericOid() );
-            assertEquals( 1, ocd.getNames().size() );
-            assertEquals( "nsAdminGroup", ocd.getNames().get( 0 ) );
+            objectClass = parser.parseObjectClassDescription( value );
+            assertEquals( "nsAdminGroup-oid", objectClass.getOid() );
+            assertEquals( 1, objectClass.getNames().size() );
+            assertEquals( "nsAdminGroup", objectClass.getNames().get( 0 ) );
         }
         finally
         {



Mime
View raw message