directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r643345 - /directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java
Date Tue, 01 Apr 2008 10:00:01 GMT
Author: elecharny
Date: Tue Apr  1 02:59:47 2008
New Revision: 643345

URL: http://svn.apache.org/viewvc?rev=643345&view=rev
Log:
Uncommented the DIRSERVER_832 test case, as it's now working.

Modified:
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java?rev=643345&r1=643344&r2=643345&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/AddIT.java
Tue Apr  1 02:59:47 2008
@@ -29,9 +29,11 @@
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.Assert.assertEquals;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapContext;
@@ -49,51 +51,54 @@
     public static DirectoryService service;
     
 
-//    /**
-//     * 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 AttributesImpl( true );
-//        Attribute oc = new AttributeImpl( "ObjectClass", "top" );
-//        oc.add( "PERSON" );
-//        oc.add( "organizationalPerson" );
-//        oc.add( "inetORGperson" );
-//        Attribute cn = new AttributeImpl( "Cn", "Kevin Spacey" );
-//        Attribute dc = new AttributeImpl( "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() );
-//            }
-//        }
-//    }
+    /**
+     * 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
+    {
+        LdapContext sysRoot = getSystemContext( service );
+
+        Attributes attrs = new AttributesImpl( true );
+        Attribute oc = new AttributeImpl( "ObjectClass", "top" );
+        oc.add( "PERSON" );
+        oc.add( "organizationalPerson" );
+        oc.add( "inetORGperson" );
+        Attribute cn = new AttributeImpl( "Cn", "Kevin Spacey" );
+        Attribute dc = new AttributeImpl( "sN", "Spacey" );
+        attrs.put( oc );
+        attrs.put( cn );
+        attrs.put( dc);
+        sysRoot.createSubcontext( "uID=kevin", attrs );
+        Attributes returned = sysRoot.getAttributes( "UID=kevin" );
+        
+        NamingEnumeration<? extends Attribute> 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