directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1334639 [5/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
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java Sun May  6 14:25:18 2012
@@ -35,11 +35,13 @@ 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;
 
@@ -166,197 +168,199 @@ import org.junit.runner.RunWith;
 })
 public class SchemaSearchIT extends AbstractLdapTestUnit
 {
-private static final String DN = "cn=schema";
-private static final String FILTER = "(objectclass=subschema)";
-
-
-protected void checkForAttributes( Attributes attrs, String[] attrNames )
-{
-    for ( int i = 0; i < attrNames.length; i++ )
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+    private static final String DN = "cn=schema";
+    private static final String FILTER = "(objectclass=subschema)";
+    
+    
+    protected void checkForAttributes( Attributes attrs, String[] attrNames )
     {
-        String attrName = attrNames[i];
-
-        assertNotNull( "Check if attr " + attrName + " is present", attrs.get( attrNames[i] ) );
-    }
-}
-
-
-/**
- * Check if modifyTimestamp and createTimestamp are present in the search result,
- * if they are requested.
- */
-@Test
-public void testRequestOperationalAttributes() throws Exception
-{
-    DirContext ctx = getWiredContext( getLdapServer() );
-    SearchControls ctls = new SearchControls();
-
-    String[] attrNames =
-        { "creatorsName", "createTimestamp", "modifiersName", "modifyTimestamp" };
-
-    ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    ctls.setReturningAttributes( attrNames );
-
-    NamingEnumeration<SearchResult> result = ctx.search( DN, FILTER, ctls );
-
-    if ( result.hasMore() )
-    {
-        SearchResult entry = result.next();
-        checkForAttributes( entry.getAttributes(), attrNames );
-    }
-    else
-    {
-        fail( "entry " + DN + " not found" );
+        for ( int i = 0; i < attrNames.length; i++ )
+        {
+            String attrName = attrNames[i];
+    
+            assertNotNull( "Check if attr " + attrName + " is present", attrs.get( attrNames[i] ) );
+        }
     }
-
-    result.close();
-}
-
-
-/**
- * Check if modifyTimestamp and createTimestamp are present in the search result,
- * if + is requested.
- */
-@Test
-public void testRequestAllOperationalAttributes() throws Exception
-{
-    DirContext ctx = getWiredContext( getLdapServer() );
-    SearchControls ctls = new SearchControls();
-
-    ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    ctls.setReturningAttributes( new String[]
-        { "+" } );
-
-    NamingEnumeration<SearchResult> result = ctx.search( DN, FILTER, ctls );
-
-    if ( result.hasMore() )
+    
+    
+    /**
+     * Check if modifyTimestamp and createTimestamp are present in the search result,
+     * if they are requested.
+     */
+    @Test
+    public void testRequestOperationalAttributes() throws Exception
     {
-        SearchResult entry = result.next();
+        DirContext ctx = getWiredContext( getLdapServer() );
+        SearchControls ctls = new SearchControls();
+    
         String[] attrNames =
             { "creatorsName", "createTimestamp", "modifiersName", "modifyTimestamp" };
-        checkForAttributes( entry.getAttributes(), attrNames );
+    
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+        ctls.setReturningAttributes( attrNames );
+    
+        NamingEnumeration<SearchResult> result = ctx.search( DN, FILTER, ctls );
+    
+        if ( result.hasMore() )
+        {
+            SearchResult entry = result.next();
+            checkForAttributes( entry.getAttributes(), attrNames );
+        }
+        else
+        {
+            fail( "entry " + DN + " not found" );
+        }
+    
+        result.close();
     }
-    else
+    
+    
+    /**
+     * Check if modifyTimestamp and createTimestamp are present in the search result,
+     * if + is requested.
+     */
+    @Test
+    public void testRequestAllOperationalAttributes() throws Exception
     {
-        fail( "entry " + DN + " not found" );
+        DirContext ctx = getWiredContext( getLdapServer() );
+        SearchControls ctls = new SearchControls();
+    
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+        ctls.setReturningAttributes( new String[]
+            { "+" } );
+    
+        NamingEnumeration<SearchResult> result = ctx.search( DN, FILTER, ctls );
+    
+        if ( result.hasMore() )
+        {
+            SearchResult entry = result.next();
+            String[] attrNames =
+                { "creatorsName", "createTimestamp", "modifiersName", "modifyTimestamp" };
+            checkForAttributes( entry.getAttributes(), attrNames );
+        }
+        else
+        {
+            fail( "entry " + DN + " not found" );
+        }
+    
+        result.close();
     }
-
-    result.close();
-}
-
-
-/**
- * Test case for DIRSERVER-1083: Search on an custom attribute added to
- * the dynamic schema fails when no result is found.
- */
-@Test
-public void testSearchingNewSchemaElements() throws Exception
-{
-    DirContext ctx = getWiredContext( getLdapServer() );
-
-    // create an entry with the schema objectClass personActiveDirectory
-    Attributes person = new BasicAttributes( "objectClass", "top", true );
-    person.get( "objectClass" ).add( "person" );
-    person.get( "objectClass" ).add( "personActiveDirectory" );
-    person.put( "cn", "foobar" );
-    person.put( "sn", "bar" );
-    person.put( "pwdLastSet", "3" );
-    person.put( "SourceAD", "blah" );
-    person.put( "useraccountcontrol", "7" );
-    person.put( "sAMAccountName", "foobar" );
-    ctx.createSubcontext( "cn=foobar,ou=system", person );
-
-    // Confirm creation with a lookup
-    Attributes read = ctx.getAttributes( "cn=foobar,ou=system" );
-    assertNotNull( read );
-    assertEquals( "3", read.get( "pwdLastSet" ).get() );
-
-    // Now search for foobar with pwdLastSet value of 3
-    SearchControls searchControls = new SearchControls();
-    searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-    NamingEnumeration<SearchResult> results = ctx.search( "ou=system", "(pwdLastSet=3)", searchControls );
-    assertTrue( results.hasMore() );
-    SearchResult result = results.next();
-    assertNotNull( result );
-    assertEquals( "cn=foobar", result.getName() );
-    Attributes attributes = result.getAttributes();
-    assertEquals( "3", attributes.get( "pwdLastSet" ).get() );
-    results.close();
-
-    // Now search with bogus value for pwdLastSet
-    results = ctx.search( "ou=system", "(pwdLastSet=300)", searchControls );
-    assertFalse( results.hasMore() );
-    results.close();
-}
-
-
-/**
- * Test case for DIRSERVER-: Ensure that schema entry is returned,
- * even if no ManageDsaIT decorator is present in the search request.
- */
-@Test
-public void testRequestWithoutManageDsaITControl() throws Exception
-{
-    DirContext ctx = getWiredContext( getLdapServer() );
-
-    // this removes the ManageDsaIT decorator from the search request
-    ctx.addToEnvironment( DirContext.REFERRAL, "throw" );
-
-    SearchControls ctls = new SearchControls();
-    String[] attrNames =
-        { "objectClasses", "attributeTypes", "ldapSyntaxes", "matchingRules", "matchingRuleUse", "createTimestamp",
-            "modifyTimestamp" };
-    ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    ctls.setReturningAttributes( attrNames );
-
-    NamingEnumeration<SearchResult> result = ctx.search( DN, FILTER, ctls );
-
-    if ( result.hasMore() )
+    
+    
+    /**
+     * Test case for DIRSERVER-1083: Search on an custom attribute added to
+     * the dynamic schema fails when no result is found.
+     */
+    @Test
+    public void testSearchingNewSchemaElements() throws Exception
     {
-        SearchResult entry = result.next();
-        checkForAttributes( entry.getAttributes(), attrNames );
+        DirContext ctx = getWiredContext( getLdapServer() );
+    
+        // create an entry with the schema objectClass personActiveDirectory
+        Attributes person = new BasicAttributes( "objectClass", "top", true );
+        person.get( "objectClass" ).add( "person" );
+        person.get( "objectClass" ).add( "personActiveDirectory" );
+        person.put( "cn", "foobar" );
+        person.put( "sn", "bar" );
+        person.put( "pwdLastSet", "3" );
+        person.put( "SourceAD", "blah" );
+        person.put( "useraccountcontrol", "7" );
+        person.put( "sAMAccountName", "foobar" );
+        ctx.createSubcontext( "cn=foobar,ou=system", person );
+    
+        // Confirm creation with a lookup
+        Attributes read = ctx.getAttributes( "cn=foobar,ou=system" );
+        assertNotNull( read );
+        assertEquals( "3", read.get( "pwdLastSet" ).get() );
+    
+        // Now search for foobar with pwdLastSet value of 3
+        SearchControls searchControls = new SearchControls();
+        searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+        NamingEnumeration<SearchResult> results = ctx.search( "ou=system", "(pwdLastSet=3)", searchControls );
+        assertTrue( results.hasMore() );
+        SearchResult result = results.next();
+        assertNotNull( result );
+        assertEquals( "cn=foobar", result.getName() );
+        Attributes attributes = result.getAttributes();
+        assertEquals( "3", attributes.get( "pwdLastSet" ).get() );
+        results.close();
+    
+        // Now search with bogus value for pwdLastSet
+        results = ctx.search( "ou=system", "(pwdLastSet=300)", searchControls );
+        assertFalse( results.hasMore() );
+        results.close();
     }
-    else
+    
+    
+    /**
+     * Test case for DIRSERVER-: Ensure that schema entry is returned,
+     * even if no ManageDsaIT decorator is present in the search request.
+     */
+    @Test
+    public void testRequestWithoutManageDsaITControl() throws Exception
     {
-        fail( "entry " + DN + " not found" );
+        DirContext ctx = getWiredContext( getLdapServer() );
+    
+        // this removes the ManageDsaIT decorator from the search request
+        ctx.addToEnvironment( DirContext.REFERRAL, "throw" );
+    
+        SearchControls ctls = new SearchControls();
+        String[] attrNames =
+            { "objectClasses", "attributeTypes", "ldapSyntaxes", "matchingRules", "matchingRuleUse", "createTimestamp",
+                "modifyTimestamp" };
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+        ctls.setReturningAttributes( attrNames );
+    
+        NamingEnumeration<SearchResult> result = ctx.search( DN, FILTER, ctls );
+    
+        if ( result.hasMore() )
+        {
+            SearchResult entry = result.next();
+            checkForAttributes( entry.getAttributes(), attrNames );
+        }
+        else
+        {
+            fail( "entry " + DN + " not found" );
+        }
+    
+        result.close();
     }
-
-    result.close();
-}
-
-
-/**
- * Test a search done on cn=schema
- */
-@Test
-public void testSubSchemaSubEntrySearch() throws Exception
-{
-    DirContext ctx = getWiredContext( getLdapServer() );
-
-    SearchControls searchControls = new SearchControls();
-    searchControls.setSearchScope( SearchControls.OBJECT_SCOPE );
-    searchControls.setReturningAttributes( new String[]
-        { "objectClasses" } );
-    NamingEnumeration<SearchResult> results = ctx.search( "cn=schema", "(ObjectClass=*)", searchControls );
-
-    assertTrue( results.hasMore() );
-    SearchResult result = results.next();
-    Attributes entry = result.getAttributes();
-
-    Attribute objectClasses = entry.get( "objectClasses" );
-    NamingEnumeration<?> ocs = objectClasses.getAll();
-
-    while ( ocs.hasMore() )
+    
+    
+    /**
+     * Test a search done on cn=schema
+     */
+    @Test
+    public void testSubSchemaSubEntrySearch() throws Exception
     {
-        String oc = ( String ) ocs.nextElement();
-        if ( oc.startsWith( "( 2.5.6.6" ) )
+        DirContext ctx = getWiredContext( getLdapServer() );
+    
+        SearchControls searchControls = new SearchControls();
+        searchControls.setSearchScope( SearchControls.OBJECT_SCOPE );
+        searchControls.setReturningAttributes( new String[]
+            { "objectClasses" } );
+        NamingEnumeration<SearchResult> results = ctx.search( "cn=schema", "(ObjectClass=*)", searchControls );
+    
+        assertTrue( results.hasMore() );
+        SearchResult result = results.next();
+        Attributes entry = result.getAttributes();
+    
+        Attribute objectClasses = entry.get( "objectClasses" );
+        NamingEnumeration<?> ocs = objectClasses.getAll();
+    
+        while ( ocs.hasMore() )
         {
-            assertEquals(
-                "( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) X-SCHEMA 'core' )",
-                oc );
+            String oc = ( String ) ocs.nextElement();
+            if ( oc.startsWith( "( 2.5.6.6" ) )
+            {
+                assertEquals(
+                    "( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) X-SCHEMA 'core' )",
+                    oc );
+            }
         }
+    
+        results.close();
     }
-
-    results.close();
-}
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java Sun May  6 14:25:18 2012
@@ -46,6 +46,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.server.annotations.CreateLdapServer;
@@ -69,6 +70,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Dn;
 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;
 
@@ -183,6 +185,8 @@ import org.junit.runner.RunWith;
 })
 public class SearchIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
     private static final String BASE = "ou=system";
     
     //public static LdapServer getLdapServer();

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java Sun May  6 14:25:18 2012
@@ -35,6 +35,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;
@@ -51,6 +52,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -121,373 +123,375 @@ import org.junit.runner.RunWith;
 })
 public class SearchLimitsIT extends AbstractLdapTestUnit
 {
-
-/**
- * An {@link Interceptor} that fakes a specified amount of delay to each
- * search iteration so we can make sure search time limits are adhered to.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-class DelayInducingInterceptor extends BaseInterceptor
-{
-    private Long delayMillis;
-
-
-    public DelayInducingInterceptor()
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+    
+    /**
+     * An {@link Interceptor} that fakes a specified amount of delay to each
+     * search iteration so we can make sure search time limits are adhered to.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     */
+    class DelayInducingInterceptor extends BaseInterceptor
     {
-        super( "DelayInterceptor" );
-    }
-
-
-    public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
-    {
-        EntryFilteringCursor cursor = next( searchContext );
-        cursor.addEntryFilter( new EntryFilter()
+        private Long delayMillis;
+    
+    
+        public DelayInducingInterceptor()
+        {
+            super( "DelayInterceptor" );
+        }
+    
+    
+        public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
         {
-            public boolean accept( SearchingOperationContext operation, Entry result ) throws Exception
+            EntryFilteringCursor cursor = next( searchContext );
+            cursor.addEntryFilter( new EntryFilter()
             {
-                if ( delayMillis != null )
+                public boolean accept( SearchingOperationContext operation, Entry result ) throws Exception
                 {
-                    Thread.sleep( delayMillis );
+                    if ( delayMillis != null )
+                    {
+                        Thread.sleep( delayMillis );
+                    }
+    
+                    return true;
                 }
-
-                return true;
+            } );
+    
+            return cursor;
+        }
+    
+    
+        public void setDelayMillis( long delayMillis )
+        {
+            if ( delayMillis <= 0 )
+            {
+                this.delayMillis = null;
             }
-        } );
-
-        return cursor;
+    
+            this.delayMillis = delayMillis;
+        }
     }
-
-
-    public void setDelayMillis( long delayMillis )
+    
+    private int oldMaxTimeLimit;
+    private long oldMaxSizeLimit;
+    private DelayInducingInterceptor delayInterceptor;
+    
+    
+    @Before
+    public void setUp() throws Exception
     {
-        if ( delayMillis <= 0 )
-        {
-            this.delayMillis = null;
-        }
-
-        this.delayMillis = delayMillis;
+        oldMaxTimeLimit = getLdapServer().getMaxTimeLimit();
+        oldMaxSizeLimit = getLdapServer().getMaxSizeLimit();
+        delayInterceptor = new DelayInducingInterceptor();
+        getLdapServer().getDirectoryService().addFirst( delayInterceptor );
     }
-}
-
-private int oldMaxTimeLimit;
-private long oldMaxSizeLimit;
-private DelayInducingInterceptor delayInterceptor;
-
-
-@Before
-public void setUp() throws Exception
-{
-    oldMaxTimeLimit = getLdapServer().getMaxTimeLimit();
-    oldMaxSizeLimit = getLdapServer().getMaxSizeLimit();
-    delayInterceptor = new DelayInducingInterceptor();
-    getLdapServer().getDirectoryService().addFirst( delayInterceptor );
-}
-
-
-@After
-public void tearDown() throws Exception
-{
-    getLdapServer().setMaxTimeLimit( oldMaxTimeLimit );
-    getLdapServer().setMaxSizeLimit( oldMaxSizeLimit );
-    getLdapServer().getDirectoryService().remove( "DelayInterceptor" );
-}
-
-
-// -----------------------------------------------------------------------
-// Time Limit Tests
-// -----------------------------------------------------------------------
-
-/**
- * Sets up the server with unlimited search time limit but constrains time
- * by request time limit value to cause a time limit exceeded exception on
- * the client.
- */
-@Test(expected = TimeLimitExceededException.class)
-public void testRequestConstrainedUnlimitByConfiguration() throws Exception
-{
-    getLdapServer().setMaxTimeLimit( LdapServer.NO_TIME_LIMIT );
-    delayInterceptor.setDelayMillis( 500 );
-
-    getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
-}
-
-
-/**
- * Sets up the server with longer search time limit than the request's
- * which constrains time by request time limit value to cause a time limit
- * exceeded exception on the client.
- */
-@Test(expected = TimeLimitExceededException.class)
-public void testRequestConstrainedLessThanConfiguration() throws Exception
-{
-    getLdapServer().setMaxTimeLimit( 10000 ); // this is in seconds
-    delayInterceptor.setDelayMillis( 500 );
-
-    getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
-}
-
-
-/**
- * Sets up the server with shorter search time limit than the request's
- * which constrains time by using server max limit value to cause a time
- * limit exceeded exception on the client.
- */
-@Test(expected = TimeLimitExceededException.class)
-public void testRequestConstrainedGreaterThanConfiguration() throws Exception
-{
-    getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
-    delayInterceptor.setDelayMillis( 1100 );
-
-    getActorsWithLimit( "(objectClass=*)", 100000, LdapServer.NO_SIZE_LIMIT );
-}
-
-
-/**
- * Sets up the server with limited search time with unlimited request
- * time limit.  Should work just fine for the administrative user.
- */
-@Test
-public void testRequestUnlimitedConfigurationLimited() throws Exception
-{
-    getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
-    delayInterceptor.setDelayMillis( 500 );
-
-    getActorsWithLimit( "(objectClass=*)",
-        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
-}
-
-
-/**
- * Sets up the server with limited search time with unlimited request
- * time limit.  Should not work for non administrative users.
- */
-@Test(expected = TimeLimitExceededException.class)
-public void testNonAdminRequestUnlimitedConfigurationLimited() throws Exception
-{
-    getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
-    delayInterceptor.setDelayMillis( 500 );
-
-    getActorsWithLimitNonAdmin( "(objectClass=*)",
-        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
-}
-
-
-// -----------------------------------------------------------------------
-// Size Limit Tests
-// -----------------------------------------------------------------------
-
-/**
- * Sets up the server with unlimited search size limit but constrains size
- * by request size limit value to cause a size limit exceeded exception on
- * the client.
- */
-@Test(expected = SizeLimitExceededException.class)
-public void testRequestConstrainedUnlimitByConfigurationSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
-
-    getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
-}
-
-
-/**
- * Sets up the server with longer search size limit than the request's
- * which constrains size by request size limit value to cause a size limit
- * exceeded exception on the client.
- */
-@Test(expected = SizeLimitExceededException.class)
-public void testRequestConstrainedLessThanConfigurationSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( 10000 );
-
-    getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
-}
-
-
-/**
- * Sets up the server with shorter search size limit than the request's
- * which constrains size by using server max limit value. Should work
- * just fine for the administrative user.
- */
-@Test
-public void testRequestConstrainedGreaterThanConfigurationSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( 1 );
-    Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
-    assertEquals( 4, set.size() );
-}
-
-
-/**
- * Sets up the server with shorter search size limit than the request's
- * which constrains size by using server max limit value to cause a size
- * limit exceeded exception on the client.
- */
-@Test(expected = SizeLimitExceededException.class)
-public void testNonAdminRequestConstrainedGreaterThanConfigurationSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( 1 );
-
-    // We are not using the admin : it should fail
-    getActorsWithLimitNonAdmin( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
-}
-
-
-/**
- * Sets up the server with limited search size with unlimited request
- * size limit.  Should work just fine for the administrative user.
- */
-@Test
-public void testRequestUnlimitedConfigurationLimitedSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( 1 );
-    Set<String> set = getActorsWithLimit( "(objectClass=*)",
-        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
-
-    assertEquals( 4, set.size() );
-}
-
-
-/**
- * Sets up the server with limited search size with unlimited request
- * size limit.  Should not work for non administrative users.
- */
-@Test(expected = SizeLimitExceededException.class)
-public void testNonAdminRequestUnlimitedConfigurationLimitedSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( 1 );
-    getActorsWithLimitNonAdmin( "(objectClass=*)",
-        LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
-}
-
-
-/**
- * Test for DIRSERVER-1235.
- * Sets up the server with unlimited search size limit but constrains size
- * by request size limit value. The request size limit is less than the
- * expected number of result entries, so exception expected.
- * 
- * cf RFC 4511 :
- *  "sizeLimitExceeded (4)
- *   Indicates that the size limit specified by the client was
- *   exceeded before the operation could be completed."
- */
-@Test(expected = SizeLimitExceededException.class)
-public void testRequestConstraintedLessThanExpectedSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
-
-    getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 3 );
-}
-
-
-/**
- * Test for DIRSERVER-1235.
- * Sets up the server with unlimited search size limit but constrains size
- * by request size limit value. The request size limit is equal to the
- * expected number of result entries so no exception expected.
- */
-@Test
-public void testRequestConstraintedEqualToExpectedSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
-    Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 4 );
-    assertEquals( 4, set.size() );
-}
-
-
-/**
- * Test for DIRSERVER-1235.
- * Sets up the server with unlimited search size limit but constrains size
- * by request size limit value. The request size limit is greater than the
- * expected number of result entries so no exception expected.
- */
-@Test
-public void testRequestConstraintedGreaterThanExpectedSize() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
-    Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 5 );
-    assertEquals( 4, set.size() );
-}
-
-
-/**
- * Test for DIRSERVER-1235.
- * Reads an entry using object scope and size limit 1, no exception
- * expected.
- */
-@Test
-public void testRequestObjectScopeAndSizeLimit() throws Exception
-{
-    getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
-
-    DirContext ctx = getWiredContext( getLdapServer() );
-    String filter = "(objectClass=*)";
-    SearchControls controls = new SearchControls();
-    controls.setTimeLimit( 0 );
-    controls.setCountLimit( 1 );
-    controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-
-    NamingEnumeration<SearchResult> namingEnumeration =
-        ctx.search( "ou=actors,ou=system", filter, controls );
-    assertTrue( namingEnumeration.hasMore() );
-    namingEnumeration.next();
-    assertFalse( namingEnumeration.hasMore() );
-}
-
-
-// -----------------------------------------------------------------------
-// Utility Methods
-// -----------------------------------------------------------------------
-
-/**
- * Do a search request from the ou=actors,ou=system base, with a principal
- * which is the administrator.
- */
-private Set<String> getActorsWithLimit( String filter, int timeLimitMillis, long sizeLimit ) throws Exception
-{
-    DirContext ctx = getWiredContext( getLdapServer() );
-    Set<String> results = new HashSet<String>();
-    SearchControls controls = new SearchControls();
-    controls.setTimeLimit( timeLimitMillis );
-    controls.setCountLimit( sizeLimit );
-    controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-
-    NamingEnumeration<SearchResult> namingEnumeration =
-        ctx.search( "ou=actors,ou=system", filter, controls );
-
-    while ( namingEnumeration.hasMore() )
+    
+    
+    @After
+    public void tearDown() throws Exception
     {
-        results.add( namingEnumeration.next().getNameInNamespace() );
+        getLdapServer().setMaxTimeLimit( oldMaxTimeLimit );
+        getLdapServer().setMaxSizeLimit( oldMaxSizeLimit );
+        getLdapServer().getDirectoryService().remove( "DelayInterceptor" );
     }
-
-    return results;
-}
-
-
-/**
- * Do a search request from the ou=actors,ou=system base, with a principal
- * which is not the administrator.
- */
-private Set<String> getActorsWithLimitNonAdmin( String filter, int timeLimitMillis, long sizeLimit )
-    throws Exception
-{
-    DirContext ctx = getWiredContext( getLdapServer(), "uid=jblack,ou=actors,ou=system", "secret" );
-    Set<String> results = new HashSet<String>();
-    SearchControls controls = new SearchControls();
-    controls.setTimeLimit( timeLimitMillis );
-    controls.setCountLimit( sizeLimit );
-    controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-
-    NamingEnumeration<SearchResult> namingEnumeration =
-        ctx.search( "ou=actors,ou=system", filter, controls );
-
-    while ( namingEnumeration.hasMore() )
+    
+    
+    // -----------------------------------------------------------------------
+    // Time Limit Tests
+    // -----------------------------------------------------------------------
+    
+    /**
+     * Sets up the server with unlimited search time limit but constrains time
+     * by request time limit value to cause a time limit exceeded exception on
+     * the client.
+     */
+    @Test(expected = TimeLimitExceededException.class)
+    public void testRequestConstrainedUnlimitByConfiguration() throws Exception
     {
-        results.add( namingEnumeration.next().getNameInNamespace() );
+        getLdapServer().setMaxTimeLimit( LdapServer.NO_TIME_LIMIT );
+        delayInterceptor.setDelayMillis( 500 );
+    
+        getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
+    }
+    
+    
+    /**
+     * Sets up the server with longer search time limit than the request's
+     * which constrains time by request time limit value to cause a time limit
+     * exceeded exception on the client.
+     */
+    @Test(expected = TimeLimitExceededException.class)
+    public void testRequestConstrainedLessThanConfiguration() throws Exception
+    {
+        getLdapServer().setMaxTimeLimit( 10000 ); // this is in seconds
+        delayInterceptor.setDelayMillis( 500 );
+    
+        getActorsWithLimit( "(objectClass=*)", 499, LdapServer.NO_SIZE_LIMIT );
+    }
+    
+    
+    /**
+     * Sets up the server with shorter search time limit than the request's
+     * which constrains time by using server max limit value to cause a time
+     * limit exceeded exception on the client.
+     */
+    @Test(expected = TimeLimitExceededException.class)
+    public void testRequestConstrainedGreaterThanConfiguration() throws Exception
+    {
+        getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
+        delayInterceptor.setDelayMillis( 1100 );
+    
+        getActorsWithLimit( "(objectClass=*)", 100000, LdapServer.NO_SIZE_LIMIT );
+    }
+    
+    
+    /**
+     * Sets up the server with limited search time with unlimited request
+     * time limit.  Should work just fine for the administrative user.
+     */
+    @Test
+    public void testRequestUnlimitedConfigurationLimited() throws Exception
+    {
+        getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
+        delayInterceptor.setDelayMillis( 500 );
+    
+        getActorsWithLimit( "(objectClass=*)",
+            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
+    }
+    
+    
+    /**
+     * Sets up the server with limited search time with unlimited request
+     * time limit.  Should not work for non administrative users.
+     */
+    @Test(expected = TimeLimitExceededException.class)
+    public void testNonAdminRequestUnlimitedConfigurationLimited() throws Exception
+    {
+        getLdapServer().setMaxTimeLimit( 1 ); // this is in seconds
+        delayInterceptor.setDelayMillis( 500 );
+    
+        getActorsWithLimitNonAdmin( "(objectClass=*)",
+            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
+    }
+    
+    
+    // -----------------------------------------------------------------------
+    // Size Limit Tests
+    // -----------------------------------------------------------------------
+    
+    /**
+     * Sets up the server with unlimited search size limit but constrains size
+     * by request size limit value to cause a size limit exceeded exception on
+     * the client.
+     */
+    @Test(expected = SizeLimitExceededException.class)
+    public void testRequestConstrainedUnlimitByConfigurationSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
+    
+        getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
+    }
+    
+    
+    /**
+     * Sets up the server with longer search size limit than the request's
+     * which constrains size by request size limit value to cause a size limit
+     * exceeded exception on the client.
+     */
+    @Test(expected = SizeLimitExceededException.class)
+    public void testRequestConstrainedLessThanConfigurationSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( 10000 );
+    
+        getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 1 );
+    }
+    
+    
+    /**
+     * Sets up the server with shorter search size limit than the request's
+     * which constrains size by using server max limit value. Should work
+     * just fine for the administrative user.
+     */
+    @Test
+    public void testRequestConstrainedGreaterThanConfigurationSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( 1 );
+        Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
+        assertEquals( 4, set.size() );
+    }
+    
+    
+    /**
+     * Sets up the server with shorter search size limit than the request's
+     * which constrains size by using server max limit value to cause a size
+     * limit exceeded exception on the client.
+     */
+    @Test(expected = SizeLimitExceededException.class)
+    public void testNonAdminRequestConstrainedGreaterThanConfigurationSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( 1 );
+    
+        // We are not using the admin : it should fail
+        getActorsWithLimitNonAdmin( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 100000 );
+    }
+    
+    
+    /**
+     * Sets up the server with limited search size with unlimited request
+     * size limit.  Should work just fine for the administrative user.
+     */
+    @Test
+    public void testRequestUnlimitedConfigurationLimitedSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( 1 );
+        Set<String> set = getActorsWithLimit( "(objectClass=*)",
+            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
+    
+        assertEquals( 4, set.size() );
+    }
+    
+    
+    /**
+     * Sets up the server with limited search size with unlimited request
+     * size limit.  Should not work for non administrative users.
+     */
+    @Test(expected = SizeLimitExceededException.class)
+    public void testNonAdminRequestUnlimitedConfigurationLimitedSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( 1 );
+        getActorsWithLimitNonAdmin( "(objectClass=*)",
+            LdapServer.NO_TIME_LIMIT, LdapServer.NO_SIZE_LIMIT );
+    }
+    
+    
+    /**
+     * Test for DIRSERVER-1235.
+     * Sets up the server with unlimited search size limit but constrains size
+     * by request size limit value. The request size limit is less than the
+     * expected number of result entries, so exception expected.
+     * 
+     * cf RFC 4511 :
+     *  "sizeLimitExceeded (4)
+     *   Indicates that the size limit specified by the client was
+     *   exceeded before the operation could be completed."
+     */
+    @Test(expected = SizeLimitExceededException.class)
+    public void testRequestConstraintedLessThanExpectedSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
+    
+        getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 3 );
+    }
+    
+    
+    /**
+     * Test for DIRSERVER-1235.
+     * Sets up the server with unlimited search size limit but constrains size
+     * by request size limit value. The request size limit is equal to the
+     * expected number of result entries so no exception expected.
+     */
+    @Test
+    public void testRequestConstraintedEqualToExpectedSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
+        Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 4 );
+        assertEquals( 4, set.size() );
+    }
+    
+    
+    /**
+     * Test for DIRSERVER-1235.
+     * Sets up the server with unlimited search size limit but constrains size
+     * by request size limit value. The request size limit is greater than the
+     * expected number of result entries so no exception expected.
+     */
+    @Test
+    public void testRequestConstraintedGreaterThanExpectedSize() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
+        Set<String> set = getActorsWithLimit( "(objectClass=*)", LdapServer.NO_TIME_LIMIT, 5 );
+        assertEquals( 4, set.size() );
+    }
+    
+    
+    /**
+     * Test for DIRSERVER-1235.
+     * Reads an entry using object scope and size limit 1, no exception
+     * expected.
+     */
+    @Test
+    public void testRequestObjectScopeAndSizeLimit() throws Exception
+    {
+        getLdapServer().setMaxSizeLimit( LdapServer.NO_SIZE_LIMIT );
+    
+        DirContext ctx = getWiredContext( getLdapServer() );
+        String filter = "(objectClass=*)";
+        SearchControls controls = new SearchControls();
+        controls.setTimeLimit( 0 );
+        controls.setCountLimit( 1 );
+        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
+    
+        NamingEnumeration<SearchResult> namingEnumeration =
+            ctx.search( "ou=actors,ou=system", filter, controls );
+        assertTrue( namingEnumeration.hasMore() );
+        namingEnumeration.next();
+        assertFalse( namingEnumeration.hasMore() );
+    }
+    
+    
+    // -----------------------------------------------------------------------
+    // Utility Methods
+    // -----------------------------------------------------------------------
+    
+    /**
+     * Do a search request from the ou=actors,ou=system base, with a principal
+     * which is the administrator.
+     */
+    private Set<String> getActorsWithLimit( String filter, int timeLimitMillis, long sizeLimit ) throws Exception
+    {
+        DirContext ctx = getWiredContext( getLdapServer() );
+        Set<String> results = new HashSet<String>();
+        SearchControls controls = new SearchControls();
+        controls.setTimeLimit( timeLimitMillis );
+        controls.setCountLimit( sizeLimit );
+        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+    
+        NamingEnumeration<SearchResult> namingEnumeration =
+            ctx.search( "ou=actors,ou=system", filter, controls );
+    
+        while ( namingEnumeration.hasMore() )
+        {
+            results.add( namingEnumeration.next().getNameInNamespace() );
+        }
+    
+        return results;
+    }
+    
+    
+    /**
+     * Do a search request from the ou=actors,ou=system base, with a principal
+     * which is not the administrator.
+     */
+    private Set<String> getActorsWithLimitNonAdmin( String filter, int timeLimitMillis, long sizeLimit )
+        throws Exception
+    {
+        DirContext ctx = getWiredContext( getLdapServer(), "uid=jblack,ou=actors,ou=system", "secret" );
+        Set<String> results = new HashSet<String>();
+        SearchControls controls = new SearchControls();
+        controls.setTimeLimit( timeLimitMillis );
+        controls.setCountLimit( sizeLimit );
+        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+    
+        NamingEnumeration<SearchResult> namingEnumeration =
+            ctx.search( "ou=actors,ou=system", filter, controls );
+    
+        while ( namingEnumeration.hasMore() )
+        {
+            results.add( namingEnumeration.next().getNameInNamespace() );
+        }
+    
+        return results;
     }
-
-    return results;
-}
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchPerfIT.java Sun May  6 14:25:18 2012
@@ -23,6 +23,7 @@ package org.apache.directory.server.oper
 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.EntryCursorImpl;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
@@ -37,6 +38,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchRequestImpl;
 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;
 
@@ -53,6 +55,9 @@ import org.junit.runner.RunWith;
     { @CreateTransport(protocol = "LDAP") })
 public class SearchPerfIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+
     /**
      * test a search request perf.
      */

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java Sun May  6 14:25:18 2012
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertTru
 
 import java.util.concurrent.atomic.AtomicInteger;
 
+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.ContextEntry;
@@ -49,6 +50,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
 
 
@@ -59,6 +61,9 @@ import org.junit.Test;
  */
 public class ClientInitialRefreshIT
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+
     private static LdapServer providerServer;
 
     private static SchemaManager schemaManager;
@@ -398,7 +403,7 @@ public class ClientInitialRefreshIT
 
 
     /**
-     * Test that we can load entries, kill the consumer in the middle of the load, 
+     * Test that we can load entries, kill the consumer in the middle of the load,
      * restart the consumer and still get all the entries.
      */
     @Test

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java Sun May  6 14:25:18 2012
@@ -29,6 +29,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateConsumer;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
@@ -60,6 +61,7 @@ import org.apache.directory.shared.ldap.
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 
 
@@ -70,6 +72,9 @@ import org.junit.Test;
  */
 public class ClientServerReplicationIT
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+
     private static LdapServer providerServer;
 
     private static LdapServer consumerServer;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/MockSyncReplConsumer.java Sun May  6 14:25:18 2012
@@ -193,7 +193,7 @@ public class MockSyncReplConsumer implem
      * Connect to the remote server. Note that a SyncRepl consumer will be connected to only
      * one remote server
      * 
-     * @return true if the connections have been successful. 
+     * @return true if the connections have been successful.
      */
     public boolean connect()
     {
@@ -471,7 +471,7 @@ public class MockSyncReplConsumer implem
     }
 
 
-    /** 
+    /**
      * {@inheritDoc}
      */
     public void setConfig( ReplicationConsumerConfig config )

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java?rev=1334639&r1=1334638&r2=1334639&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/schema/SchemaIT.java Sun May  6 14:25:18 2012
@@ -43,6 +43,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.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -53,6 +54,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.schema.parsers.AttributeTypeDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.model.schema.parsers.ObjectClassDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.util.JndiUtils;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -66,6 +68,9 @@ import org.junit.runner.RunWith;
 @CreateDS(name = "SchemaIT-class")
 public class SchemaIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE );
+
     private static final String SUBSCHEMA_SUBENTRY = "subschemaSubentry";
     private static final AttributeTypeDescriptionSchemaParser ATTRIBUTE_TYPE_DESCRIPTION_SCHEMA_PARSER = new AttributeTypeDescriptionSchemaParser();
     private static final ObjectClassDescriptionSchemaParser OBJECT_CLASS_DESCRIPTION_SCHEMA_PARSER = new ObjectClassDescriptionSchemaParser();



Mime
View raw message