directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 54225 - in incubator/directory/eve/trunk/backend/tools/src: antlr test/org/apache/eve/tools/schema
Date Sun, 10 Oct 2004 07:56:49 GMT
Author: akarasulu
Date: Sun Oct 10 00:56:48 2004
New Revision: 54225

Modified:
   incubator/directory/eve/trunk/backend/tools/src/antlr/openldap.g
   incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/OpenLdapSchemaParserTest.java
Log:
Commit changes ...

 o added first test for object classes which revieled bugs below that were fixed
 o added extra closing paren to top level objectClass production
 o added code to top level objectClass production to put() objs into map



Modified: incubator/directory/eve/trunk/backend/tools/src/antlr/openldap.g
==============================================================================
--- incubator/directory/eve/trunk/backend/tools/src/antlr/openldap.g	(original)
+++ incubator/directory/eve/trunk/backend/tools/src/antlr/openldap.g	Sun Oct 10 00:56:48 2004
@@ -197,6 +197,10 @@
     )?
     ( must[objectClass] )?
     ( may[objectClass] )?
+    CLOSE_PAREN
+    {
+        objectClasses.put( objectClass.getOid(), objectClass );
+    }
     ;
 
 

Modified: incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/OpenLdapSchemaParserTest.java
==============================================================================
--- incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/OpenLdapSchemaParserTest.java
(original)
+++ incubator/directory/eve/trunk/backend/tools/src/test/org/apache/eve/tools/schema/OpenLdapSchemaParserTest.java
Sun Oct 10 00:56:48 2004
@@ -93,4 +93,19 @@
         assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", type.getSyntax() );
         assertEquals( 32768, type.getLength() );
     }
+
+
+    public void testSimpleObjectClass() throws Exception
+    {
+        String objectClassData = "objectclass ( 2.5.6.6 NAME 'person'\n" +
+            "        DESC 'RFC2256: a person'\n" +
+            "        SUP top STRUCTURAL\n" +
+            "        MUST ( sn $ cn )\n" +
+            "        MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )";
+        parser.parse( objectClassData );
+        Map objectClasses = parser.getObjectClassTypes();
+        ObjectClassLiteral objectClass = ( ObjectClassLiteral ) objectClasses.get( "2.5.6.6"
);
+
+        assertNotNull( objectClass );
+    }
 }

Mime
View raw message