directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r514796 - /directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/AddITest.java
Date Mon, 05 Mar 2007 18:40:12 GMT
Author: elecharny
Date: Mon Mar  5 10:40:12 2007
New Revision: 514796

URL: http://svn.apache.org/viewvc?view=rev&rev=514796
Log:
Added a test to check the modification done in Rdn

Modified:
    directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/AddITest.java

Modified: directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/AddITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/AddITest.java?view=diff&rev=514796&r1=514795&r2=514796
==============================================================================
--- directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/AddITest.java
(original)
+++ directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/AddITest.java
Mon Mar  5 10:40:12 2007
@@ -40,6 +40,7 @@
 import org.apache.directory.server.unit.AbstractServerTest;
 import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
 import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
+import org.xml.sax.helpers.AttributesImpl;
 
 import java.util.Hashtable;
 
@@ -547,4 +548,49 @@
         con.disconnect();
     }
     
+    /**
+     * Test that attribute name case is preserved after adding an entry
+     * in the case the user added them.  This is to test DIRSERVER-832.
+     */
+    public void testAddCasePreservedOnAttributeNames() throws Exception
+    {
+        Attributes attrs = new LockableAttributesImpl( true );
+        Attribute oc = new LockableAttributeImpl( "ObjectClass", "top" );
+        oc.add( "PERSON" );
+        oc.add( "organizationalPerson" );
+        oc.add( "inetORGperson" );
+        Attribute cn = new LockableAttributeImpl( "Cn", "Kevin Spacey" );
+        Attribute dc = new LockableAttributeImpl( "sN", "Spacey" );
+        attrs.put( oc );
+        attrs.put( cn );
+        attrs.put( dc);
+        sysRoot.createSubcontext( "uID=kevin", attrs );
+        Attributes returned = sysRoot.getAttributes( "UID=kevin" );
+        
+        NamingEnumeration attrList = returned.getAll();
+        while( attrList.hasMore() )
+        {
+            Attribute attr = ( Attribute ) attrList.next();
+            
+            if ( attr.getID().equalsIgnoreCase( "uid" ) )
+            {
+                assertEquals( "uID", attr.getID() );
+            }
+            
+            if ( attr.getID().equalsIgnoreCase( "objectClass" ) )
+            {
+                assertEquals( "ObjectClass", attr.getID() );
+            }
+            
+            if ( attr.getID().equalsIgnoreCase( "sn" ) )
+            {
+                assertEquals( "sN", attr.getID() );
+            }
+            
+            if ( attr.getID().equalsIgnoreCase( "cn" ) )
+            {
+                assertEquals( "Cn", attr.getID() );
+            }
+        }
+    }
 }



Mime
View raw message