directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1029076 - in /directory/shared/trunk: ./ all/ i18n/ ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/ ldap-jndi/ ldap/ ldap/src/main/java/org/apache/directory/shared/converter/schema/ ldap/src/main/java/org/apache/directo...
Date Sat, 30 Oct 2010 14:07:50 GMT
Author: elecharny
Date: Sat Oct 30 14:07:50 2010
New Revision: 1029076

URL: http://svn.apache.org/viewvc?rev=1029076&view=rev
Log:
Merged back the config branch into trunk

Modified:
    directory/shared/trunk/   (props changed)
    directory/shared/trunk/all/   (props changed)
    directory/shared/trunk/i18n/   (props changed)
    directory/shared/trunk/ldap/   (props changed)
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/Krb5LoginConfiguration.java
  (props changed)
    directory/shared/trunk/ldap-jndi/   (props changed)
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElement.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/constants/MetaSchemaConstants.java
  (props changed)
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java

Propchange: directory/shared/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:07:50 2010
@@ -1,4 +1,5 @@
 /directory/shared/branches/shared-codec-merge:982370-987558
+/directory/shared/branches/shared-config:1023444-1029061
 /directory/shared/branches/shared-replication:749791-764113
 /directory/shared/branches/shared-schema:806622-896441
 /directory/shared/branches/shared-subtree:965208-965686

Propchange: directory/shared/trunk/all/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:07:50 2010
@@ -1,3 +1,4 @@
 /directory/shared/branches/shared-codec-merge/all:982370-987558
+/directory/shared/branches/shared-config/all:1023444-1029061
 /directory/shared/branches/shared-dnfactory-experiment/all:980352-980933
 /directory/shared/branches-dnfactory-experiment/all:980350-980351

Propchange: directory/shared/trunk/i18n/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:07:50 2010
@@ -1,3 +1,4 @@
 /directory/shared/branches/shared-codec-merge/i18n:982370-987558
+/directory/shared/branches/shared-config/i18n:1023444-1029061
 /directory/shared/branches/shared-dnfactory-experiment/i18n:980352-980933
 /directory/shared/branches-dnfactory-experiment/i18n:980350-980351

Propchange: directory/shared/trunk/ldap/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:07:50 2010
@@ -1,3 +1,4 @@
 /directory/shared/branches/shared-codec-merge/ldap:982370-987558
+/directory/shared/branches/shared-config/ldap:1023444-1029061
 /directory/shared/branches/shared-dnfactory-experiment/ldap:980352-980933
 /directory/shared/branches-dnfactory-experiment/ldap:980350-980351

Propchange: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/Krb5LoginConfiguration.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:07:50 2010
@@ -1,2 +1,3 @@
 /directory/apacheds/branches/apacheds-codec-merge/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/jaas/Krb5LoginConfiguration.java:982369-987590
 /directory/apacheds/branches/apacheds-dnfactory-experiment/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/jaas/Krb5LoginConfiguration.java:980138-980936
+/directory/shared/branches/shared-config/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/Krb5LoginConfiguration.java:1023444-1029061

Propchange: directory/shared/trunk/ldap-jndi/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:07:50 2010
@@ -1,3 +1,4 @@
 /directory/shared/branches/shared-codec-merge/ldap-jndi:982370-987558
+/directory/shared/branches/shared-config/ldap-jndi:1023444-1029061
 /directory/shared/branches/shared-dnfactory-experiment/ldap-jndi:980352-980933
 /directory/shared/branches-dnfactory-experiment/ldap-jndi:980350-980351

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElement.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElement.java?rev=1029076&r1=1029075&r2=1029076&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElement.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElement.java
Sat Oct 30 14:07:50 2010
@@ -21,6 +21,7 @@ package org.apache.directory.shared.conv
 
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.directory.shared.ldap.exception.LdapException;
 
@@ -84,14 +85,21 @@ public interface SchemaElement
     /**
      * @return The list of extensions for the schemaElement
      */
-    List<String> getExtensions();
+    Map<String, List<String>> getExtensions();
+
+
+    /**
+     * @param key the Extension key
+     * @return The list of a values for a given extension
+     */
+    List<String> getExtension( String key );
 
 
     /**
      * Set a list of extensions for a schemaElement
      * @param extensions The list of extensions of this schemaElement
      */
-    void setExtensions( List<String> extensions );
+    void setExtensions( Map<String, List<String>> extensions );
 
 
     /**

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java?rev=1029076&r1=1029075&r2=1029076&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/converter/schema/SchemaElementImpl.java
Sat Oct 30 14:07:50 2010
@@ -21,7 +21,9 @@ package org.apache.directory.shared.conv
 
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
@@ -54,7 +56,7 @@ public abstract class SchemaElementImpl 
     protected boolean obsolete = false;
 
     /** The optional list of extensions */
-    protected List<String> extensions = new ArrayList<String>();
+    protected Map<String, List<String>> extensions = new HashMap<String, List<String>>();
 
 
     /**
@@ -123,7 +125,16 @@ public abstract class SchemaElementImpl 
     /**
      * {@inheritDoc}
      */
-    public List<String> getExtensions()
+    public List<String> getExtension( String key)
+    {
+        return extensions.get( key );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Map<String, List<String>> getExtensions()
     {
         return extensions;
     }
@@ -132,7 +143,7 @@ public abstract class SchemaElementImpl 
     /**
      * {@inheritDoc}
      */
-    public void setExtensions( List<String> extensions )
+    public void setExtensions( Map<String, List<String>> extensions )
     {
         this.extensions = extensions;
     }
@@ -221,7 +232,7 @@ public abstract class SchemaElementImpl 
         Entry entry = new DefaultEntry();
         EntryAttribute attribute = new DefaultEntryAttribute( id );
 
-        for ( String extension : extensions )
+        for ( String extension : extensions.keySet() )
         {
             attribute.add( extension );
         }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/constants/MetaSchemaConstants.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:07:50 2010
@@ -1,5 +1,6 @@
 /directory/apacheds/branches/apacheds-replication/core-constants/src/main/java/org/apache/directory/server/constants/MetaSchemaConstants.java:749790-764110
 /directory/shared/branches/shared-codec-merge/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/MetaSchemaConstants.java:982370-987558
+/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/ldap/constants/MetaSchemaConstants.java:1023444-1029061
 /directory/shared/branches/shared-dnfactory-experiment/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/MetaSchemaConstants.java:980352-980933
 /directory/shared/branches/shared-subtree/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/MetaSchemaConstants.java:965208-965686
 /directory/shared/branches/xdbm-refactoring/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/MetaSchemaConstants.java:945830-946347

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java?rev=1029076&r1=1029075&r2=1029076&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/entry/BinaryValueAttributeTypeTest.java
Sat Oct 30 14:07:50 2010
@@ -36,8 +36,6 @@ import java.util.Arrays;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.shared.ldap.entry.BinaryValue;
-import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapSyntax;

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java?rev=1029076&r1=1029075&r2=1029076&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
Sat Oct 30 14:07:50 2010
@@ -20,6 +20,11 @@
 package org.apache.directory.shared.ldap.schema.parser;
 
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.List;
@@ -37,11 +42,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
 
 /**
  * Tests the OpenLDAP schema parser.
@@ -201,6 +201,51 @@ public class OpenLdapSchemaParserTest
     }
 
 
+
+
+    @Test
+    public void testObjectClassWithExtensionsParse() 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 ) \n"
+            + "        X-extension 'test' X-otherExtension ( 'test1' 'test2' ) )";
+        parser.parse( objectClassData );
+        List<ObjectClass> objectClassesList = parser.getObjectClassTypes();
+        Map<String, ObjectClass> objectClasses = mapObjectClasses( objectClassesList
);
+        ObjectClass objectClass = objectClasses.get( "2.5.6.6" );
+
+        assertNotNull( objectClass );
+        assertEquals( "2.5.6.6", objectClass.getOid() );
+        assertEquals( "person", objectClass.getName() );
+        assertEquals( "RFC2256: a person", objectClass.getDescription() );
+        assertEquals( ObjectClassTypeEnum.STRUCTURAL, objectClass.getType() );
+        assertEquals( "sn", objectClass.getMustAttributeTypeOids().get(0) );
+        assertEquals( "cn", objectClass.getMustAttributeTypeOids().get(1) );
+        assertEquals( "userPassword", objectClass.getMayAttributeTypeOids().get(0) );
+        assertEquals( "telephoneNumber", objectClass.getMayAttributeTypeOids().get(1) );
+        assertEquals( "seeAlso", objectClass.getMayAttributeTypeOids().get(2) );
+        assertEquals( "description", objectClass.getMayAttributeTypeOids().get(3) );
+        Map<String, List<String>> extensions = objectClass.getExtensions();
+
+        assertNotNull( extensions );
+        
+        List<String> ext1 = extensions.get( "X-extension" );
+        assertNotNull( ext1 );
+        assertEquals( 1, ext1.size() );
+        assertTrue( ext1.contains( "test" ) );
+        
+        List<String> ext2 = extensions.get( "X-otherExtension" );
+        assertNotNull( ext2 );
+        assertEquals( 2, ext2.size() );
+        assertTrue( ext2.contains( "test1" ) );
+        assertTrue( ext2.contains( "test2" ) );
+        
+    }
+
+    
     @Test
     public void testObjectClassMultipleNames() throws Exception
     {

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java?rev=1029076&r1=1029075&r2=1029076&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/SchemaParserTestUtils.java
Sat Oct 30 14:07:50 2010
@@ -20,15 +20,15 @@
 package org.apache.directory.shared.ldap.schema.syntax.parser;
 
 
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.List;
-
-import static junit.framework.Assert.fail;
 import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.fail;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.shared.ldap.schema.parsers.AbstractSchemaParser;



Mime
View raw message