You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/06/14 12:54:42 UTC

svn commit: r1135475 - in /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations: add/AddAliasIT.java add/AddIT.java delete/DeleteAliasIT.java

Author: elecharny
Date: Tue Jun 14 10:54:42 2011
New Revision: 1135475

URL: http://svn.apache.org/viewvc?rev=1135475&view=rev
Log:
o Added a test to demonstrate that we can create a cycle on aliases
o Activated the test_DIRSERVER_1357() test
o Minor typo fix

Added:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java
Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteAliasIT.java

Added: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java?rev=1135475&view=auto
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java (added)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java Tue Jun 14 10:54:42 2011
@@ -0,0 +1,78 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.server.operations.add;
+
+
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getClientApiConnection;
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.CreateDS;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Integration tests for add operations on Alias.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith(FrameworkRunner.class)
+@CreateDS( 
+    enableChangeLog = false,
+    name = "DSAddAlias" )
+@CreateLdapServer(transports =
+    { @CreateTransport(protocol = "LDAP") })
+public class AddAliasIT extends AbstractLdapTestUnit
+{
+    private LdapConnection conn;
+
+    @Test
+    public void testAddAliasOnParent() throws Exception
+    {
+        conn = getClientApiConnection( getLdapServer() );
+        conn.setTimeOut( -1L );
+        
+        conn.add( new DefaultEntry( 
+            "cn=foo,ou=system", 
+            "objectClass: person",
+            "objectClass: top",
+            "cn: foo",
+            "sn: Foo" ) );
+
+        assertNotNull( conn.lookup( "cn=foo,ou=system" ) );
+
+        conn.add( new DefaultEntry( 
+            "ou=alias,cn=foo,ou=system", 
+            "objectClass: top",
+            "objectClass: extensibleObject",
+            "objectClass: alias",
+            "ou: alias" ,
+            "aliasedObjectName: cn=foo,ou=system",
+            "description: alias to father (branch)" ) );
+
+        assertNotNull( conn.lookup( "ou=alias,cn=foo,ou=system" ) );
+    }
+}

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=1135475&r1=1135474&r2=1135475&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java Tue Jun 14 10:54:42 2011
@@ -97,7 +97,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Strings;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -1351,7 +1350,11 @@ public class AddIT extends AbstractLdapT
      * @throws NamingException 
      */
     @Test
-    @Ignore
+    @CreateDS( 
+        enableChangeLog = false,
+        name = "DSAlias" )
+    @CreateLdapServer(transports =
+        { @CreateTransport(protocol = "LDAP") })
     public void test_DIRSERVER_1357() throws Exception
     {
         DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( getLdapServer() ).lookup( "ou=system" );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteAliasIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteAliasIT.java?rev=1135475&r1=1135474&r2=1135475&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteAliasIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteAliasIT.java Tue Jun 14 10:54:42 2011
@@ -44,7 +44,7 @@ import org.junit.runner.RunWith;
 @RunWith(FrameworkRunner.class)
 @CreateDS( 
     enableChangeLog = false,
-    name = "MethodDSWithPartitionAndServer" )
+    name = "DSDeleteAlias" )
 @CreateLdapServer(transports =
     { @CreateTransport(protocol = "LDAP") })
 public class DeleteAliasIT extends AbstractLdapTestUnit