directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1509635 [3/5] - in /directory/apacheds/trunk: ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ server-integ/src/test/java/org/apache/directory/server/operations/add/ server-integ/src/test/java/org/apache/di...
Date Fri, 02 Aug 2013 11:26:46 GMT
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java Fri Aug  2 11:26:45 2013
@@ -39,14 +39,12 @@ import javax.naming.directory.SchemaViol
 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;
 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.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -81,15 +79,12 @@ import org.junit.runner.RunWith;
         "objectClass: organizationalPerson ",
         "objectClass: inetOrgPerson ",
         "sn: Wilde",
-        "cn: Kim Wilde"
-})
+        "cn: Kim Wilde" })
 public class ModifyReplaceIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final String BASE = "ou=system";
-    
-    
+
+
     /**
      * Create a person entry and try to remove a not present attribute
      */
@@ -97,22 +92,22 @@ public class ModifyReplaceIT extends Abs
     public void testReplaceToRemoveNotPresentAttribute() throws Exception
     {
         DirContext sysRoot = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
-    
+
         String rdn = "cn=Kate Bush";
-    
+
         Attribute attr = new BasicAttribute( "description" );
         ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-    
+
         sysRoot.modifyAttributes( rdn, new ModificationItem[]
             { item } );
-    
+
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String filter = "(sn=Bush)";
         String base = "";
-    
+
         NamingEnumeration<SearchResult> enm = sysRoot.search( base, filter, sctls );
-    
+
         while ( enm.hasMore() )
         {
             SearchResult sr = enm.next();
@@ -123,8 +118,8 @@ public class ModifyReplaceIT extends Abs
             assertNull( desc );
         }
     }
-    
-    
+
+
     /**
      * Create a person entry and try to add a not present attribute via a REPLACE
      */
@@ -132,22 +127,22 @@ public class ModifyReplaceIT extends Abs
     public void testReplaceToAddNotPresentAttribute() throws Exception
     {
         DirContext sysRoot = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
-    
+
         String rdn = "cn=Kate Bush";
-    
+
         Attribute attr = new BasicAttribute( "description", "added description" );
         ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-    
+
         sysRoot.modifyAttributes( rdn, new ModificationItem[]
             { item } );
-    
+
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String filter = "(sn=Bush)";
         String base = "";
-    
+
         NamingEnumeration<SearchResult> enm = sysRoot.search( base, filter, sctls );
-    
+
         while ( enm.hasMore() )
         {
             SearchResult sr = enm.next();
@@ -160,8 +155,8 @@ public class ModifyReplaceIT extends Abs
             assertEquals( 1, desc.size() );
         }
     }
-    
-    
+
+
     /**
      * Create a person entry and try to remove a non existing attribute
      */
@@ -169,12 +164,12 @@ public class ModifyReplaceIT extends Abs
     public void testReplaceNonExistingAttribute() throws Exception
     {
         DirContext sysRoot = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
-    
+
         String rdn = "cn=Kate Bush";
-    
+
         Attribute attr = new BasicAttribute( "numberOfOctaves" );
         ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-    
+
         try
         {
             sysRoot.modifyAttributes( rdn, new ModificationItem[]
@@ -185,14 +180,14 @@ public class ModifyReplaceIT extends Abs
         {
             assertTrue( true );
         }
-    
+
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String filter = "(sn=Bush)";
         String base = "";
-    
+
         NamingEnumeration<SearchResult> enm = sysRoot.search( base, filter, sctls );
-    
+
         while ( enm.hasMore() )
         {
             SearchResult sr = enm.next();
@@ -201,8 +196,8 @@ public class ModifyReplaceIT extends Abs
             assertTrue( cn.contains( "Kate Bush" ) );
         }
     }
-    
-    
+
+
     /**
      * Create a person entry and try to remove a non existing attribute
      */
@@ -210,14 +205,14 @@ public class ModifyReplaceIT extends Abs
     public void testReplaceNonExistingAttributeManyMods() throws Exception
     {
         DirContext sysRoot = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
-    
+
         String rdn = "cn=Kate Bush";
-    
+
         Attribute attr = new BasicAttribute( "numberOfOctaves" );
         ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
         Attribute attr2 = new BasicAttribute( "description", "blah blah blah" );
         ModificationItem item2 = new ModificationItem( DirContext.ADD_ATTRIBUTE, attr2 );
-    
+
         try
         {
             sysRoot.modifyAttributes( rdn, new ModificationItem[]
@@ -228,12 +223,12 @@ public class ModifyReplaceIT extends Abs
         {
             assertTrue( true );
         }
-    
+
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String filter = "(sn=Bush)";
         String base = "";
-    
+
         NamingEnumeration<SearchResult> enm = sysRoot.search( base, filter, sctls );
         while ( enm.hasMore() )
         {
@@ -243,8 +238,8 @@ public class ModifyReplaceIT extends Abs
             assertTrue( cn.contains( "Kate Bush" ) );
         }
     }
-    
-    
+
+
     /**
      * Create a person entry and try to replace a non existing indexed attribute
      */
@@ -252,22 +247,22 @@ public class ModifyReplaceIT extends Abs
     public void testReplaceNonExistingIndexedAttribute() throws Exception
     {
         DirContext sysRoot = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
-    
+
         String rdn = "cn=Kim Wilde";
-    
+
         Attribute attr = new BasicAttribute( "ou", "test" );
         ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
-    
+
         sysRoot.modifyAttributes( rdn, new ModificationItem[]
             { item } );
-    
+
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String filter = "(sn=Wilde)";
         String base = "";
-    
+
         NamingEnumeration<SearchResult> enm = sysRoot.search( base, filter, sctls );
-    
+
         while ( enm.hasMore() )
         {
             SearchResult sr = enm.next();
@@ -276,8 +271,8 @@ public class ModifyReplaceIT extends Abs
             assertTrue( ou.contains( "test" ) );
         }
     }
-    
-    
+
+
     /**
      * Create a person entry, replace telephoneNumber, verify the
      * case of the attribute description attribute.
@@ -287,12 +282,12 @@ public class ModifyReplaceIT extends Abs
     {
         DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
         String rdn = "cn=Kate Bush";
-    
+
         // Replace telephoneNumber
         String newValue = "2345678901";
         Attributes attrs = new BasicAttributes( "telephoneNumber", newValue, false );
         ctx.modifyAttributes( rdn, DirContext.REPLACE_ATTRIBUTE, attrs );
-    
+
         // Verify, that
         // - case of attribute description is correct
         // - attribute value is added
@@ -303,8 +298,8 @@ public class ModifyReplaceIT extends Abs
         assertTrue( attr.contains( newValue ) );
         assertEquals( 1, attr.size() );
     }
-    
-    
+
+
     /**
      * Create a person entry, replace an attribute not present in the ObjectClasses
      */
@@ -313,11 +308,11 @@ public class ModifyReplaceIT extends Abs
     {
         DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
         String rdn = "cn=Kate Bush";
-    
+
         // Replace ou
         String newValue = "Test";
         Attributes attrs = new BasicAttributes( "ou", newValue, false );
-    
+
         try
         {
             ctx.modifyAttributes( rdn, DirContext.REPLACE_ATTRIBUTE, attrs );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyDnReferralIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyDnReferralIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyDnReferralIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyDnReferralIT.java Fri Aug  2 11:26:45 2013
@@ -41,14 +41,12 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.message.controls.ManageDsaITImpl;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.name.Rdn;
-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;
 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.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -102,15 +100,12 @@ import org.slf4j.LoggerFactory;
         "objectClass: top",
         "uid: elecharny",
         "cn: Emmanuel Lecharny",
-        "sn: lecharny"
-})
+        "sn: lecharny" })
 public class ModifyDnReferralIT extends AbstractLdapTestUnit
 {
-    @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.
      */
@@ -118,27 +113,27 @@ public class ModifyDnReferralIT extends 
     public void testOnReferralWithManageDsaITControl() throws Exception
     {
         LdapConnection conn = getWiredConnection( getLdapServer() );
-    
+
         ManageDsaIT manageDSAIT = new ManageDsaITImpl();
         manageDSAIT.setCritical( true );
-    
+
         // ModifyDN success
         ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();
         modifyDnRequest.setName( new Dn( "uid=akarasuluref,ou=users,ou=system" ) );
         modifyDnRequest.setNewRdn( new Rdn( "uid=ref" ) );
         modifyDnRequest.setDeleteOldRdn( true );
         modifyDnRequest.addControl( manageDSAIT );
-    
+
         conn.modifyDn( modifyDnRequest );
         Entry entry = conn.lookup( "uid=ref,ou=users,ou=system", new Control[]
             { manageDSAIT } );
         assertNotNull( entry );
         assertEquals( "uid=ref,ou=users,ou=system", entry.getDn().getName() );
-    
+
         conn.close();
     }
-    
-    
+
+
     /**
      * Tests ModifyDN operation with newSuperior on referral entry with the
      * ManageDsaIT control.
@@ -147,17 +142,17 @@ public class ModifyDnReferralIT extends 
     public void testNewSuperiorOnReferralWithManageDsaITControl() throws Exception
     {
         LdapConnection conn = getWiredConnection( getLdapServer() );
-    
+
         ManageDsaIT manageDSAIT = new ManageDsaITImpl();
         manageDSAIT.setCritical( true );
-    
+
         ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();
         modifyDnRequest.setName( new Dn( "uid=elecharny,ou=users,ou=system" ) );
         modifyDnRequest.setNewRdn( new Rdn( "uid=newuser" ) );
         modifyDnRequest.setNewSuperior( new Dn( "uid=akarasuluref,ou=users,ou=system" ) );
         modifyDnRequest.setDeleteOldRdn( true );
         modifyDnRequest.addControl( manageDSAIT );
-    
+
         // ModifyDN success
         try
         {
@@ -167,11 +162,11 @@ public class ModifyDnReferralIT extends 
         {
             assertEquals( ResultCodeEnum.AFFECTS_MULTIPLE_DSAS, le.getResultCode() );
         }
-    
+
         conn.close();
     }
-    
-    
+
+
     /**
      * Tests ModifyDN operation on normal and referral entries without the
      * ManageDsaIT control. Referrals are sent back to the client with a
@@ -181,28 +176,28 @@ public class ModifyDnReferralIT extends 
     public void testOnReferral() throws Exception
     {
         LdapConnection conn = getWiredConnection( getLdapServer() );
-    
+
         // referrals failure
         ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();
         modifyDnRequest.setName( new Dn( "uid=akarasuluref,ou=users,ou=system" ) );
         modifyDnRequest.setNewRdn( new Rdn( "uid=ref" ) );
         modifyDnRequest.setDeleteOldRdn( true );
-    
+
         ModifyDnResponse modifyDnResponse = conn.modifyDn( modifyDnRequest );
-    
+
         assertEquals( ResultCodeEnum.REFERRAL, modifyDnResponse.getLdapResult().getResultCode() );
-    
+
         assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
             .contains( "ldap://localhost:10389/uid=akarasulu,ou=users,ou=system" ) );
         assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
             .contains( "ldap://foo:10389/uid=akarasulu,ou=users,ou=system" ) );
         assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
             .contains( "ldap://bar:10389/uid=akarasulu,ou=users,ou=system" ) );
-    
+
         conn.close();
     }
-    
-    
+
+
     /**
      * Tests ModifyDN operation on normal and referral entries without the
      * ManageDsaIT control. Referrals are sent back to the client with a
@@ -212,7 +207,7 @@ public class ModifyDnReferralIT extends 
     public void testNewSuperiorOnReferral() throws Exception
     {
         LdapConnection conn = getWiredConnection( getLdapServer() );
-    
+
         // referrals failure
         try
         {
@@ -222,11 +217,11 @@ public class ModifyDnReferralIT extends 
         {
             assertEquals( ResultCodeEnum.AFFECTS_MULTIPLE_DSAS, e.getResultCode() );
         }
-    
+
         conn.close();
     }
-    
-    
+
+
     /**
      * Tests ModifyDN operation on normal and referral entries without the
      * ManageDsaIT control using JNDI instead of the Netscape API. Referrals
@@ -236,7 +231,7 @@ public class ModifyDnReferralIT extends 
     public void testThrowOnReferralWithJndi() throws Exception
     {
         LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
-    
+
         // ModifyDN referrals failure
         try
         {
@@ -248,11 +243,11 @@ public class ModifyDnReferralIT extends 
             // 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.
      */
@@ -260,30 +255,30 @@ public class ModifyDnReferralIT extends 
     public void testAncestorReferral() throws Exception
     {
         LOG.debug( "" );
-    
+
         LdapConnection conn = getWiredConnection( getLdapServer() );
-    
+
         // referrals failure
         ModifyDnRequest modifyDnRequest = new ModifyDnRequestImpl();
         modifyDnRequest.setName( new Dn( "ou=Computers,uid=akarasuluref,ou=users,ou=system" ) );
         modifyDnRequest.setNewRdn( new Rdn( "ou=Machines" ) );
         modifyDnRequest.setDeleteOldRdn( true );
-    
+
         ModifyDnResponse modifyDnResponse = conn.modifyDn( modifyDnRequest );
-    
+
         assertEquals( ResultCodeEnum.REFERRAL, modifyDnResponse.getLdapResult().getResultCode() );
-    
+
         assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
             .contains( "ldap://localhost:10389/ou=Computers,uid=akarasulu,ou=users,ou=system" ) );
         assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
             .contains( "ldap://foo:10389/ou=Computers,uid=akarasulu,ou=users,ou=system" ) );
         assertTrue( modifyDnResponse.getLdapResult().getReferral().getLdapUrls()
             .contains( "ldap://bar:10389/ou=Computers,uid=akarasulu,ou=users,ou=system" ) );
-    
+
         conn.close();
     }
-    
-    
+
+
     /**
      * Tests referral handling when an ancestor is a referral.
      */
@@ -291,9 +286,9 @@ public class ModifyDnReferralIT extends 
     public void testNewSuperiorAncestorReferral() throws Exception
     {
         LOG.debug( "" );
-    
+
         LdapConnection conn = getWiredConnection( getLdapServer() );
-    
+
         // referrals failure
         try
         {
@@ -305,7 +300,7 @@ public class ModifyDnReferralIT extends 
         {
             assertEquals( ResultCodeEnum.AFFECTS_MULTIPLE_DSAS, e.getResultCode() );
         }
-    
+
         conn.close();
     }
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java Fri Aug  2 11:26:45 2013
@@ -22,10 +22,10 @@ package org.apache.directory.server.oper
 
 import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.fail;
 
 import javax.naming.NameNotFoundException;
@@ -41,7 +41,6 @@ import javax.naming.directory.SearchResu
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.ldif.LdifUtils;
-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;
@@ -50,7 +49,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.integ.ServerIntegrationUtils;
 import org.junit.Ignore;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -70,8 +68,6 @@ import org.junit.runner.RunWith;
     })
 public class ModifyRdnIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final String BASE = "ou=system";
 
 
@@ -127,11 +123,11 @@ public class ModifyRdnIT extends Abstrac
             "cn", oldCn,
             "sn: Amos",
             "description", oldCn + " is a person." );
-        
+
         connection.add( entry );
 
         Entry tori = connection.lookup( oldDn );
-        
+
         assertNotNull( tori );
         assertTrue( tori.contains( "cn", "Myra Ellen Amos" ) );
 
@@ -139,7 +135,7 @@ public class ModifyRdnIT extends Abstrac
         String newCn = "Tori Amos";
         String newRdn = "cn=" + newCn;
         String newDn = newRdn + "," + BASE;
-        
+
         connection.rename( oldDn, newRdn, true );
 
         // Check, whether old Entry does not exists

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java Fri Aug  2 11:26:45 2013
@@ -33,14 +33,12 @@ import javax.naming.directory.SearchResu
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException;
-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;
 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.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -83,8 +81,6 @@ import org.junit.runner.RunWith;
         "ou: child" })
 public class MoveIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final String DN = "uid=akarasulu,ou=users,ou=system";
     private static final String NEW_DN = "uid=akarasulu,ou=NewSuperior,ou=system";
     private static final String NEW_DN2 = "uid=elecharny,ou=NewSuperior,ou=system";

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java Fri Aug  2 11:26:45 2013
@@ -34,7 +34,6 @@ import javax.naming.directory.SearchCont
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.api.ldap.model.constants.SupportedSaslMechanisms;
-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,7 +47,6 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler;
 import org.apache.directory.server.ldap.handlers.sasl.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -128,34 +126,28 @@ import org.junit.runner.RunWith;
         "objectClass: uidObject",
         "uid: jnewbie",
         "cn: Joe Newbie",
-        "sn: Newbie"
-
-})
+        "sn: Newbie" })
 @CreateLdapServer(
-transports =
-    {
-        @CreateTransport(protocol = "LDAP")
-},
-saslMechanisms =
-    {
-        @SaslMechanism(name = SupportedSaslMechanisms.PLAIN, implClass = PlainMechanismHandler.class),
-        @SaslMechanism(name = SupportedSaslMechanisms.CRAM_MD5, implClass = CramMd5MechanismHandler.class),
-        @SaslMechanism(name = SupportedSaslMechanisms.DIGEST_MD5, implClass = DigestMd5MechanismHandler.class),
-        @SaslMechanism(name = SupportedSaslMechanisms.GSSAPI, implClass = GssapiMechanismHandler.class),
-        @SaslMechanism(name = SupportedSaslMechanisms.NTLM, implClass = NtlmMechanismHandler.class),
-        @SaslMechanism(name = SupportedSaslMechanisms.GSS_SPNEGO, implClass = NtlmMechanismHandler.class)
-},
-extendedOpHandlers =
-    {
-        StartTlsHandler.class,
-        StoredProcedureExtendedOperationHandler.class
-})
+    transports =
+        {
+            @CreateTransport(protocol = "LDAP")
+    },
+    saslMechanisms =
+        {
+            @SaslMechanism(name = SupportedSaslMechanisms.PLAIN, implClass = PlainMechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.CRAM_MD5, implClass = CramMd5MechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.DIGEST_MD5, implClass = DigestMd5MechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.GSSAPI, implClass = GssapiMechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.NTLM, implClass = NtlmMechanismHandler.class),
+            @SaslMechanism(name = SupportedSaslMechanisms.GSS_SPNEGO, implClass = NtlmMechanismHandler.class)
+    },
+    extendedOpHandlers =
+        {
+            StartTlsHandler.class,
+            StoredProcedureExtendedOperationHandler.class
+    })
 public class IndexedNegationSearchIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
-    
-    
     /**
      * Tests to make sure a negated search for OU of "test1" returns
      * those entries that do not have the OU attribute or do not have
@@ -169,8 +161,8 @@ public class IndexedNegationSearchIT ext
         assertTrue( contains( "uid=test2,ou=test,ou=system", results ) );
         assertTrue( contains( "uid=testNoOU,ou=test,ou=system", results ) );
     }
-    
-    
+
+
     /**
      * Tests to make sure a negated search for actors without ou
      * with value 'drama' returns those that do not have the attribute
@@ -188,8 +180,8 @@ public class IndexedNegationSearchIT ext
         assertTrue( contains( "uid=jnewbie,ou=actors,ou=system", results ) );
         assertEquals( 2, results.size() );
     }
-    
-    
+
+
     boolean contains( String dn, Set<SearchResult> results )
     {
         for ( SearchResult result : results )
@@ -199,11 +191,11 @@ public class IndexedNegationSearchIT ext
                 return true;
             }
         }
-    
+
         return false;
     }
-    
-    
+
+
     /**
      * Tests to make sure a negated search for actors without ou
      * with value 'drama' returns those that do not have the attribute
@@ -221,8 +213,8 @@ public class IndexedNegationSearchIT ext
         assertFalse( contains( "uid=jnewbie,ou=actors,ou=system", results ) );
         assertEquals( 1, results.size() );
     }
-    
-    
+
+
     Set<SearchResult> getActorResults( String filter ) throws Exception
     {
         DirContext ctx = getWiredContext( getLdapServer() );
@@ -234,14 +226,14 @@ public class IndexedNegationSearchIT ext
         {
             results.add( namingEnumeration.next() );
         }
-    
+
         namingEnumeration.close();
         ctx.close();
-    
+
         return results;
     }
-    
-    
+
+
     Set<SearchResult> getResults( String filter ) throws Exception
     {
         DirContext ctx = getWiredContext( getLdapServer() );
@@ -253,10 +245,10 @@ public class IndexedNegationSearchIT ext
         {
             results.add( namingEnumeration.next() );
         }
-    
+
         namingEnumeration.close();
         ctx.close();
-    
+
         return results;
     }
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java Fri Aug  2 11:26:45 2013
@@ -33,13 +33,11 @@ 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;
 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;
 
@@ -104,15 +102,9 @@ import org.junit.runner.RunWith;
         "objectClass: uidObject",
         "uid: jnewbie",
         "cn: Joe Newbie",
-        "sn: Newbie"
-
-})
+        "sn: Newbie" })
 public class NegationSearchIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
-    
-    
     /**
      * Tests to make sure a negated search for actors without ou
      * with value 'drama' returns those that do not have the attribute
@@ -129,8 +121,8 @@ public class NegationSearchIT extends Ab
         assertTrue( contains( "uid=jnewbie,ou=actors,ou=system", results ) );
         assertEquals( 2, results.size() );
     }
-    
-    
+
+
     /**
      * Tests to make sure a negated search for actors without ou
      * with value 'drama' returns those that do not have the attribute
@@ -147,8 +139,8 @@ public class NegationSearchIT extends Ab
         assertFalse( contains( "uid=jnewbie,ou=actors,ou=system", results ) );
         assertEquals( 1, results.size() );
     }
-    
-    
+
+
     boolean contains( String dn, Set<SearchResult> results )
     {
         for ( SearchResult result : results )
@@ -158,11 +150,11 @@ public class NegationSearchIT extends Ab
                 return true;
             }
         }
-    
+
         return false;
     }
-    
-    
+
+
     Set<SearchResult> getResults( String filter ) throws Exception
     {
         DirContext ctx = getWiredContext( getLdapServer() );
@@ -174,10 +166,10 @@ public class NegationSearchIT extends Ab
         {
             results.add( namingEnumeration.next() );
         }
-    
+
         namingEnumeration.close();
         ctx.close();
-    
+
         return results;
     }
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java Fri Aug  2 11:26:45 2013
@@ -54,7 +54,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.util.JndiUtils;
 import org.apache.directory.api.util.Strings;
-import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.ldap.client.api.EntryCursorImpl;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.server.annotations.CreateLdapServer;
@@ -63,7 +62,6 @@ 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.server.ldap.LdapServer;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -205,16 +203,12 @@ import org.junit.runner.RunWith;
         "objectClass: person",
         "cn: user",
         "userPassword: secret",
-        "sn: user"
-})
+        "sn: user" })
 public class PagedSearchIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
-    
     private LdapApiService codec = LdapApiServiceFactory.getSingleton();
-    
-    
+
+
     /**
      * Create the searchControls with a paged size
      * @throws EncoderException on codec failures
@@ -227,14 +221,14 @@ public class PagedSearchIT extends Abstr
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         PagedResultsDecorator pagedSearchControl = new PagedResultsDecorator( codec );
         pagedSearchControl.setSize( pagedSize );
-    
+
         ( ( LdapContext ) ctx ).setRequestControls( JndiUtils.toJndiControls( codec, new Control[]
             { pagedSearchControl } ) );
-    
+
         return controls;
     }
-    
-    
+
+
     /**
      * Create the searchControls with a paged size
      * @throws EncoderException on codec failures
@@ -248,8 +242,8 @@ public class PagedSearchIT extends Abstr
         ( ( LdapContext ) ctx ).setRequestControls( JndiUtils.toJndiControls( codec, new Control[]
             { pagedSearchControl } ) );
     }
-    
-    
+
+
     /**
      * Check that we got the correct result set
      */
@@ -257,26 +251,26 @@ public class PagedSearchIT extends Abstr
     {
         assertEquals( expectedSize, results.size() );
         Set<String> expected = new HashSet<String>();
-    
+
         for ( int i = 0; i < 10; i++ )
         {
             expected.add( "user" + i );
         }
-    
+
         // check that we have correctly read all the entries
         for ( int i = 0; i < expectedSize; i++ )
         {
             SearchResult entry = results.get( i );
             String user = ( String ) entry.getAttributes().get( "cn" ).get();
             assertTrue( expected.contains( user ) );
-    
+
             expected.remove( user );
         }
-    
+
         assertEquals( 10 - expectedSize, expected.size() );
     }
-    
-    
+
+
     /**
      * Do the loop over the entries, until we can't get any more, or until we
      * reach a limit. It will check that we have got all the expected entries.
@@ -289,16 +283,16 @@ public class PagedSearchIT extends Abstr
         int loop = 0;
         boolean hasSizeLimitException = false;
         List<SearchResult> results = new ArrayList<SearchResult>();
-    
+
         while ( true )
         {
             loop++;
             NamingEnumeration<SearchResult> list = null;
-    
+
             try
             {
                 list = ctx.search( "dc=users,ou=system", "(cn=*)", controls );
-    
+
                 while ( list.hasMore() )
                 {
                     SearchResult result = list.next();
@@ -318,36 +312,36 @@ public class PagedSearchIT extends Abstr
                     list.close();
                 }
             }
-    
+
             // Now read the next ones
             javax.naming.ldap.Control[] responseControls = ( ( LdapContext ) ctx ).getResponseControls();
-    
+
             PagedResultsResponseControl responseControl =
                 ( PagedResultsResponseControl ) responseControls[0];
             assertEquals( 0, responseControl.getResultSize() );
-    
+
             // check if this is over
             byte[] cookie = responseControl.getCookie();
-    
+
             if ( Strings.isEmpty( cookie ) )
             {
                 // If so, exit the loop
                 break;
             }
-    
+
             // Prepare the next iteration
             createNextSearchControls( ctx, responseControl.getCookie(), pagedSizeLimit );
         }
-    
+
         assertEquals( expectedException, hasSizeLimitException );
         assertEquals( expectedLoop, loop );
         checkResults( results, expectedNbEntries );
-    
+
         // And close the connection
         closeConnection( ctx );
     }
-    
-    
+
+
     /**
      * Close a connection, and wait a bit to be sure it's done
      */
@@ -356,7 +350,7 @@ public class PagedSearchIT extends Abstr
         if ( ctx != null )
         {
             ctx.close();
-    
+
             try
             {
                 Thread.sleep( 10 );
@@ -366,8 +360,8 @@ public class PagedSearchIT extends Abstr
             }
         }
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = none<br>
@@ -382,11 +376,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 3 );
-    
+
         doLoop( ctx, controls, 3, 4, 10, false );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = none<br>
@@ -401,11 +395,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 5 );
-    
+
         doLoop( ctx, controls, 5, 2, 10, false );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 3<br>
@@ -420,11 +414,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 3 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 5 );
-    
+
         doLoop( ctx, controls, 5, 2, 10, false );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = none<br>
@@ -439,11 +433,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 3, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 5<br>
@@ -458,11 +452,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 3 );
-    
+
         doLoop( ctx, controls, 3, 4, 10, false );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = none<br>
@@ -477,11 +471,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 9, 5 );
-    
+
         doLoop( ctx, controls, 5, 2, 9, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 5<br>
@@ -496,11 +490,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 5 );
-    
+
         doLoop( ctx, controls, 5, 2, 10, false );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = none<br>
@@ -515,11 +509,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 5, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 5<br>
@@ -534,11 +528,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 4, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 4, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 4<br>
@@ -553,11 +547,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 4 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 5, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 5<br>
@@ -572,11 +566,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 3, 4 );
-    
+
         doLoop( ctx, controls, 4, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 5<br>
@@ -591,11 +585,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 4, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 4, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 4<br>
@@ -610,11 +604,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 4 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 5, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 4<br>
@@ -629,11 +623,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 4 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 3, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 3<br>
@@ -648,11 +642,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 3 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 5, 4 );
-    
+
         doLoop( ctx, controls, 4, 2, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 3<br>
@@ -667,11 +661,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 3 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 4, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 4, true );
     }
-    
-    
+
+
     /**
      * Admin = yes <br>
      * SL = 5<br>
@@ -686,11 +680,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer() );
         SearchControls controls = createSearchControls( ctx, 5, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = none<br>
@@ -705,11 +699,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 3 );
-    
+
         doLoop( ctx, controls, 3, 4, 10, false );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = none<br>
@@ -724,11 +718,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 5 );
-    
+
         doLoop( ctx, controls, 5, 2, 10, false );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 3<br>
@@ -743,11 +737,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 3 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = none<br>
@@ -762,11 +756,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 3, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 5<br>
@@ -781,11 +775,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = none<br>
@@ -800,11 +794,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 9, 5 );
-    
+
         doLoop( ctx, controls, 5, 2, 9, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 5<br>
@@ -819,11 +813,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = none<br>
@@ -838,11 +832,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 5, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 5<br>
@@ -857,11 +851,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 4, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 4, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 4<br>
@@ -876,11 +870,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 4 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 5, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 4, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 5<br>
@@ -895,11 +889,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 3, 4 );
-    
+
         doLoop( ctx, controls, 4, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 5<br>
@@ -914,11 +908,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 4, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 4, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 4<br>
@@ -933,11 +927,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 4 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 5, 3 );
-    
+
         doLoop( ctx, controls, 3, 2, 4, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 4<br>
@@ -952,11 +946,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 4 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 3, 5 );
-    
+
         doLoop( ctx, controls, 3, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 3<br>
@@ -971,11 +965,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 3 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 5, 4 );
-    
+
         doLoop( ctx, controls, 3, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 3<br>
@@ -990,11 +984,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 3 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 4, 5 );
-    
+
         doLoop( ctx, controls, 3, 1, 3, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = 5<br>
@@ -1009,11 +1003,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( 5 );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, 5, 5 );
-    
+
         doLoop( ctx, controls, 5, 1, 5, true );
     }
-    
-    
+
+
     /**
      * Admin = no <br>
      * SL = none<br>
@@ -1028,11 +1022,11 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, -2 );
-    
+
         doLoop( ctx, controls, -2, 1, 10, false );
     }
-    
-    
+
+
     /**
      * Do a test with a paged search and send a wrong cookie in the middle
      */
@@ -1041,24 +1035,24 @@ public class PagedSearchIT extends Abstr
     {
         LdapNetworkConnection connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
         connection.bind( "uid=admin,ou=system", "secret" );
-    
+
         SearchControls controls = new SearchControls();
         controls.setCountLimit( ( int ) LdapServer.NO_SIZE_LIMIT );
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         PagedResults pagedSearchControl = new PagedResultsDecorator( codec );
         pagedSearchControl.setSize( 3 );
-    
+
         // Loop over all the elements
         int loop = 0;
         List<Entry> results = new ArrayList<Entry>();
         boolean hasUnwillingToPerform = false;
-    
+
         while ( true )
         {
             loop++;
-    
+
             EntryCursor cursor = null;
-    
+
             try
             {
                 SearchRequest searchRequest = new SearchRequestImpl();
@@ -1067,21 +1061,21 @@ public class PagedSearchIT extends Abstr
                 searchRequest.setScope( SearchScope.SUBTREE );
                 searchRequest.addAttributes( "*" );
                 searchRequest.addControl( pagedSearchControl );
-    
+
                 cursor = new EntryCursorImpl( connection.search( searchRequest ) );
-    
+
                 int i = 0;
-    
+
                 while ( cursor.next() )
                 {
                     Entry result = cursor.get();
                     results.add( result );
                     ++i;
                 }
-    
+
                 SearchResultDone result = cursor.getSearchResultDone();
                 pagedSearchControl = ( PagedResults ) result.getControl( PagedResults.OID );
-    
+
                 if ( result.getLdapResult().getResultCode() == ResultCodeEnum.UNWILLING_TO_PERFORM )
                 {
                     hasUnwillingToPerform = true;
@@ -1095,32 +1089,32 @@ public class PagedSearchIT extends Abstr
                     cursor.close();
                 }
             }
-    
+
             // Now read the next ones
             assertEquals( 0, pagedSearchControl.getSize() );
-    
+
             // check if this is over
             byte[] cookie = pagedSearchControl.getCookie();
-    
+
             if ( Strings.isEmpty( cookie ) )
             {
                 // If so, exit the loop
                 break;
             }
-    
+
             // Prepare the next iteration, sending a bad cookie
             pagedSearchControl.setCookie( "test".getBytes( "UTF-8" ) );
             pagedSearchControl.setSize( 3 );
         }
-    
+
         assertTrue( hasUnwillingToPerform );
-    
+
         // Cleanup the session
         connection.unBind();
         connection.close();
     }
-    
-    
+
+
     /**
      * Do a test with a paged search, changing the number of entries to
      * return in the middle of the loop
@@ -1131,52 +1125,52 @@ public class PagedSearchIT extends Abstr
         getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
         DirContext ctx = getWiredContext( getLdapServer(), "cn=user,ou=system", "secret" );
         SearchControls controls = createSearchControls( ctx, ( int ) LdapServer.NO_SIZE_LIMIT, 4 );
-    
+
         // Loop over all the elements
         int loop = 0;
         List<SearchResult> results = new ArrayList<SearchResult>();
-    
+
         // The expected size after each loop.
         int[] expectedSize = new int[]
             { 4, 7, 9, 10 };
-    
+
         while ( true )
         {
             loop++;
-    
+
             NamingEnumeration<SearchResult> list =
                 ctx.search( "dc=users,ou=system", "(cn=*)", controls );
-    
+
             while ( list.hasMore() )
             {
                 SearchResult result = list.next();
                 results.add( result );
             }
-    
+
             list.close();
-    
+
             // Now read the next ones
             javax.naming.ldap.Control[] responseControls = ( ( LdapContext ) ctx ).getResponseControls();
-    
+
             PagedResultsResponseControl responseControl =
                 ( PagedResultsResponseControl ) responseControls[0];
             assertEquals( 0, responseControl.getResultSize() );
-    
+
             // check if this is over
             byte[] cookie = responseControl.getCookie();
-    
+
             if ( Strings.isEmpty( cookie ) )
             {
                 // If so, exit the loop
                 break;
             }
-    
+
             // Prepare the next iteration, sending a bad cookie
             createNextSearchControls( ctx, responseControl.getCookie(), 4 - loop );
-    
+
             assertEquals( expectedSize[loop - 1], results.size() );
         }
-    
+
         assertEquals( 4, loop );
         checkResults( results, 10 );
     }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java Fri Aug  2 11:26:45 2013
@@ -55,7 +55,6 @@ import org.apache.directory.api.ldap.mod
 import org.apache.directory.api.ldap.model.message.controls.PersistentSearch;
 import org.apache.directory.api.ldap.model.message.controls.PersistentSearchImpl;
 import org.apache.directory.api.ldap.util.JndiUtils;
-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;
@@ -64,7 +63,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.junit.After;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -90,19 +88,16 @@ import org.slf4j.LoggerFactory;
         "objectClass: top",
         "cn: Tori Amos",
         "description: an American singer-songwriter",
-        "sn: Amos"
-})
+        "sn: Amos" })
 public class PersistentSearchIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final Logger LOG = LoggerFactory.getLogger( PersistentSearchIT.class );
-    
+
     private static final String BASE = "ou=system";
     private static final String PERSON_DESCRIPTION = "an American singer-songwriter";
     private static final String RDN = "cn=Tori Amos";
-    
-    
+
+
     /**
      * Creation of required attributes of a person entry.
      */
@@ -113,89 +108,89 @@ public class PersistentSearchIT extends 
             "objectClass: person",
             "cn", cn,
             "sn", sn );
-    
+
         return attributes;
     }
-    
+
     EventDirContext ctx;
     EventService eventService;
     PSearchListener listener;
     Thread t;
-    
-    
+
+
     private void setUpListenerReturnECs() throws Exception
     {
         setUpListener( true, new PersistentSearchImpl(), false );
     }
-    
-    
+
+
     private void setUpListener( boolean returnECs, PersistentSearch persistentSearch, boolean ignoreEmptyRegistryCheck )
         throws Exception
     {
         ctx = ( EventDirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
         eventService = getLdapServer().getDirectoryService().getEventService();
         List<RegistrationEntry> registrationEntryList = eventService.getRegistrationEntries();
-    
+
         if ( !ignoreEmptyRegistryCheck )
         {
             assertTrue( registrationEntryList.isEmpty() );
         }
-    
+
         persistentSearch.setReturnECs( returnECs );
         listener = new PSearchListener( persistentSearch );
         t = new Thread( listener, "PSearchListener" );
         t.start();
-    
+
         // let's wait until the listener thread started
         while ( eventService.getRegistrationEntries().isEmpty() )
         {
             Thread.sleep( 100 );
         }
-    
+
         // Now we wait until the listener is registered (timing dependent crap)
         Thread.sleep( 250 );
     }
-    
-    
+
+
     private void setUpListener() throws Exception
     {
         ctx = ( EventDirContext ) getWiredContext( getLdapServer() ).lookup( BASE );
         eventService = getLdapServer().getDirectoryService().getEventService();
         List<RegistrationEntry> registrationEntryList = eventService.getRegistrationEntries();
         assertTrue( registrationEntryList.isEmpty() );
-    
+
         listener = new PSearchListener();
         t = new Thread( listener, "PSearchListener" );
         t.start();
-    
+
         // let's wait until the listener thread started
         while ( eventService.getRegistrationEntries().isEmpty() )
         {
             Thread.sleep( 100 );
         }
-    
+
         // Now we wait until the listener is registered (timing dependent crap)
         Thread.sleep( 250 );
     }
-    
-    
+
+
     @After
     public void tearDownListener() throws Exception
     {
         listener.close();
         ctx.close();
-    
+
         while ( !eventService.getRegistrationEntries().isEmpty() )
         {
             Thread.sleep( 100 );
         }
     }
-    
-    
+
+
     private void waitForThreadToDie( Thread t ) throws Exception
     {
         long start = System.currentTimeMillis();
-    
+
         while ( t.isAlive() )
         {
             Thread.sleep( 200 );
@@ -205,8 +200,8 @@ public class PersistentSearchIT extends 
             }
         }
     }
-    
-    
+
+
     /**
      * Shows correct notifications for modify(4) changes.
      */
@@ -220,8 +215,8 @@ public class PersistentSearchIT extends 
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for moddn(8) changes.
      */
@@ -234,8 +229,8 @@ public class PersistentSearchIT extends 
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for delete(2) changes.
      */
@@ -248,8 +243,8 @@ public class PersistentSearchIT extends 
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for add(1) changes.
      */
@@ -262,8 +257,8 @@ public class PersistentSearchIT extends 
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for modify(4) changes with returned
      * EntryChangeControl.
@@ -279,8 +274,8 @@ public class PersistentSearchIT extends 
         assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for moddn(8) changes with returned
      * EntryChangeControl.
@@ -296,8 +291,8 @@ public class PersistentSearchIT extends 
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODDN );
         assertEquals( ( RDN + ",ou=system" ), listener.result.control.getPreviousDn().getName() );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for delete(2) changes with returned
      * EntryChangeControl.
@@ -312,8 +307,8 @@ public class PersistentSearchIT extends 
         assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.DELETE );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for add(1) changes with returned
      * EntryChangeControl.
@@ -328,8 +323,8 @@ public class PersistentSearchIT extends 
         assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
     }
-    
-    
+
+
     /**
      * Shows correct notifications for only add(1) and modify(4) registered changes with returned
      * EntryChangeControl but not deletes.
@@ -344,27 +339,27 @@ public class PersistentSearchIT extends 
         setUpListener( true, ctrl, false );
         ctx.createSubcontext( "cn=Jack Black", getPersonAttributes( "Black", "Jack Black" ) );
         waitForThreadToDie( t );
-    
+
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
         tearDownListener();
-    
+
         setUpListener( true, ctrl, true );
         ctx.destroySubcontext( "cn=Jack Black" );
         waitForThreadToDie( t );
         assertNull( listener.result );
-    
+
         // thread is still waiting for notifications try a modify
         ctx.modifyAttributes( RDN, DirContext.REMOVE_ATTRIBUTE, new BasicAttributes( "description", PERSON_DESCRIPTION,
             true ) );
         waitForThreadToDie( t );
-    
+
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
     }
-    
+
     /**
      * Shows correct notifications for add(1) changes with returned
      * EntryChangeControl and changesOnly set to false so we return
@@ -404,7 +399,7 @@ public class PersistentSearchIT extends 
     //        assertEquals( "cn=Jack Black", listener.result.getName() );
     //        assertEquals( listener.result.decorator.getChangeType(), ChangeType.ADD );
     //    }
-    
+
     /**
      * Shows notifications functioning with the JNDI notification API of the SUN
      * provider.
@@ -481,46 +476,46 @@ public class PersistentSearchIT extends 
         //assertEquals( Rdn, listener.result.getName() );
         //assertEquals( listener.result.decorator.getChangeType(), ChangeType.MODIFY );
     }*/
-    
+
     class JndiNotificationListener implements NamespaceChangeListener, ObjectChangeListener
     {
         boolean hasError = false;
         ArrayList<EventObject> list = new ArrayList<EventObject>();
         NamingExceptionEvent exceptionEvent = null;
-    
-    
+
+
         public void objectAdded( NamingEvent evt )
         {
             list.add( 0, evt );
         }
-    
-    
+
+
         public void objectRemoved( NamingEvent evt )
         {
             list.add( 0, evt );
         }
-    
-    
+
+
         public void objectRenamed( NamingEvent evt )
         {
             list.add( 0, evt );
         }
-    
-    
+
+
         public void namingExceptionThrown( NamingExceptionEvent evt )
         {
             hasError = true;
             exceptionEvent = evt;
             list.add( 0, evt );
         }
-    
-    
+
+
         public void objectChanged( NamingEvent evt )
         {
             list.add( 0, evt );
         }
     }
-    
+
     class PSearchListener implements Runnable
     {
         boolean isReady = false;
@@ -528,22 +523,23 @@ public class PersistentSearchIT extends 
         final PersistentSearchDecorator persistentSearch;
         LdapContext ctx;
         NamingEnumeration<SearchResult> list;
-    
-    
+
+
         PSearchListener()
         {
-            persistentSearch = new PersistentSearchDecorator( getLdapServer().getDirectoryService().getLdapCodecService() );
+            persistentSearch = new PersistentSearchDecorator( getLdapServer().getDirectoryService()
+                .getLdapCodecService() );
         }
-    
-    
+
+
         PSearchListener( PersistentSearch persistentSearch )
         {
             CodecControl<? extends Control> wrapped =
                 getLdapServer().getDirectoryService().getLdapCodecService().newControl( persistentSearch );
             this.persistentSearch = ( PersistentSearchDecorator ) wrapped;
         }
-    
-    
+
+
         void close()
         {
             if ( list != null )
@@ -558,7 +554,7 @@ public class PersistentSearchIT extends 
                     LOG.error( "Error closing NamingEnumeration on PSearchListener", e );
                 }
             }
-    
+
             if ( ctx != null )
             {
                 try
@@ -572,18 +568,18 @@ public class PersistentSearchIT extends 
                 }
             }
         }
-    
-    
+
+
         public void run()
         {
             LOG.debug( "PSearchListener.run() called." );
             LdapApiService codec = getLdapServer().getDirectoryService().getLdapCodecService();
             persistentSearch.setCritical( true );
             persistentSearch.setValue( persistentSearch.getValue() );
-    
+
             Control[] ctxCtls = new Control[]
                 { persistentSearch };
-    
+
             try
             {
                 ctx = ( LdapContext ) getWiredContext( getLdapServer() ).lookup( BASE );
@@ -593,17 +589,17 @@ public class PersistentSearchIT extends 
                 list = ctx.search( "", "objectClass=*", null );
                 LOG.debug( "PSearchListener search request returned." );
                 EntryChange ecControl = null;
-    
+
                 while ( list.hasMore() )
                 {
                     LOG.debug( "PSearchListener search request got an item." );
                     javax.naming.ldap.Control[] controls;
                     SearchResult sresult = list.next();
-    
+
                     if ( sresult instanceof HasControls )
                     {
                         controls = ( ( HasControls ) sresult ).getControls();
-    
+
                         if ( controls != null )
                         {
                             for ( javax.naming.ldap.Control jndiControl : controls )
@@ -617,11 +613,11 @@ public class PersistentSearchIT extends 
                             }
                         }
                     }
-    
+
                     result = new PSearchNotification( sresult, ecControl );
                     break;
                 }
-    
+
                 LOG.debug( "PSearchListener broke out of while loop." );
             }
             catch ( Exception e )
@@ -634,26 +630,26 @@ public class PersistentSearchIT extends 
             }
         }
     }
-    
+
     class PSearchNotification extends SearchResult
     {
         private static final long serialVersionUID = 1L;
         final EntryChange control;
-    
-    
+
+
         public PSearchNotification( SearchResult result, EntryChange control )
         {
             super( result.getName(), result.getClassName(), result.getObject(), result.getAttributes(), result
                 .isRelative() );
             this.control = control;
         }
-    
-    
+
+
         public String toString()
         {
             StringBuffer buf = new StringBuffer();
             buf.append( "Dn: " ).append( getName() ).append( "\n" );
-    
+
             if ( control != null )
             {
                 buf.append( "    EntryChangeControl =\n" );
@@ -661,7 +657,7 @@ public class PersistentSearchIT extends 
                 buf.append( "       previousDN   : " ).append( control.getPreviousDn() ).append( "\n" );
                 buf.append( "       changeNumber : " ).append( control.getChangeNumber() ).append( "\n" );
             }
-    
+
             return buf.toString();
         }
     }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java Fri Aug  2 11:26:45 2013
@@ -48,14 +48,12 @@ import javax.naming.ldap.ManageReferralC
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.ldif.LdifEntry;
 import org.apache.directory.api.ldap.model.ldif.LdifReader;
-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.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -122,13 +120,9 @@ import org.junit.runner.RunWith;
         "dn: ou=Countries,ou=system",
         "objectClass: top",
         "objectClass: organizationalUnit",
-        "ou: Countries"
-})
+        "ou: Countries" })
 public class ReferralSearchIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
-
     @Before
     public void setupReferrals() throws Exception
     {
@@ -139,27 +133,27 @@ public class ReferralSearchIT extends Ab
                 "objectClass: extensibleObject\n" +
                 "c: europ\n" +
                 "ref: ldap://localhost:" + getLdapServer().getPort() + "/c=france,ou=system\n\n" +
-    
+
                 "dn: c=america,ou=Countries,ou=system\n" +
                 "objectClass: top\n" +
                 "objectClass: referral\n" +
                 "objectClass: extensibleObject\n" +
                 "c: america\n" +
                 "ref: ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system\n\n";
-    
+
         LdifReader reader = new LdifReader( new StringReader( ldif ) );
-    
+
         while ( reader.hasNext() )
         {
             LdifEntry entry = reader.next();
             getLdapServer().getDirectoryService().getAdminSession().add(
                 new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(), entry.getEntry() ) );
         }
-        
+
         reader.close();
     }
-    
-    
+
+
     @Test
     public void testSearchBaseIsReferral() throws Exception
     {
@@ -186,15 +180,15 @@ public class ReferralSearchIT extends Ab
             ctx.close();
         }
     }
-    
-    
+
+
     @Test
     public void testSearchBaseParentIsReferral() throws Exception
     {
         DirContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    
+
         try
         {
             ctx.search( "cn=alex karasulu,ou=RemoteUsers,ou=system", "(objectClass=*)", controls );
@@ -213,22 +207,23 @@ public class ReferralSearchIT extends Ab
             ctx.close();
         }
     }
-    
-    
+
+
     @Test
     public void testSearchBaseAncestorIsReferral() throws Exception
     {
         DirContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    
+
         try
         {
             ctx.search( "cn=alex karasulu,ou=apache,ou=RemoteUsers,ou=system", "(objectClass=*)", controls );
         }
         catch ( ReferralException e )
         {
-            assertEquals( "ldap://fermi:10389/cn=alex%20karasulu,ou=apache,ou=users,ou=system??base", e.getReferralInfo() );
+            assertEquals( "ldap://fermi:10389/cn=alex%20karasulu,ou=apache,ou=users,ou=system??base",
+                e.getReferralInfo() );
             assertTrue( e.skipReferral() );
             assertEquals( "ldap://hertz:10389/cn=alex%20karasulu,ou=apache,ou=users,dc=example,dc=com??base", e
                 .getReferralInfo() );
@@ -242,13 +237,13 @@ public class ReferralSearchIT extends Ab
             ctx.close();
         }
     }
-    
-    
+
+
     @Test
     public void testSearchContinuations() throws Exception
     {
         DirContext ctx = getWiredContext( getLdapServer() );
-    
+
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         NamingEnumeration<SearchResult> list = ctx.search( "ou=system", "(objectClass=*)", controls );
@@ -258,17 +253,17 @@ public class ReferralSearchIT extends Ab
             SearchResult result = list.next();
             results.put( result.getName(), result );
         }
-    
+
         assertNotNull( results.get( "ou=users" ) );
-    
+
         // -------------------------------------------------------------------
         // Now we will throw exceptions when searching for referrals
         // -------------------------------------------------------------------
-    
+
         ctx.addToEnvironment( Context.REFERRAL, "throw" );
         list = ctx.search( "ou=system", "(objectClass=*)", controls );
         results = new HashMap<String, SearchResult>();
-    
+
         try
         {
             while ( list.hasMore() )
@@ -284,7 +279,7 @@ public class ReferralSearchIT extends Ab
             // an hashset and check afterwards if the expected URLs are included.
             Set<Object> s = new HashSet<Object>();
             s.add( e.getReferralInfo() );
-            
+
             while ( e.skipReferral() )
             {
                 try
@@ -305,22 +300,22 @@ public class ReferralSearchIT extends Ab
                     }
                 }
             }
-    
+
             assertEquals( 5, s.size() );
             assertTrue( s.contains( "ldap://fermi:10389/ou=users,ou=system??sub" ) );
             assertTrue( s.contains( "ldap://hertz:10389/ou=users,dc=example,dc=com??sub" ) );
             assertTrue( s.contains( "ldap://maxwell:10389/ou=users,ou=system??sub" ) );
         }
-    
+
         assertNull( results.get( "ou=remoteusers" ) );
         list.close();
-    
+
         // try again but this time with single level scope
-    
+
         controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
         list = ctx.search( "ou=system", "(objectClass=*)", controls );
         results = new HashMap<String, SearchResult>();
-    
+
         try
         {
             while ( list.hasMore() )
@@ -337,14 +332,14 @@ public class ReferralSearchIT extends Ab
             assertTrue( e.skipReferral() );
             assertEquals( "ldap://maxwell:10389/ou=users,ou=system??base", e.getReferralInfo() );
         }
-        
+
         list.close();
         ctx.close();
 
         assertNull( results.get( "ou=remoteusers" ) );
     }
-    
-    
+
+
     /**
      * Test of an search operation with a referral
      *
@@ -356,7 +351,7 @@ public class ReferralSearchIT extends Ab
     public void testSearchWithReferralThrow() throws Exception
     {
         DirContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
-    
+
         try
         {
             SearchControls controls = new SearchControls();
@@ -374,8 +369,8 @@ public class ReferralSearchIT extends Ab
             ctx.close();
         }
     }
-    
-    
+
+
     /**
      * Test of an search operation with a referral
      *
@@ -387,10 +382,10 @@ public class ReferralSearchIT extends Ab
     public void testSearchBaseWithReferralThrow() throws Exception
     {
         DirContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
-    
+
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    
+
         try
         {
             ctx.search( "c=america,ou=Countries,ou=system", "(cn=alex karasulu)", controls );
@@ -406,8 +401,8 @@ public class ReferralSearchIT extends Ab
             ctx.close();
         }
     }
-    
-    
+
+
     /**
      * Test of an search operation with a referral after the entry
      * has been renamed.
@@ -420,10 +415,10 @@ public class ReferralSearchIT extends Ab
     public void testSearchBaseWithReferralThrowAfterRename() throws Exception
     {
         DirContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
-    
+
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    
+
         try
         {
             ctx.search( "c=america,ou=Countries,ou=system", "(cn=alex karasulu)", controls );
@@ -434,18 +429,18 @@ public class ReferralSearchIT extends Ab
             String referral = ( String ) re.getReferralInfo();
             assertEquals( "ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system??base", referral );
         }
-    
+
         ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
             { new ManageReferralControl() } );
-    
+
         // Now let's move the entry
         ctx.rename( "c=america,ou=Countries,ou=system", "c=USA,ou=Countries,ou=system" );
-    
+
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    
+
         ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
             {} );
-    
+
         try
         {
             ctx.search( "c=usa,ou=Countries,ou=system", "(cn=alex karasulu)", controls );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java?rev=1509635&r1=1509634&r2=1509635&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java Fri Aug  2 11:26:45 2013
@@ -37,14 +37,12 @@ import javax.naming.ldap.ManageReferralC
 import org.apache.directory.api.ldap.model.entry.DefaultEntry;
 import org.apache.directory.api.ldap.model.ldif.LdifEntry;
 import org.apache.directory.api.ldap.model.ldif.LdifReader;
-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.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -111,18 +109,14 @@ import org.junit.runner.RunWith;
         "dn: ou=Countries,ou=system",
         "objectClass: top",
         "objectClass: organizationalUnit",
-        "ou: Countries"
-})
+        "ou: Countries" })
 public class ReferralSearchMoveAndRenameIT extends AbstractLdapTestUnit
 {
-    @Rule
-    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
-
     @Before
     public void setupReferrals() throws Exception
     {
         getLdapServer().getDirectoryService().getChangeLog().setEnabled( false );
-    
+
         String ldif =
             "dn: c=europ,ou=Countries,ou=system\n" +
                 "objectClass: top\n" +
@@ -130,27 +124,27 @@ public class ReferralSearchMoveAndRename
                 "objectClass: extensibleObject\n" +
                 "c: europ\n" +
                 "ref: ldap://localhost:" + getLdapServer().getPort() + "/c=france,ou=system\n\n" +
-    
+
                 "dn: c=america,ou=Countries,ou=system\n" +
                 "objectClass: top\n" +
                 "objectClass: referral\n" +
                 "objectClass: extensibleObject\n" +
                 "c: america\n" +
                 "ref: ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system\n\n";
-    
+
         LdifReader reader = new LdifReader( new StringReader( ldif ) );
-    
+
         while ( reader.hasNext() )
         {
             LdifEntry entry = reader.next();
             getLdapServer().getDirectoryService().getAdminSession().add(
                 new DefaultEntry( getLdapServer().getDirectoryService().getSchemaManager(), entry.getEntry() ) );
         }
-        
+
         reader.close();
     }
-    
-    
+
+
     /**
      * Test of an search operation with a referral after the entry
      * has been moved.
@@ -163,10 +157,10 @@ public class ReferralSearchMoveAndRename
     public void testSearchBaseWithReferralThrowAfterMoveAndRename() throws Exception
     {
         DirContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );
-    
+
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    
+
         try
         {
             ctx.search( "c=america,ou=Countries,ou=system", "(cn=alex karasulu)", controls );
@@ -177,22 +171,22 @@ public class ReferralSearchMoveAndRename
             String referral = ( String ) re.getReferralInfo();
             assertEquals( "ldap://localhost:" + getLdapServer().getPort() + "/c=usa,ou=system??base", referral );
         }
-    
+
         ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
             { new ManageReferralControl() } );
-    
+
         // Now let's move the entry
         ctx.rename( "c=america,ou=Countries,ou=system", "c=us,ou=system" );
-    
+
         controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    
+
         ( ( LdapContext ) ctx ).setRequestControls( new javax.naming.ldap.Control[]
             {} );
-    
+
         try
         {
             NamingEnumeration<SearchResult> results = ctx.search( "c=us,ou=system", "(cn=alex karasulu)", controls );
-    
+
             results.next();
             fail( "Should fail here throwing a ReferralException" );
         }



Mime
View raw message