directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1334639 [1/5] - in /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server: operations/add/ operations/bind/ operations/compare/ operations/delete/ operations/extended/ operations/ldapsdk/ operations/lookup/ operat...
Date Sun, 06 May 2012 14:25:20 GMT
Author: elecharny
Date: Sun May  6 14:25:18 2012
New Revision: 1334639

URL: http://svn.apache.org/viewvc?rev=1334639&view=rev
Log:
Made all the server-integ tests thread safe

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/MatchingRuleCompareIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteAliasIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/ExtendedIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/AddIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/CompareIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/DeleteIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/IllegalModificationIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyDnReferralIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyReferralIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyAddIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyMultipleChangesIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReferralIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyRemoveIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyDnReferralIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchNoRevertIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java

Modified: 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=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java Sun May  6 14:25:18 2012
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertNul
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -35,6 +36,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.model.cursor.EntryCursor;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.message.SearchScope;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -52,6 +54,8 @@ import org.junit.runner.RunWith;
     { @CreateTransport(protocol = "LDAP") })
 public class AddAliasIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private LdapConnection conn;
 
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java Sun May  6 14:25:18 2012
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -38,6 +39,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.message.SearchScope;
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import static org.apache.directory.server.integ.ServerIntegrationUtils.getAdminConnection;
@@ -54,6 +56,8 @@ import static org.apache.directory.serve
     { @CreateTransport(protocol = "LDAP") })
 public class AddingEntriesWithSpecialCharactersInRDNIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private Entry getPersonEntry( String sn, String cn ) throws LdapException
     {
         Entry entry = new DefaultEntry();

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/DelegatedAuthIT.java Sun May  6 14:25:18 2012
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -38,6 +39,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -67,6 +69,8 @@ import org.junit.runner.RunWith;
     })
 public class DelegatedAuthIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
 
     /**
      * Test with bindDn which is not even found under any namingContext of the

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java Sun May  6 14:25:18 2012
@@ -34,6 +34,7 @@ import javax.naming.directory.SearchCont
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.exception.InvalidConnectionException;
@@ -51,6 +52,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaITImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -93,11 +95,14 @@ import org.slf4j.LoggerFactory;
         "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" })
 public class CompareIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+
     private static final Logger LOG = LoggerFactory.getLogger( CompareIT.class );
 
 
     /**
-     * Tests normal compare operation on normal non-referral entries without 
+     * Tests normal compare operation on normal non-referral entries without
      * the ManageDsaIT control.
      */
     @Test
@@ -119,7 +124,7 @@ public class CompareIT extends AbstractL
 
 
     /**
-     * Tests normal compare operation on normal non-referral entries without 
+     * Tests normal compare operation on normal non-referral entries without
      * the ManageDsaIT control using an attribute that does not exist in the
      * entry.
      */
@@ -174,7 +179,7 @@ public class CompareIT extends AbstractL
 
 
     /**
-     * Tests compare operation on normal and referral entries without the 
+     * Tests compare operation on normal and referral entries without the
      * ManageDsaIT control. Referrals are sent back to the client with a
      * non-success result code.
      */
@@ -216,8 +221,8 @@ public class CompareIT extends AbstractL
 
 
     /**
-     * Tests compare operation on normal and referral entries without the 
-     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
+     * Tests compare operation on normal and referral entries without the
+     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals
      * are sent back to the client with a non-success result code.
      */
     @Test

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/MatchingRuleCompareIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/MatchingRuleCompareIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/MatchingRuleCompareIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/MatchingRuleCompareIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.compare;
 
@@ -27,6 +27,7 @@ import javax.naming.directory.DirContext
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
@@ -34,6 +35,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.integ.ServerIntegrationUtils;
 import org.apache.directory.shared.util.Strings;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -70,90 +72,92 @@ import org.junit.runner.RunWith;
 })
 public class MatchingRuleCompareIT extends AbstractLdapTestUnit
 {
-public static final String PERSON_CN = "Tori Amos";
-public static final String PERSON_SN = "Amos";
-public static final String PERSON_RDN = "cn=" + PERSON_CN;
-public static final String PERSON_TELEPHONE = "1234567890";
-public static final String PERSON_PWD = "Secret1!";
-
-public static final String GROUP_CN = "Artists";
-public static final String GROUP_RDN = "cn=" + GROUP_CN;
-
-
-/**
- * Compare with caseIgnoreMatch matching rule.
- * 
- * @throws org.apache.directory.shared.ldap.model.exception.LdapException
- */
-@Test
-public void testCaseIgnoreMatch() throws Exception
-{
-    DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( getLdapServer() ).lookup( "ou=system" );
-
-    // Setting up search controls for compare op
-    SearchControls ctls = new SearchControls();
-    ctls.setReturningAttributes( new String[]
-        {} ); // no attributes
-    ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
-
-    String[] values =
-        { PERSON_SN, PERSON_SN.toUpperCase(), Strings.toLowerCase( PERSON_SN ), PERSON_SN + "X" };
-    boolean[] expected =
-        { true, true, true, false };
-
-    for ( int i = 0; i < values.length; i++ )
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+    public static final String PERSON_CN = "Tori Amos";
+    public static final String PERSON_SN = "Amos";
+    public static final String PERSON_RDN = "cn=" + PERSON_CN;
+    public static final String PERSON_TELEPHONE = "1234567890";
+    public static final String PERSON_PWD = "Secret1!";
+    
+    public static final String GROUP_CN = "Artists";
+    public static final String GROUP_RDN = "cn=" + GROUP_CN;
+    
+    
+    /**
+     * Compare with caseIgnoreMatch matching rule.
+     * 
+     * @throws org.apache.directory.shared.ldap.model.exception.LdapException
+     */
+    @Test
+    public void testCaseIgnoreMatch() throws Exception
     {
-        String value = values[i];
-
-        NamingEnumeration<SearchResult> enumeration = ctx.search( PERSON_RDN, "sn={0}", new String[]
-            { value }, ctls );
-        boolean result = enumeration.hasMore();
-
-        assertEquals( "compare sn value '" + PERSON_SN + "' with '" + value + "'", expected[i], result );
-
-        enumeration.close();
+        DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( getLdapServer() ).lookup( "ou=system" );
+    
+        // Setting up search controls for compare op
+        SearchControls ctls = new SearchControls();
+        ctls.setReturningAttributes( new String[]
+            {} ); // no attributes
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+    
+        String[] values =
+            { PERSON_SN, PERSON_SN.toUpperCase(), Strings.toLowerCase( PERSON_SN ), PERSON_SN + "X" };
+        boolean[] expected =
+            { true, true, true, false };
+    
+        for ( int i = 0; i < values.length; i++ )
+        {
+            String value = values[i];
+    
+            NamingEnumeration<SearchResult> enumeration = ctx.search( PERSON_RDN, "sn={0}", new String[]
+                { value }, ctls );
+            boolean result = enumeration.hasMore();
+    
+            assertEquals( "compare sn value '" + PERSON_SN + "' with '" + value + "'", expected[i], result );
+    
+            enumeration.close();
+        }
     }
-}
-
-
-//
-
-/**
- * Compare with distinguishedNameMatch matching rule.
- * 
- * @throws org.apache.directory.shared.ldap.model.exception.LdapException
- */
-@Test
-public void testDistinguishedNameMatch() throws Exception
-{
-    DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( getLdapServer() ).lookup( "ou=system" );
-
-    // determine member Dn of person
-    DirContext member = ( DirContext ) ctx.lookup( PERSON_RDN );
-    String memberDN = member.getNameInNamespace();
-
-    // Setting up search controls for compare op
-    SearchControls ctls = new SearchControls();
-    ctls.setReturningAttributes( new String[]
-        {} ); // no attributes
-    ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
-
-    String[] values =
-        { "", memberDN, "cn=nobody", memberDN, PERSON_RDN + " , " + ctx.getNameInNamespace() };
-    boolean[] expected =
-        { false, true, false, true, true };
-
-    for ( int i = 0; i < values.length; i++ )
+    
+    
+    //
+    
+    /**
+     * Compare with distinguishedNameMatch matching rule.
+     * 
+     * @throws org.apache.directory.shared.ldap.model.exception.LdapException
+     */
+    @Test
+    public void testDistinguishedNameMatch() throws Exception
     {
-        String value = values[i];
-
-        NamingEnumeration<SearchResult> enumeration = ctx.search( GROUP_RDN, "member={0}", new Object[]
-            { value }, ctls );
-        boolean result = enumeration.hasMore();
-
-        assertEquals( "compare '" + memberDN + "' with '" + value + "'", expected[i], result );
-
-        enumeration.close();
+        DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( getLdapServer() ).lookup( "ou=system" );
+    
+        // determine member Dn of person
+        DirContext member = ( DirContext ) ctx.lookup( PERSON_RDN );
+        String memberDN = member.getNameInNamespace();
+    
+        // Setting up search controls for compare op
+        SearchControls ctls = new SearchControls();
+        ctls.setReturningAttributes( new String[]
+            {} ); // no attributes
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+    
+        String[] values =
+            { "", memberDN, "cn=nobody", memberDN, PERSON_RDN + " , " + ctx.getNameInNamespace() };
+        boolean[] expected =
+            { false, true, false, true, true };
+    
+        for ( int i = 0; i < values.length; i++ )
+        {
+            String value = values[i];
+    
+            NamingEnumeration<SearchResult> enumeration = ctx.search( GROUP_RDN, "member={0}", new Object[]
+                { value }, ctls );
+            boolean result = enumeration.hasMore();
+    
+            assertEquals( "compare '" + memberDN + "' with '" + value + "'", expected[i], result );
+    
+            enumeration.close();
+        }
     }
 }
-}

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=1334639&r1=1334638&r2=1334639&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 Sun May  6 14:25:18 2012
@@ -24,6 +24,7 @@ import static org.apache.directory.serve
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -32,6 +33,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -49,6 +51,8 @@ import org.junit.runner.RunWith;
     { @CreateTransport(protocol = "LDAP") })
 public class DeleteAliasIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private LdapConnection conn;
 
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java Sun May  6 14:25:18 2012
@@ -32,6 +32,7 @@ import javax.naming.NameNotFoundExceptio
 import javax.naming.ReferralException;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -48,6 +49,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaITImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -92,6 +94,8 @@ import org.slf4j.LoggerFactory;
         "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" })
 public class DeleteIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final Logger LOG = LoggerFactory.getLogger( DeleteIT.class );
 
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/ExtendedIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/ExtendedIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/ExtendedIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/ExtendedIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.extended;
 
@@ -29,10 +29,12 @@ import javax.naming.ldap.ExtendedRequest
 import javax.naming.ldap.ExtendedResponse;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -50,13 +52,16 @@ import org.junit.runner.RunWith;
     })
 public class ExtendedIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+
     /**
      * Calls an extended exception, which does not exist. Expected behaviour is
      * a CommunicationException.
      * Check the behaviour of the server for an unknown extended operation. Created
      * to demonstrate DIREVE-256 ("Extended operation causes client to hang.").
      * 
-     * @throws NamingException 
+     * @throws NamingException
      */
     @Test
     public void testUnknownExtendedOperation() throws Exception

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.extended;
 
@@ -32,6 +32,7 @@ import javax.naming.directory.BasicAttri
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.annotations.SaslMechanism;
@@ -48,6 +49,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.sp.JavaStoredProcUtils;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.Ignore;
@@ -68,6 +70,8 @@ import org.junit.Ignore;
     { StoredProcedureExtendedOperationHandler.class })
 public class StoredProcedureIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private LdapContext ctx;
     private LdapContext spCtx;
     private Map<String, OidNormalizer> oids;
@@ -132,7 +136,7 @@ public class StoredProcedureIT extends A
             "ou: People\n" +
             "objectclass: organizationalUnit\n" +
             "objectclass: top\n" +
-            "\n" + 
+            "\n" +
             "dn: cn=John,ou=People,ou=system\n" +
             "objectclass: person\n" +
             "objectclass: top\n" +

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/AddIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/AddIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/AddIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.ldapsdk;
 
@@ -62,6 +62,7 @@ import netscape.ldap.LDAPResponse;
 import netscape.ldap.LDAPResponseListener;
 import netscape.ldap.LDAPSearchConstraints;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -97,6 +98,7 @@ 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.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -180,6 +182,8 @@ import org.slf4j.LoggerFactory;
         "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" })
 public class AddIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final Logger LOG = LoggerFactory.getLogger( AddIT.class );
     private static final String RDN = "cn=The Person";
 
@@ -518,7 +522,7 @@ public class AddIT extends AbstractLdapT
         String rdnAlias = "ou=bestFruit";
         containerCtx.createSubcontext( rdnAlias, alias );
 
-        // search one level scope for alias 
+        // search one level scope for alias
         SearchControls controls = new SearchControls();
         controls.setDerefLinkFlag( true );
         controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
@@ -822,7 +826,7 @@ public class AddIT extends AbstractLdapT
 
 
     /**
-     * Tests add operation on normal and referral entries without the 
+     * Tests add operation on normal and referral entries without the
      * ManageDsaIT control. Referrals are sent back to the client with a
      * non-success result code.
      */
@@ -858,8 +862,8 @@ public class AddIT extends AbstractLdapT
 
 
     /**
-     * Tests add operation on normal and referral entries without the 
-     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
+     * Tests add operation on normal and referral entries without the
+     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals
      * are sent back to the client with a non-success result code.
      */
     @Test
@@ -1089,9 +1093,9 @@ public class AddIT extends AbstractLdapT
 
     /**
      * Test that if we inject a PDU above the max allowed size,
-     * the connection is closed. 
+     * the connection is closed.
      * 
-     * @throws NamingException 
+     * @throws NamingException
      */
     @Test
     public void testAddPDUExceedingMaxSizeJNDI() throws Exception
@@ -1158,9 +1162,9 @@ public class AddIT extends AbstractLdapT
 
     /**
      * Test that if we inject a PDU above the max allowed size,
-     * the connection is closed. 
+     * the connection is closed.
      * 
-     * @throws NamingException 
+     * @throws NamingException
      */
     @Test
     public void testAddPDUExceedingMaxSizeLdapApi() throws Exception
@@ -1239,7 +1243,7 @@ public class AddIT extends AbstractLdapT
         binary.put( "userPassword", "test" );
         /*
          * Note that the Rdn attribute is different to the userPassword specified
-         * in the entry. This creates a second cn attribute "userPassword:#414243". 
+         * in the entry. This creates a second cn attribute "userPassword:#414243".
          * This is a JNDI hack:
          * If no other userPassword is available in the entry, JNDI adds the Rdn
          * attribute to the entry before sending the request to the server.
@@ -1347,7 +1351,7 @@ public class AddIT extends AbstractLdapT
      *        |--cn=alias  <--alias, pointing to the real entry
      * </pre>
      * 
-     * @throws NamingException 
+     * @throws NamingException
      */
     @Test
     @CreateDS(
@@ -1392,7 +1396,7 @@ public class AddIT extends AbstractLdapT
     /**
      * Adding an entry with a non existing attribute type.
      * 
-     * @throws Exception 
+     * @throws Exception
      */
     @Test
     public void testAddEntryNonExistingAT() throws Exception
@@ -1428,7 +1432,7 @@ public class AddIT extends AbstractLdapT
     /**
      * Adding an entry with a non existing attribute type.
      * 
-     * @throws Exception 
+     * @throws Exception
      */
     @Test(expected = LdapOperationException.class)
     public void testAddEntryNonExistingOC() throws Exception
@@ -1450,7 +1454,7 @@ public class AddIT extends AbstractLdapT
     /**
      * Adding an entry with a 100K attribute's value.
      * 
-     * @throws Exception 
+     * @throws Exception
      */
     @Test(expected = LdapException.class)
     public void testAddEntry100KData() throws Exception
@@ -1478,7 +1482,7 @@ public class AddIT extends AbstractLdapT
 
         connection.add( personEntry );
 
-        // Check that the entry has been stored 
+        // Check that the entry has been stored
         Entry entry = connection.lookup( dn, "description", "cn", "sn" );
 
         String description = entry.get( "description" ).getString();

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/CompareIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/CompareIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/CompareIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/CompareIT.java Sun May  6 14:25:18 2012
@@ -42,6 +42,7 @@ import netscape.ldap.LDAPException;
 import netscape.ldap.LDAPResponse;
 import netscape.ldap.LDAPResponseListener;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -49,6 +50,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -91,11 +93,13 @@ import org.slf4j.LoggerFactory;
         "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" })
 public class CompareIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final Logger LOG = LoggerFactory.getLogger( CompareIT.class );
 
 
     /**
-     * Tests normal compare operation on normal non-referral entries without 
+     * Tests normal compare operation on normal non-referral entries without
      * the ManageDsaIT control.
      */
     @Test
@@ -117,7 +121,7 @@ public class CompareIT extends AbstractL
 
 
     /**
-     * Tests normal compare operation on normal non-referral entries without 
+     * Tests normal compare operation on normal non-referral entries without
      * the ManageDsaIT control using an attribute that does not exist in the
      * entry.
      */
@@ -172,7 +176,7 @@ public class CompareIT extends AbstractL
 
 
     /**
-     * Tests compare operation on normal and referral entries without the 
+     * Tests compare operation on normal and referral entries without the
      * ManageDsaIT control. Referrals are sent back to the client with a
      * non-success result code.
      */
@@ -206,8 +210,8 @@ public class CompareIT extends AbstractL
 
 
     /**
-     * Tests compare operation on normal and referral entries without the 
-     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
+     * Tests compare operation on normal and referral entries without the
+     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals
      * are sent back to the client with a non-success result code.
      */
     @Test

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/DeleteIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/DeleteIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/DeleteIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/DeleteIT.java Sun May  6 14:25:18 2012
@@ -39,6 +39,7 @@ import netscape.ldap.LDAPResponse;
 import netscape.ldap.LDAPResponseListener;
 import netscape.ldap.LDAPSearchConstraints;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -48,6 +49,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.model.exception.LdapContextNotEmptyException;
 import org.apache.directory.shared.ldap.model.exception.LdapNoSuchObjectException;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -92,11 +94,13 @@ import org.slf4j.LoggerFactory;
         "ref: ldap://bar:10389/uid=akarasulu,ou=users,ou=system" })
 public class DeleteIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final Logger LOG = LoggerFactory.getLogger( DeleteIT.class );
 
 
     /**
-     * Tests normal delete operation on normal non-referral entries without 
+     * Tests normal delete operation on normal non-referral entries without
      * the ManageDsaIT control.
      */
     @Test
@@ -121,7 +125,7 @@ public class DeleteIT extends AbstractLd
 
 
     /**
-     * Tests normal delete operation on normal non-referral entries without 
+     * Tests normal delete operation on normal non-referral entries without
      * the ManageDsaIT control.
      */
     @Test
@@ -149,7 +153,7 @@ public class DeleteIT extends AbstractLd
 
 
     /**
-     * Tests normal delete operation on non-existent entries without 
+     * Tests normal delete operation on non-existent entries without
      * the ManageDsaIT control.
      */
     @Test
@@ -203,7 +207,7 @@ public class DeleteIT extends AbstractLd
 
 
     /**
-     * Tests delete operation on normal and referral entries without the 
+     * Tests delete operation on normal and referral entries without the
      * ManageDsaIT control. Referrals are sent back to the client with a
      * non-success result code.
      */
@@ -232,8 +236,8 @@ public class DeleteIT extends AbstractLd
 
 
     /**
-     * Tests delete operation on normal and referral entries without the 
-     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
+     * Tests delete operation on normal and referral entries without the
+     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals
      * are sent back to the client with a non-success result code.
      */
     @Test

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/IllegalModificationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/IllegalModificationIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/IllegalModificationIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/IllegalModificationIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.ldapsdk;
 
@@ -30,6 +30,7 @@ import netscape.ldap.LDAPEntry;
 import netscape.ldap.LDAPException;
 import netscape.ldap.LDAPModification;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -46,11 +47,11 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 
-/** 
- * A test taken from DIRSERVER-630: If one tries to add an attribute to an 
- * entry, and does not provide a value, it is assumed that the server does 
- * not modify the entry. We have a situation here using Sun ONE Directory 
- * SDK for Java, where adding a description attribute without value to a 
+/**
+ * A test taken from DIRSERVER-630: If one tries to add an attribute to an
+ * entry, and does not provide a value, it is assumed that the server does
+ * not modify the entry. We have a situation here using Sun ONE Directory
+ * SDK for Java, where adding a description attribute without value to a
  * person entry like this,
  * <code>
  * dn: cn=Kate Bush,dc=example,dc=com
@@ -58,11 +59,11 @@ import org.junit.runner.RunWith;
  * objectclass: top
  * sn: Bush
  * cn: Kate Bush
- * </code> 
- * does not fail (modify call does not result in an exception). Instead, a 
- * description attribute is created within the entry. At least the new 
- * attribute is readable with Netscape SDK (it is not visible to most UIs, 
- * because it is invalid ...). 
+ * </code>
+ * does not fail (modify call does not result in an exception). Instead, a
+ * description attribute is created within the entry. At least the new
+ * attribute is readable with Netscape SDK (it is not visible to most UIs,
+ * because it is invalid ...).
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -80,6 +81,7 @@ import org.junit.runner.RunWith;
         "sn: Bush" })
 public class IllegalModificationIT extends AbstractLdapTestUnit
 {
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final String DN = "cn=Kate Bush,ou=system";
 
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyDnReferralIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyDnReferralIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyDnReferralIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyDnReferralIT.java Sun May  6 14:25:18 2012
@@ -38,12 +38,14 @@ import netscape.ldap.LDAPResponse;
 import netscape.ldap.LDAPResponseListener;
 import netscape.ldap.LDAPSearchConstraints;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -101,194 +103,196 @@ import org.slf4j.LoggerFactory;
 })
 public class ModifyDnReferralIT extends AbstractLdapTestUnit
 {
-private static final Logger LOG = LoggerFactory.getLogger( ModifyDnReferralIT.class );
-
-
-/**
- * Tests ModifyDN operation on referral entry with the ManageDsaIT control.
- */
-@Test
-public void testOnReferralWithManageDsaITControl() throws Exception
-{
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPSearchConstraints();
-    constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
-    constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
-    conn.setConstraints( constraints );
-
-    // ModifyDN success
-    conn.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref", true, constraints );
-    LDAPEntry entry = conn.read( "uid=ref,ou=users,ou=system", ( LDAPSearchConstraints ) constraints );
-    assertNotNull( entry );
-    assertEquals( "uid=ref,ou=users,ou=system", entry.getDN() );
-
-    conn.disconnect();
-}
-
-
-/**
- * Tests ModifyDN operation with newSuperior on referral entry with the 
- * ManageDsaIT control.
- */
-@Test
-public void testNewSuperiorOnReferralWithManageDsaITControl() throws Exception
-{
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPSearchConstraints();
-    constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
-    constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
-    conn.setConstraints( constraints );
-
-    // ModifyDN success
-    try
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+    private static final Logger LOG = LoggerFactory.getLogger( ModifyDnReferralIT.class );
+    
+    
+    /**
+     * Tests ModifyDN operation on referral entry with the ManageDsaIT control.
+     */
+    @Test
+    public void testOnReferralWithManageDsaITControl() throws Exception
     {
-        conn.rename( "uid=elecharny,ou=users,ou=system", "uid=newuser",
-            "uid=akarasuluref,ou=users,ou=system", true, constraints );
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPSearchConstraints();
+        constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
+        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
+        conn.setConstraints( constraints );
+    
+        // ModifyDN success
+        conn.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref", true, constraints );
+        LDAPEntry entry = conn.read( "uid=ref,ou=users,ou=system", ( LDAPSearchConstraints ) constraints );
+        assertNotNull( entry );
+        assertEquals( "uid=ref,ou=users,ou=system", entry.getDN() );
+    
+        conn.disconnect();
     }
-    catch ( LDAPException le )
-    {
-        assertEquals( LDAPException.AFFECTS_MULTIPLE_DSAS, le.getLDAPResultCode() );
-    }
-
-    conn.disconnect();
-}
-
-
-/**
- * Tests ModifyDN operation on normal and referral entries without the 
- * ManageDsaIT control. Referrals are sent back to the client with a
- * non-success result code.
- */
-@Test
-public void testOnReferral() throws Exception
-{
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPConstraints();
-    constraints.setReferrals( false );
-    conn.setConstraints( constraints );
-
-    // referrals failure
-    LDAPResponseListener listener = null;
-    LDAPResponse response = null;
-
-    listener = conn.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref", true, null, constraints );
-    response = listener.getResponse();
-    assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
-
-    assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
-    assertEquals( "ldap://foo:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
-    assertEquals( "ldap://bar:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
-
-    conn.disconnect();
-}
-
-
-/**
- * Tests ModifyDN operation on normal and referral entries without the 
- * ManageDsaIT control. Referrals are sent back to the client with a
- * non-success result code.
- */
-@Test
-public void testNewSupierorOnReferral() throws Exception
-{
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPConstraints();
-    constraints.setReferrals( false );
-    conn.setConstraints( constraints );
-
-    // referrals failure
-    try
+    
+    
+    /**
+     * Tests ModifyDN operation with newSuperior on referral entry with the
+     * ManageDsaIT control.
+     */
+    @Test
+    public void testNewSuperiorOnReferralWithManageDsaITControl() throws Exception
     {
-        conn.rename( "uid=elecharny,ou=users,ou=system", "uid=ref",
-            "uid=akarasuluref,ou=users,ou=system", true, constraints );
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPSearchConstraints();
+        constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
+        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
+        conn.setConstraints( constraints );
+    
+        // ModifyDN success
+        try
+        {
+            conn.rename( "uid=elecharny,ou=users,ou=system", "uid=newuser",
+                "uid=akarasuluref,ou=users,ou=system", true, constraints );
+        }
+        catch ( LDAPException le )
+        {
+            assertEquals( LDAPException.AFFECTS_MULTIPLE_DSAS, le.getLDAPResultCode() );
+        }
+    
+        conn.disconnect();
     }
-    catch ( LDAPException e )
+    
+    
+    /**
+     * Tests ModifyDN operation on normal and referral entries without the
+     * ManageDsaIT control. Referrals are sent back to the client with a
+     * non-success result code.
+     */
+    @Test
+    public void testOnReferral() throws Exception
     {
-        assertEquals( LDAPException.AFFECTS_MULTIPLE_DSAS, e.getLDAPResultCode() );
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPConstraints();
+        constraints.setReferrals( false );
+        conn.setConstraints( constraints );
+    
+        // referrals failure
+        LDAPResponseListener listener = null;
+        LDAPResponse response = null;
+    
+        listener = conn.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref", true, null, constraints );
+        response = listener.getResponse();
+        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
+    
+        assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
+        assertEquals( "ldap://foo:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
+        assertEquals( "ldap://bar:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
+    
+        conn.disconnect();
     }
-
-    conn.disconnect();
-}
-
-
-/**
- * Tests ModifyDN operation on normal and referral entries without the 
- * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
- * are sent back to the client with a non-success result code.
- */
-@Test
-public void testThrowOnReferralWithJndi() throws Exception
-{
-    LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
-
-    // ModifyDN referrals failure
-    try
+    
+    
+    /**
+     * Tests ModifyDN operation on normal and referral entries without the
+     * ManageDsaIT control. Referrals are sent back to the client with a
+     * non-success result code.
+     */
+    @Test
+    public void testNewSupierorOnReferral() throws Exception
     {
-        ctx.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref,ou=users,ou=system" );
-        fail( "Should never get here due to ModifyDN failure on ReferralException" );
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPConstraints();
+        constraints.setReferrals( false );
+        conn.setConstraints( constraints );
+    
+        // referrals failure
+        try
+        {
+            conn.rename( "uid=elecharny,ou=users,ou=system", "uid=ref",
+                "uid=akarasuluref,ou=users,ou=system", true, constraints );
+        }
+        catch ( LDAPException e )
+        {
+            assertEquals( LDAPException.AFFECTS_MULTIPLE_DSAS, e.getLDAPResultCode() );
+        }
+    
+        conn.disconnect();
     }
-    catch ( ReferralException e )
+    
+    
+    /**
+     * Tests ModifyDN operation on normal and referral entries without the
+     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals
+     * are sent back to the client with a non-success result code.
+     */
+    @Test
+    public void testThrowOnReferralWithJndi() throws Exception
     {
-        // seems JNDI only returns the first referral URL and not all so we test for it
-        assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", e.getReferralInfo() );
+        LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
+    
+        // ModifyDN referrals failure
+        try
+        {
+            ctx.rename( "uid=akarasuluref,ou=users,ou=system", "uid=ref,ou=users,ou=system" );
+            fail( "Should never get here due to ModifyDN failure on ReferralException" );
+        }
+        catch ( ReferralException e )
+        {
+            // seems JNDI only returns the first referral URL and not all so we test for it
+            assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", e.getReferralInfo() );
+        }
+    
+        ctx.close();
     }
-
-    ctx.close();
-}
-
-
-/**
- * Tests referral handling when an ancestor is a referral.
- */
-@Test
-public void testAncestorReferral() throws Exception
-{
-    LOG.debug( "" );
-
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPConstraints();
-    conn.setConstraints( constraints );
-
-    // referrals failure
-    LDAPResponseListener listener = null;
-    LDAPResponse response = null;
-
-    listener = conn.rename( "ou=Computers,uid=akarasuluref,ou=users,ou=system", "ou=Machines", true, null, constraints );
-    response = listener.getResponse();
-    assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
-
-    assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
-    assertEquals( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
-    assertEquals( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
-
-    conn.disconnect();
-}
-
-
-/**
- * Tests referral handling when an ancestor is a referral.
- */
-@Test
-public void testNewSuperiorAncestorReferral() throws Exception
-{
-    LOG.debug( "" );
-
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPConstraints();
-    conn.setConstraints( constraints );
-
-    // referrals failure
-    try
+    
+    
+    /**
+     * Tests referral handling when an ancestor is a referral.
+     */
+    @Test
+    public void testAncestorReferral() throws Exception
     {
-        conn.rename( "uid=elecharny,ou=users,ou=system", "ou=Machines",
-            "ou=Computers,uid=akarasuluref,ou=users,ou=system", true, constraints );
-        fail( "Should never get here to affectsMultipleDSA error result code" );
+        LOG.debug( "" );
+    
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPConstraints();
+        conn.setConstraints( constraints );
+    
+        // referrals failure
+        LDAPResponseListener listener = null;
+        LDAPResponse response = null;
+    
+        listener = conn.rename( "ou=Computers,uid=akarasuluref,ou=users,ou=system", "ou=Machines", true, null, constraints );
+        response = listener.getResponse();
+        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
+    
+        assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
+        assertEquals( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
+        assertEquals( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
+    
+        conn.disconnect();
     }
-    catch ( LDAPException e )
+    
+    
+    /**
+     * Tests referral handling when an ancestor is a referral.
+     */
+    @Test
+    public void testNewSuperiorAncestorReferral() throws Exception
     {
-        assertEquals( LDAPException.AFFECTS_MULTIPLE_DSAS, e.getLDAPResultCode() );
+        LOG.debug( "" );
+    
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPConstraints();
+        conn.setConstraints( constraints );
+    
+        // referrals failure
+        try
+        {
+            conn.rename( "uid=elecharny,ou=users,ou=system", "ou=Machines",
+                "ou=Computers,uid=akarasuluref,ou=users,ou=system", true, constraints );
+            fail( "Should never get here to affectsMultipleDSA error result code" );
+        }
+        catch ( LDAPException e )
+        {
+            assertEquals( LDAPException.AFFECTS_MULTIPLE_DSAS, e.getLDAPResultCode() );
+        }
+    
+        conn.disconnect();
     }
-
-    conn.disconnect();
-}
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyReferralIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyReferralIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyReferralIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/ldapsdk/ModifyReferralIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.ldapsdk;
 
@@ -40,6 +40,7 @@ import netscape.ldap.LDAPModification;
 import netscape.ldap.LDAPResponse;
 import netscape.ldap.LDAPResponseListener;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
@@ -47,17 +48,18 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.operations.compare.CompareIT;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-/** 
- * A test taken from DIRSERVER-630: If one tries to add an attribute to an 
- * entry, and does not provide a value, it is assumed that the server does 
- * not modify the entry. We have a situation here using Sun ONE Directory 
- * SDK for Java, where adding a description attribute without value to a 
+/**
+ * A test taken from DIRSERVER-630: If one tries to add an attribute to an
+ * entry, and does not provide a value, it is assumed that the server does
+ * not modify the entry. We have a situation here using Sun ONE Directory
+ * SDK for Java, where adding a description attribute without value to a
  * person entry like this,
  * <code>
  * dn: cn=Kate Bush,dc=example,dc=com
@@ -65,11 +67,11 @@ import org.slf4j.LoggerFactory;
  * objectclass: top
  * sn: Bush
  * cn: Kate Bush
- * </code> 
- * does not fail (modify call does not result in an exception). Instead, a 
- * description attribute is created within the entry. At least the new 
- * attribute is readable with Netscape SDK (it is not visible to most UIs, 
- * because it is invalid ...). 
+ * </code>
+ * does not fail (modify call does not result in an exception). Instead, a
+ * description attribute is created within the entry. At least the new
+ * attribute is readable with Netscape SDK (it is not visible to most UIs,
+ * because it is invalid ...).
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -109,117 +111,119 @@ import org.slf4j.LoggerFactory;
 })
 public class ModifyReferralIT extends AbstractLdapTestUnit
 {
-private static final Logger LOG = LoggerFactory.getLogger( CompareIT.class );
-
-
-/**
- * Tests modify operation on referral entry with the ManageDsaIT control.
- */
-@Test
-public void testOnReferralWithManageDsaITControl() throws Exception
-{
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPConstraints();
-    constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
-    constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
-    conn.setConstraints( constraints );
-
-    // modify success
-    LDAPAttribute attribute = new LDAPAttribute( "description", "referral to akarasulu" );
-    LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
-    conn.modify( "uid=akarasuluref,ou=users,ou=system", mod, constraints );
-
-    assertTrue( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );
-
-    conn.disconnect();
-}
-
-
-/**
- * Tests modify operation on referral entries without the 
- * ManageDsaIT control. Referrals are sent back to the client with a
- * non-success result code.
- */
-@Test
-public void testOnReferral() throws Exception
-{
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPConstraints();
-    constraints.setReferrals( false );
-    conn.setConstraints( constraints );
-
-    // referrals failure
-    // modify success
-    LDAPAttribute attribute = new LDAPAttribute( "description", "referral to akarasulu" );
-    LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
-    LDAPResponseListener listener = conn.modify( "uid=akarasuluref,ou=users,ou=system", mod, null, constraints );
-    LDAPResponse response = listener.getResponse();
-
-    assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
-
-    assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
-    assertEquals( "ldap://foo:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
-    assertEquals( "ldap://bar:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
-
-    conn.disconnect();
-}
-
-
-/**
- * Tests modify operation on normal and referral entries without the 
- * ManageDsaIT control using JNDI instead of the Netscape API. Referrals 
- * are sent back to the client with a non-success result code.
- */
-@Test
-public void testThrowOnReferralWithJndi() throws Exception
-{
-    LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
-
-    // modify failure
-    Attribute attr = new BasicAttribute( "description", "referral to akarasulu" );
-    ModificationItem mod = new ModificationItem( DirContext.ADD_ATTRIBUTE, attr );
-
-    try
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+    private static final Logger LOG = LoggerFactory.getLogger( CompareIT.class );
+    
+    
+    /**
+     * Tests modify operation on referral entry with the ManageDsaIT control.
+     */
+    @Test
+    public void testOnReferralWithManageDsaITControl() throws Exception
     {
-        ctx.modifyAttributes( "uid=akarasuluref,ou=users,ou=system", new ModificationItem[]
-            { mod } );
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPConstraints();
+        constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
+        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
+        conn.setConstraints( constraints );
+    
+        // modify success
+        LDAPAttribute attribute = new LDAPAttribute( "description", "referral to akarasulu" );
+        LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
+        conn.modify( "uid=akarasuluref,ou=users,ou=system", mod, constraints );
+    
+        assertTrue( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );
+    
+        conn.disconnect();
     }
-    catch ( ReferralException e )
+    
+    
+    /**
+     * Tests modify operation on referral entries without the
+     * ManageDsaIT control. Referrals are sent back to the client with a
+     * non-success result code.
+     */
+    @Test
+    public void testOnReferral() throws Exception
     {
-        // seems JNDI only returns the first referral URL and not all so we test for it
-        assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", e.getReferralInfo() );
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPConstraints();
+        constraints.setReferrals( false );
+        conn.setConstraints( constraints );
+    
+        // referrals failure
+        // modify success
+        LDAPAttribute attribute = new LDAPAttribute( "description", "referral to akarasulu" );
+        LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
+        LDAPResponseListener listener = conn.modify( "uid=akarasuluref,ou=users,ou=system", mod, null, constraints );
+        LDAPResponse response = listener.getResponse();
+    
+        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
+    
+        assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
+        assertEquals( "ldap://foo:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
+        assertEquals( "ldap://bar:10389/uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
+    
+        conn.disconnect();
+    }
+    
+    
+    /**
+     * Tests modify operation on normal and referral entries without the
+     * ManageDsaIT control using JNDI instead of the Netscape API. Referrals
+     * are sent back to the client with a non-success result code.
+     */
+    @Test
+    public void testThrowOnReferralWithJndi() throws Exception
+    {
+        LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
+    
+        // modify failure
+        Attribute attr = new BasicAttribute( "description", "referral to akarasulu" );
+        ModificationItem mod = new ModificationItem( DirContext.ADD_ATTRIBUTE, attr );
+    
+        try
+        {
+            ctx.modifyAttributes( "uid=akarasuluref,ou=users,ou=system", new ModificationItem[]
+                { mod } );
+        }
+        catch ( ReferralException e )
+        {
+            // seems JNDI only returns the first referral URL and not all so we test for it
+            assertEquals( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system", e.getReferralInfo() );
+        }
+    
+        ctx.close();
+    }
+    
+    
+    /**
+     * Tests referral handling when an ancestor is a referral.
+     */
+    @Test
+    public void testAncestorReferral() throws Exception
+    {
+        LOG.debug( "" );
+    
+        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
+        LDAPConstraints constraints = new LDAPConstraints();
+        conn.setConstraints( constraints );
+    
+        // referrals failure
+        LDAPAttribute attribute = new LDAPAttribute( "ou", "Machines" );
+        LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
+        LDAPResponseListener listener = null;
+        LDAPResponse response = null;
+    
+        listener = conn.modify( "ou=Computers,uid=akarasuluref,ou=users,ou=system", mod, null, constraints );
+        response = listener.getResponse();
+        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
+    
+        assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
+        assertEquals( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
+        assertEquals( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
+    
+        conn.disconnect();
     }
-
-    ctx.close();
-}
-
-
-/**
- * Tests referral handling when an ancestor is a referral.
- */
-@Test
-public void testAncestorReferral() throws Exception
-{
-    LOG.debug( "" );
-
-    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
-    LDAPConstraints constraints = new LDAPConstraints();
-    conn.setConstraints( constraints );
-
-    // referrals failure
-    LDAPAttribute attribute = new LDAPAttribute( "ou", "Machines" );
-    LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
-    LDAPResponseListener listener = null;
-    LDAPResponse response = null;
-
-    listener = conn.modify( "ou=Computers,uid=akarasuluref,ou=users,ou=system", mod, null, constraints );
-    response = listener.getResponse();
-    assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
-
-    assertEquals( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[0] );
-    assertEquals( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[1] );
-    assertEquals( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system", response.getReferrals()[2] );
-
-    conn.disconnect();
-}
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.lookup;
 
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -31,6 +32,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.integ.ServerIntegrationUtils;
 import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -45,6 +47,9 @@ import org.junit.runner.RunWith;
     { @CreateTransport(protocol = "LDAP") })
 public class LookupIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+
     /**
      * Evaluate the lookup operation when using a inherited Attribute
      */

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupPerfIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.lookup;
 
@@ -29,6 +29,7 @@ import javax.naming.directory.Attributes
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -41,6 +42,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.util.JndiUtils;
 import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -55,6 +57,8 @@ import org.junit.runner.RunWith;
     { @CreateTransport(protocol = "LDAP") })
 public class LookupPerfIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     /**
      * Evaluate the lookup operation performances
      */

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java Sun May  6 14:25:18 2012
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.operations.modify;
 
@@ -25,6 +25,7 @@ import static org.apache.directory.serve
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -41,15 +42,16 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 
-/** 
- * A test taken from DIRSERVER-630: If one tries to add an attribute to an 
- * entry, and does not provide a value, it is assumed that the server does 
- * not modify the entry. We have a situation here using Sun ONE Directory 
- * SDK for Java, where adding a description attribute without value to a 
+/**
+ * A test taken from DIRSERVER-630: If one tries to add an attribute to an
+ * entry, and does not provide a value, it is assumed that the server does
+ * not modify the entry. We have a situation here using Sun ONE Directory
+ * SDK for Java, where adding a description attribute without value to a
  * person entry like this,
  * <code>
  * dn: cn=Kate Bush,dc=example,dc=com
@@ -57,11 +59,11 @@ import org.junit.runner.RunWith;
  * objectclass: top
  * sn: Bush
  * cn: Kate Bush
- * </code> 
- * does not fail (modify call does not result in an exception). Instead, a 
- * description attribute is created within the entry. At least the new 
- * attribute is readable with Netscape SDK (it is not visible to most UIs, 
- * because it is invalid ...). 
+ * </code>
+ * does not fail (modify call does not result in an exception). Instead, a
+ * description attribute is created within the entry. At least the new
+ * attribute is readable with Netscape SDK (it is not visible to most UIs,
+ * because it is invalid ...).
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -79,6 +81,8 @@ import org.junit.runner.RunWith;
         "sn: Bush" })
 public class IllegalModificationIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final String DN = "cn=Kate Bush,ou=system";
 
 



Mime
View raw message