directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r514718 - /directory/apacheds/branches/1.0/server-unit/src/test/java/org/apache/directory/server/AddITest.java
Date Mon, 05 Mar 2007 16:14:59 GMT
Author: elecharny
Date: Mon Mar  5 08:14:53 2007
New Revision: 514718

URL: http://svn.apache.org/viewvc?view=rev&rev=514718
Log:
Added a testcase to demonstrate DIRSERVER-865.
The server seems to accept an add request built from the sample,
so some more investigation should be done with the ldif file.

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=514718&r1=514717&r2=514718
==============================================================================
--- 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 08:14:53 2007
@@ -81,6 +81,7 @@
         attributes.put( "cn", "The Person" );
         attributes.put( "sn", "Person" );
         attributes.put( "description", "this is a person" );
+        attributes.put(  "administrativeRole", "subschemaAdminSpecificArea" );
         DirContext person = ctx.createSubcontext( RDN, attributes );
 
         assertNotNull( person );
@@ -485,4 +486,65 @@
         // Remove container
         ctx.destroySubcontext( containerRdn );
     }
+
+    /**
+     * Testcase to demonstrate DIRSERVER-643 ("Netscape SDK: Adding an entry with
+     * two description attributes does not combine values."). Uses Sun ONE Directory
+     * SDK for Java 4.1 , or comparable (Netscape, Mozilla).
+     */
+    public void testAddEntryWithACIAndTabs() throws LDAPException
+    {
+        LDAPConnection con = new LDAPConnection();
+        con.connect( 3, HOST, super.port, USER, PASSWORD );
+        LDAPAttributeSet attrs = new LDAPAttributeSet();
+        LDAPAttribute ocls = new LDAPAttribute( "objectclass", new String[]
+            { "top", "subentry", "accessControlSubentry" } );
+        attrs.add( ocls );
+        attrs.add( new LDAPAttribute( "subtreeSpecification", "{}" ) );
+        attrs.add( new LDAPAttribute( "prescriptiveACI", 
+            "{" +
+            "   identificationTag \"allowJohnToReadHisName_ACI13\", \n" +
+            "   precedence 10, \n" + 
+            "   authenticationLevel simple,\n" +
+            "   itemOrUserFirst userFirst: \n" +
+            "   {\n" +
+            "       userClasses\n" + 
+            "       {\n" +
+            "           name { \"cn=John,cn=The Person, ou=systemm\" }\n" +
+            "       },\n" +
+            "       userPermissions \n" +
+            "       {\n" +
+            "           { \n" +
+            "               protectedItems { entry },\n" +
+            "               grantsAndDenials { grantBrowse }\n" +
+            "           },\n" +
+            "           { \n" +
+            "               protectedItems\n" +
+            "               {\n" +
+            "                   attributeType { cn },\n" +
+            "                   allAttributeValues { cn }\n" +
+            "               },\n" +
+            "               grantsAndDenials { grantRead }\n" +
+            "           }\n" +
+            "       }\n" +
+            "   }\n" +
+            "}" ) );
+        
+        attrs.add( new LDAPAttribute( "cn", "allowJohnToReadHisName_ACI13" ) );
+
+        String dn = "cn=allowJohnToReadHisName_ACI13,cn=The person," + BASE;
+
+        LDAPEntry entry = new LDAPEntry( dn, attrs );
+
+        con.add( entry );
+
+        // Analyze entry and description attribute
+        LDAPEntry entryReloaded = con.read( dn );
+        assertNotNull( entryReloaded );
+
+        // Remove entry
+        con.delete( dn );
+        con.disconnect();
+    }
+    
 }



Mime
View raw message