directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r437188 - in /directory/trunks/apacheds: core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Date Sat, 26 Aug 2006 17:25:28 GMT
Author: akarasulu
Date: Sat Aug 26 10:25:28 2006
New Revision: 437188

URL: http://svn.apache.org/viewvc?rev=437188&view=rev
Log:
Fix for DIRSERVER-717: RFC2713 integration test fails

Modified:
    directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java

Modified: directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java?rev=437188&r1=437187&r2=437188&view=diff
==============================================================================
--- directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java
(original)
+++ directory/trunks/apacheds/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java
Sat Aug 26 10:25:28 2006
@@ -39,7 +39,6 @@
 {
     public void testSerialization() throws Exception
     {
-        /*
         ArrayList colors = new ArrayList();
         colors.add( "red" );
         colors.add( "white" );
@@ -71,6 +70,5 @@
         attr = attrs.get( "javaSerializedData" );
         assertNotNull( attr );
         assertEquals( 1, attr.size() );
-        */
     }
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=437188&r1=437187&r2=437188&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Sat Aug 26 10:25:28 2006
@@ -299,20 +299,7 @@
     {
         Attributes attributes = new LockableAttributesImpl();
         LdapDN target = buildTarget( name );
-
-        Rdn rdn = target.getRdn( target.size() - 1 );
-        if ( rdn.size() == 1 )
-        {
-            attributes.put( rdn.getType(), rdn.getValue() );
-        }
-        else
-        {
-            for ( Iterator ii = rdn.iterator(); ii.hasNext(); /**/ )
-            {
-                AttributeTypeAndValue atav = ( AttributeTypeAndValue ) ii.next();
-                attributes.put( atav.getType(), atav.getValue() );
-            }
-        }
+        injectRdnAttributeValues( target, attributes );
         
         attributes.put( JavaLdapSupport.OBJECTCLASS_ATTR, JavaLdapSupport.JCONTAINER_ATTR
);
         attributes.put( JavaLdapSupport.OBJECTCLASS_ATTR, JavaLdapSupport.TOP_ATTR );
@@ -361,7 +348,26 @@
         bind( new LdapDN( name ), obj );
     }
 
+    
+    private void injectRdnAttributeValues( LdapDN target, Attributes attributes ) throws
NamingException
+    {
+        // Add all the RDN attributes and their values to this entry
+        Rdn rdn = target.getRdn( target.size() - 1 );
+        if ( rdn.size() == 1 )
+        {
+            attributes.put( rdn.getType(), rdn.getValue() );
+        }
+        else
+        {
+            for ( Iterator ii = rdn.iterator(); ii.hasNext(); /**/ )
+            {
+                AttributeTypeAndValue atav = ( AttributeTypeAndValue ) ii.next();
+                attributes.put( atav.getType(), atav.getValue() );
+            }
+        }
+    }
 
+    
     /**
      * @see javax.naming.Context#bind(javax.naming.Name, java.lang.Object)
      */
@@ -403,7 +409,9 @@
                 }
             }
 
+            // Get target and inject all rdn attributes into entry
             LdapDN target = buildTarget( name );
+            injectRdnAttributeValues( target, attributes );
 
             // Serialize object into entry attributes and add it.
             JavaLdapSupport.serialize( attributes, obj );
@@ -423,6 +431,7 @@
             }
 
             LdapDN target = buildTarget( name );
+            injectRdnAttributeValues( target, attributes );
             nexusProxy.add( target, attributes );
         }
         else



Mime
View raw message