directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r955186 [1/3] - in /directory/apacheds/trunk: ./ core-annotations/ core-annotations/src/test/java/org/apache/directory/server/core/factory/ core-api/ core-api/src/test/java/org/apache/directory/server/core/changelog/ core-api/src/test/java/...
Date Wed, 16 Jun 2010 10:46:21 GMT
Author: felixk
Date: Wed Jun 16 10:46:18 2010
New Revision: 955186

URL: http://svn.apache.org/viewvc?rev=955186&view=rev
Log:
Adding concurrent execution to test classes, also the ones containing only one test as there will probably more tests in future (test coverage is not complete).

Modified:
    directory/apacheds/trunk/core-annotations/pom.xml
    directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java
    directory/apacheds/trunk/core-api/pom.xml
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/changelog/TagTest.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java
    directory/apacheds/trunk/core-avl/pom.xml
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeCursorTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
    directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
    directory/apacheds/trunk/core-jndi/pom.xml
    directory/apacheds/trunk/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java
    directory/apacheds/trunk/core/pom.xml
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticatorOneWayEncryptedTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MicroOperationFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/OperationScopeTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/prefs/PreferencesUtilsTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/security/TlsKeyGeneratorTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/sp/StoredProcUtilsTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
    directory/apacheds/trunk/default-config/pom.xml
    directory/apacheds/trunk/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
    directory/apacheds/trunk/i18n/pom.xml
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/GermanLanguageTest.java
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/InlineMessageTest.java
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/UnknownLanguageTest.java
    directory/apacheds/trunk/jdbm-partition/pom.xml
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeRedirectMarshallerTest.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursorTest.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializerTest.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializerTest.java
    directory/apacheds/trunk/jdbm/pom.xml
    directory/apacheds/trunk/jdbm/src/test/java/jdbm/btree/TestBTree.java
    directory/apacheds/trunk/jdbm/src/test/java/jdbm/recman/LocationTest.java
    directory/apacheds/trunk/kerberos-shared/pom.xml
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/KerberosUtilsTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/AesEncryptionTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/Des3CbcSha1KdEncryptionTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcCrcEncryptionTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5EncryptionTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesStringToKeyTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/NFoldTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/RandomKeyFactoryTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/keytab/KeytabTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/components/TicketTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationDataTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedDataTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKeyTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddressesTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PaDataTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalNameTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncodingTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/replay/InMemoryReplayCacheTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientAbandonRequestTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientModifyRequestTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchRequestReturningAttributesTest.java
    directory/apacheds/trunk/pom.xml
    directory/apacheds/trunk/protocol-changepw/pom.xml
    directory/apacheds/trunk/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
    directory/apacheds/trunk/protocol-changepw/src/test/java/org/apache/directory/server/changepw/service/CheckPasswordPolicyTest.java
    directory/apacheds/trunk/protocol-dhcp/pom.xml
    directory/apacheds/trunk/protocol-dhcp/src/test/java/org/apache/directory/server/dhcp/DhcpMessageDecoderTest.java
    directory/apacheds/trunk/protocol-kerberos/pom.xml
    directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/messages/value/OptionsTest.java
    directory/apacheds/trunk/protocol-ldap/pom.xml
    directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java
    directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
    directory/apacheds/trunk/xdbm-partition/pom.xml
    directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlTableTest.java

Modified: directory/apacheds/trunk/core-annotations/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/pom.xml?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/pom.xml (original)
+++ directory/apacheds/trunk/core-annotations/pom.xml Wed Jun 16 10:46:18 2010
@@ -33,6 +33,12 @@
   
   <dependencies>
     <dependency>
+      <groupId>org.apache.directory.junit</groupId>
+      <artifactId>junit-addons</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>apacheds-core</artifactId>
     </dependency>

Modified: directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java (original)
+++ directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java Wed Jun 16 10:46:18 2010
@@ -23,8 +23,11 @@ package org.apache.directory.server.core
 import static org.junit.Assert.assertTrue;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.server.core.DirectoryService;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -32,6 +35,8 @@ import org.junit.Test;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class DirectoryServiceFactoryTest
 {
     @Test

Modified: directory/apacheds/trunk/core-api/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/pom.xml?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/pom.xml (original)
+++ directory/apacheds/trunk/core-api/pom.xml Wed Jun 16 10:46:18 2010
@@ -37,6 +37,12 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.directory.junit</groupId>
+      <artifactId>junit-addons</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>apacheds-i18n</artifactId>
     </dependency>

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/changelog/TagTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/changelog/TagTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/changelog/TagTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/changelog/TagTest.java Wed Jun 16 10:46:18 2010
@@ -23,9 +23,11 @@ package org.apache.directory.server.core
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
-import org.junit.Before;
-import org.junit.Ignore;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -33,21 +35,23 @@ import org.junit.Test;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class TagTest
 {
-    Tag tagA;
-    Tag tagACopy;
-    Tag tagANull;
-    Tag tagB;
-    Tag tagC;
-    Tag tagD;
+    private static Tag tagA;
+    private static Tag tagACopy;
+    private static Tag tagANull;
+    private static Tag tagB;
+    private static Tag tagC;
+    private static Tag tagD;
 
 
     /**
      * Initialize name instances
      */
-    @Before
-    public void initNames() throws Exception
+    @BeforeClass
+    public static void initNames() throws Exception
     {
 
         tagA = new Tag( 1L, "aa", 1L, 1L );
@@ -124,5 +128,6 @@ public class TagTest
         assertFalse( tagC.equals( tagA ) );
         assertFalse( tagA.equals( tagANull ) );
         assertFalse( tagANull.equals( tagA ) );
+        assertFalse( tagD.equals( tagA ));
     }
 }

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/ClonedServerEntryTest.java Wed Jun 16 10:46:18 2010
@@ -23,12 +23,14 @@ package org.apache.directory.server.core
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.name.DN;
-import org.junit.Before;
-import org.junit.Ignore;
+import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -36,22 +38,23 @@ import org.junit.Test;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class ClonedServerEntryTest
 {
-    ClonedServerEntry clonedServerEntryA;
-    ClonedServerEntry clonedServerEntryACopy;
-    ClonedServerEntry clonedServerEntryB;
-    ClonedServerEntry clonedServerEntryC;
-    ClonedServerEntry clonedServerEntryA1;
-    ClonedServerEntry clonedServerEntryACopy1;
-    ClonedServerEntry clonedServerEntryB1;
-    ClonedServerEntry clonedServerEntryC1;
+    private static ClonedServerEntry clonedServerEntryA;
+    private static ClonedServerEntry clonedServerEntryACopy;
+    private static ClonedServerEntry clonedServerEntryB;
+    private static ClonedServerEntry clonedServerEntryA1;
+    private static ClonedServerEntry clonedServerEntryACopy1;
+    private static ClonedServerEntry clonedServerEntryB1;
+    private static ClonedServerEntry clonedServerEntryC1;
 
     /**
      * Initialize name instances
      */
-    @Before
-    public void initNames() throws Exception
+    @BeforeClass
+    public static void initNames() throws Exception
     {
         Entry eA = new DefaultEntry(new DN( "dc=example,dc=com" ));
         Entry eB = new DefaultEntry(new DN( "dc=example,dc=com" ));
@@ -60,7 +63,6 @@ public class ClonedServerEntryTest
         clonedServerEntryA = new ClonedServerEntry();
         clonedServerEntryACopy = new ClonedServerEntry();
         clonedServerEntryB = new ClonedServerEntry();
-        clonedServerEntryC = new ClonedServerEntry();
         clonedServerEntryA1 = new ClonedServerEntry( eA );
         clonedServerEntryACopy1 = new ClonedServerEntry( eA );
         clonedServerEntryB1 = new ClonedServerEntry( eB );

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryAttributeTest.java Wed Jun 16 10:46:18 2010
@@ -42,6 +42,8 @@ import java.util.Set;
 import javax.naming.directory.InvalidAttributeValueException;
 
 import org.apache.commons.io.FileUtils;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.entry.BinaryValue;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -59,6 +61,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -66,6 +69,8 @@ import org.junit.Test;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class SchemaAwareEntryAttributeTest
 {
     private static LdifSchemaLoader loader;

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareEntryTest.java Wed Jun 16 10:46:18 2010
@@ -40,6 +40,8 @@ import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.BinaryValue;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
@@ -62,6 +64,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -69,6 +72,8 @@ import org.junit.Test;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class SchemaAwareEntryTest
 {
     private static final byte[] BYTES1 = new byte[]

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/entry/SchemaAwareModificationTest.java Wed Jun 16 10:46:18 2010
@@ -34,6 +34,8 @@ import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.util.List;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -49,6 +51,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.util.LdapExceptionUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -56,6 +59,8 @@ import org.junit.Test;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class SchemaAwareModificationTest
 {
     private static LdifSchemaLoader loader;

Modified: directory/apacheds/trunk/core-avl/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/pom.xml?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/pom.xml (original)
+++ directory/apacheds/trunk/core-avl/pom.xml Wed Jun 16 10:46:18 2010
@@ -30,6 +30,12 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.directory.junit</groupId>
+      <artifactId>junit-addons</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>apacheds-i18n</artifactId>
     </dependency>

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeCursorTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeCursorTest.java (original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeCursorTest.java Wed Jun 16 10:46:18 2010
@@ -22,8 +22,12 @@ package org.apache.directory.server.core
 
 import java.util.Comparator;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -36,6 +40,8 @@ import static org.junit.Assert.fail;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class ArrayTreeCursorTest
 {
     @Test

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java (original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/ArrayTreeTest.java Wed Jun 16 10:46:18 2010
@@ -23,15 +23,17 @@ package org.apache.directory.server.core
 import static junit.framework.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertNotSame;
 import static org.junit.Assert.fail;
 
 import java.util.Comparator;
 
-import org.junit.Before;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,6 +43,8 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class ArrayTreeTest
 {
     private static final Integer MINUS_ONE      = Integer.valueOf( -1 );
@@ -63,14 +67,12 @@ public class ArrayTreeTest
     private static final Integer SEVENTY        = Integer.valueOf( 70 );
     private static final Integer SEVENTY_NINE   = Integer.valueOf( 79 );
     
-    ArrayTree<Integer> tree;
-
     private static final Logger LOG = LoggerFactory.getLogger( ArrayTreeTest.class );
 
 
-    @Before
-    public void createTree()
+    private ArrayTree<Integer> createTree()
     {
+        ArrayTree<Integer> tree;
         tree = new ArrayTree<Integer>( new Comparator<Integer>()
         {
             public int compare( Integer i1, Integer i2 )
@@ -84,12 +86,14 @@ public class ArrayTreeTest
             }
 
         } );
+        return tree;
     }
 
 
     @Test
     public void testEmpty()
     {
+        ArrayTree<Integer> tree = createTree();
         assertTrue( tree.isEmpty() );
         assertNull( tree.getFirst() );
         assertNull( tree.getLast() );
@@ -107,6 +111,7 @@ public class ArrayTreeTest
     @Test
     public void testFirstAndLast()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( 7 );
         assertFalse( tree.isEmpty() );
         assertNotNull( tree.getFirst() );
@@ -133,6 +138,7 @@ public class ArrayTreeTest
     @Test
     public void testSingleRightRotation()
     {
+        ArrayTree<Integer> tree = createTree();
         // right rotation
         tree.insert( 3 );
         tree.insert( 2 );
@@ -145,6 +151,7 @@ public class ArrayTreeTest
     @Test
     public void testSingleLeftRotation()
     {
+        ArrayTree<Integer> tree = createTree();
         // left rotation
         tree.insert( 1 );
         tree.insert( 2 );
@@ -157,6 +164,7 @@ public class ArrayTreeTest
     @Test
     public void testDoubleLeftRotation() // left-right totation
     {
+        ArrayTree<Integer> tree = createTree();
         // double left rotation
         tree.insert( 1 );
         tree.insert( 3 );
@@ -169,6 +177,7 @@ public class ArrayTreeTest
     @Test
     public void testDoubleRightRotation() // right-left totation
     {
+        ArrayTree<Integer> tree = createTree();
         // double left rotation
         tree.insert( 3 );
         tree.insert( 1 );
@@ -180,6 +189,7 @@ public class ArrayTreeTest
     @Test
     public void testLinks()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( 37 );
         tree.insert( 1 );
         tree.insert( 2 );
@@ -196,13 +206,14 @@ public class ArrayTreeTest
     @Test
     public void testRemove()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( 3 );
         tree.insert( 2 );
         tree.insert( 1 );
 
-        LOG.debug( getLinkedText() );
+        LOG.debug( getLinkedText( tree ) );
         tree.remove( 2 );
-        LOG.debug( getLinkedText() );
+        LOG.debug( getLinkedText( tree ) );
         assertEquals( "1, 3", tree.toString() );
 
         tree.remove( 1 );
@@ -245,32 +256,34 @@ public class ArrayTreeTest
     @Test
     public void testLinkedNodes()
     {
+        ArrayTree<Integer> tree = createTree();
         for ( int i = 0; i < 3; i++ )
         {
             tree.insert( i );
         }
 
-        assertEquals( "[0]-->[1]-->[2]-->NULL", getLinkedText() );
+        assertEquals( "[0]-->[1]-->[2]-->NULL", getLinkedText( tree ) );
 
         tree.remove( 1 );
-        assertEquals( "[0]-->[2]-->NULL", getLinkedText() );
+        assertEquals( "[0]-->[2]-->NULL", getLinkedText( tree ) );
 
         tree.insert( 4 );
         tree.insert( 3 );
 
-        assertEquals( "[0]-->[2]-->[3]-->[4]-->NULL", getLinkedText() );
+        assertEquals( "[0]-->[2]-->[3]-->[4]-->NULL", getLinkedText( tree ) );
 
         tree.remove( 0 );
-        assertEquals( "[2]-->[3]-->[4]-->NULL", getLinkedText() );
+        assertEquals( "[2]-->[3]-->[4]-->NULL", getLinkedText( tree ) );
 
         tree.remove( 3 );
-        assertEquals( "[2]-->[4]-->NULL", getLinkedText() );
+        assertEquals( "[2]-->[4]-->NULL", getLinkedText( tree ) );
     }
 
 
     @Test
     public void testFind()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.find( 3 ) );
 
         tree.insert( 1 );
@@ -288,6 +301,7 @@ public class ArrayTreeTest
     @Test
     public void testFindMaxMin()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( 72 );
         tree.insert( 79 );
 
@@ -303,6 +317,7 @@ public class ArrayTreeTest
     @Test
     public void testGetKeys()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( 72 );
         tree.insert( 79 );
         tree.insert( 1 );
@@ -318,6 +333,7 @@ public class ArrayTreeTest
     @Test
     public void testTreeRoationAtLeftChildAfterDeletingRoot()
     {
+        ArrayTree<Integer> tree = createTree();
         int[] keys =
             { 86, 110, 122, 2, 134, 26, 14, 182 }; // order is important to produce the expected tree
         int[] expectedKeys =
@@ -337,7 +353,7 @@ public class ArrayTreeTest
     }
 
 
-    private String getLinkedText()
+    private String getLinkedText( ArrayTree<Integer> tree )
     {
         Integer first = tree.getFirst();
         StringBuilder sb = new StringBuilder();
@@ -357,6 +373,7 @@ public class ArrayTreeTest
     @Test
     public void testRemoveOneNode()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( 1 );
         assertEquals( 1, tree.size() );
 
@@ -368,6 +385,7 @@ public class ArrayTreeTest
     @Test
     public void testRemoveOneNodeWithRight()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( 1 );
         tree.insert( 2 );
         assertEquals( 2, tree.size() );
@@ -385,6 +403,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertNullValue()
     {
+        ArrayTree<Integer> tree = createTree();
         assertEquals( 0, tree.size() );
         assertNull( tree.insert( null ) );
         assertEquals( 0, tree.size() );
@@ -394,6 +413,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertEquals( 0, tree.size() );
         assertNull( tree.insert( 0 ) );
         assertEquals( 1, tree.size() );
@@ -406,6 +426,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInOnElementTreeAtTheBeginning()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( 5 ) );
         assertEquals( 1, tree.size() );
@@ -422,6 +443,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInOnElementTreeAtTheEnd()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( 5 ) );
         assertEquals( 1, tree.size() );
@@ -438,6 +460,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInOnElementTreeExistingElement()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( 5 ) );
         assertEquals( 1, tree.size() );
@@ -454,6 +477,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInEvenTreeAtTheBeginning()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( ZERO ) );
         assertNull( tree.insert( TWO ) );
@@ -475,6 +499,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInEvenTreeAtTheEnd()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( ZERO ) );
         assertNull( tree.insert( TWO ) );
@@ -496,6 +521,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInEvenTreeInTheMiddle()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( ZERO ) );
         assertNull( tree.insert( TWO ) );
@@ -534,6 +560,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInEvenTreeExistingEelemnt()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( ZERO ) );
         assertNull( tree.insert( TWO ) );
@@ -572,6 +599,7 @@ public class ArrayTreeTest
     @Test
     public void testInsertInFullTree()
     {
+        ArrayTree<Integer> tree = createTree();
         StringBuilder sb = new StringBuilder();
         boolean isFirst = true;
         
@@ -619,7 +647,8 @@ public class ArrayTreeTest
     @Test
     public void testRemoveEmptyTree()
     {
-        assertNull( tree.remove( null ) );
+       ArrayTree<Integer> tree = createTree();
+       assertNull( tree.remove( null ) );
 
         assertEquals( 0, tree.size() );
 
@@ -632,6 +661,7 @@ public class ArrayTreeTest
     @Test
     public void testRemoveFromOnElementTree()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( 5 ) );
         assertEquals( 1, tree.size() );
@@ -648,6 +678,7 @@ public class ArrayTreeTest
     @Test
     public void testRemovefromOnElementTreeNotExistingElement()
     {
+        ArrayTree<Integer> tree = createTree();
         // Initialize the array
         assertNull( tree.insert( 5 ) );
         assertEquals( 1, tree.size() );
@@ -663,6 +694,7 @@ public class ArrayTreeTest
     @Test
     public void testRemoveFromFullTreeFromTheBeginning()
     {
+        ArrayTree<Integer> tree = createTree();
         StringBuilder sb = new StringBuilder();
         boolean isFirst = true;
         
@@ -710,6 +742,7 @@ public class ArrayTreeTest
     @Test
     public void testRemoveFromFullTreeFromTheEnd()
     {
+        ArrayTree<Integer> tree = createTree();
         StringBuilder sb = new StringBuilder();
         boolean isFirst = true;
         
@@ -760,6 +793,7 @@ public class ArrayTreeTest
     @Test
     public void testIsEmptyEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertTrue( tree.isEmpty() );
         
         tree.insert( ONE );
@@ -778,6 +812,7 @@ public class ArrayTreeTest
     @Test
     public void testSizeEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertEquals( 0, tree.size() );
         
         tree.insert( ONE );
@@ -796,6 +831,7 @@ public class ArrayTreeTest
     @Test
     public void testFindEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.find( ONE ) );
     }
 
@@ -803,6 +839,7 @@ public class ArrayTreeTest
     @Test
     public void testFindNullFromEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.find( null ) );
     }
 
@@ -810,6 +847,7 @@ public class ArrayTreeTest
     @Test
     public void testFindExistingElement()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( ZERO );
         tree.insert( TWO );
         tree.insert( FOUR );
@@ -827,6 +865,7 @@ public class ArrayTreeTest
     @Test
     public void testFindNonExistingElement()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( ZERO );
         tree.insert( TWO );
         tree.insert( FOUR );
@@ -848,6 +887,7 @@ public class ArrayTreeTest
     @Test
     public void testGetFirstEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.getFirst() );
     }
 
@@ -855,6 +895,7 @@ public class ArrayTreeTest
     @Test
     public void testGetFirst()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( FIVE );
         assertEquals( FIVE, tree.getFirst() );
         
@@ -878,6 +919,7 @@ public class ArrayTreeTest
     @Test
     public void testGetLastEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.getLast() );
     }
 
@@ -885,6 +927,7 @@ public class ArrayTreeTest
     @Test
     public void testGetLast()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( FIVE );
         assertEquals( FIVE, tree.getLast() );
         
@@ -908,6 +951,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findGreater( ONE ) );
     }
 
@@ -915,6 +959,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterNullFromEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findGreater( null ) );
     }
 
@@ -922,6 +967,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterFromOneElementTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         
         assertNull( tree.findGreater( null ) );
@@ -934,6 +980,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterFromTwoElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         
@@ -949,6 +996,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreater()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( ZERO );
         tree.insert( TWO );
         tree.insert( FOUR );
@@ -972,6 +1020,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterOrEqualEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findGreaterOrEqual( ONE ) );
     }
 
@@ -979,6 +1028,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterOrEqualNullFromEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findGreaterOrEqual( null ) );
     }
     
@@ -988,6 +1038,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterOrEqualFromOneElementTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         
         assertNull( tree.findGreaterOrEqual( null ) );
@@ -1000,6 +1051,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterOrEqualFromTwoElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         
@@ -1015,6 +1067,7 @@ public class ArrayTreeTest
     @Test
     public void testFindGreaterOrEqual()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( ZERO );
         tree.insert( TWO );
         tree.insert( FOUR );
@@ -1040,6 +1093,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findLess( ONE ) );
     }
 
@@ -1047,6 +1101,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessNullFromEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findLess( null ) );
     }
 
@@ -1054,6 +1109,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessFromOneElementTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         
         assertNull( tree.findLess( null ) );
@@ -1066,6 +1122,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessFromTwoElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         
@@ -1081,6 +1138,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLess()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( ZERO );
         tree.insert( TWO );
         tree.insert( FOUR );
@@ -1105,6 +1163,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessOrEqualEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findLessOrEqual( ONE ) );
     }
 
@@ -1112,6 +1171,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessOrEqualNullFromEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertNull( tree.findLessOrEqual( null ) );
     }
 
@@ -1119,6 +1179,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessOrEqualFromOneElementTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         
         assertNull( tree.findLessOrEqual( null ) );
@@ -1131,6 +1192,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessOrEqualFromTwoElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         
@@ -1146,6 +1208,7 @@ public class ArrayTreeTest
     @Test
     public void testFindLessOrEqual()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( ZERO );
         tree.insert( TWO );
         tree.insert( FOUR );
@@ -1172,6 +1235,7 @@ public class ArrayTreeTest
     @Test
     public void testGetEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         try
         {
             assertNull( tree.get( 0 ) );
@@ -1187,6 +1251,7 @@ public class ArrayTreeTest
     @Test
     public void testGetEmptyTreeAIOOBException()
     {
+        ArrayTree<Integer> tree = createTree();
         try
         {
             tree.get( -1 );
@@ -1215,6 +1280,7 @@ public class ArrayTreeTest
     @Test
     public void testGetAfterPositionEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertEquals( -1, tree.getAfterPosition( ZERO ) );
     }
 
@@ -1222,6 +1288,7 @@ public class ArrayTreeTest
     @Test
     public void testGetAfterPositionOneElementTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         
         assertEquals( -1, tree.getAfterPosition( null ) );
@@ -1234,6 +1301,7 @@ public class ArrayTreeTest
     @Test
     public void testGetAfterPositionTwoElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         
@@ -1248,6 +1316,7 @@ public class ArrayTreeTest
     @Test
     public void testGetAfterPositionNElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         tree.insert( SIX );
@@ -1271,6 +1340,7 @@ public class ArrayTreeTest
     @Test
     public void testGetBeforePositionEmptyTree()
     {
+        ArrayTree<Integer> tree = createTree();
         assertEquals( -1, tree.getBeforePosition( ZERO ) );
     }
 
@@ -1278,6 +1348,7 @@ public class ArrayTreeTest
     @Test
     public void testGetBeforePositionOneElementTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         
         assertEquals( -1, tree.getBeforePosition( null ) );
@@ -1290,6 +1361,7 @@ public class ArrayTreeTest
     @Test
     public void testGetBeforePositionTwoElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         
@@ -1305,6 +1377,7 @@ public class ArrayTreeTest
     @Test
     public void testGetBeforePositionNElementsTree()
     {
+        ArrayTree<Integer> tree = createTree();
         tree.insert( TWO );
         tree.insert( FOUR );
         tree.insert( SIX );

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java (original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java Wed Jun 16 10:46:18 2010
@@ -22,8 +22,12 @@ package org.apache.directory.server.core
 
 import java.util.Comparator;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -36,6 +40,8 @@ import static org.junit.Assert.fail;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class AvlTreeCursorTest
 {
     @Test

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java (original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapTest.java Wed Jun 16 10:46:18 2010
@@ -30,8 +30,10 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 
-import org.junit.Before;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,10 +43,11 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class AvlTreeMapTest
 {
 
-    AvlTreeMap<Integer, Integer> tree;
 
     private static final Logger LOG = LoggerFactory.getLogger( AvlTreeTest.class );
 
@@ -59,16 +62,16 @@ public class AvlTreeMapTest
     };
 
     
-    @Before
-    public void createTree()
+    private AvlTreeMap<Integer, Integer> createTree()
     {
-        tree = new AvlTreeMapImpl<Integer, Integer>( comparator, comparator, true );
+        return new AvlTreeMapImpl<Integer, Integer>( comparator, comparator, true );
     }
 
 
     @Test
     public void testEmpty()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         assertTrue( tree.isDupsAllowed() );
         assertTrue( tree.isEmpty() );
         assertNull( tree.getFirst() );
@@ -87,6 +90,7 @@ public class AvlTreeMapTest
     @Test
     public void testFirstAndLast()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         tree.insert( 7, 1 );
         assertFalse( tree.isEmpty() );
         assertNotNull( tree.getFirst() );
@@ -115,6 +119,7 @@ public class AvlTreeMapTest
     @Test
     public void testInsertWithReplace()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         // to override the value tree should disable duplicate keys
         tree = new AvlTreeMapImpl<Integer, Integer>( comparator, comparator, false );
         
@@ -129,6 +134,7 @@ public class AvlTreeMapTest
     @Test
     public void testInsert()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         assertNull( tree.insert( 3, 1 ) );
         assertFalse( tree.isEmpty() );
         
@@ -172,6 +178,7 @@ public class AvlTreeMapTest
     @Test
     public void testDuplicateKeyInsert()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         assertNull( tree.insert( 3, 1 ) );
         assertNull( tree.insert( 3, 2 ) ); // duplicate key
         assertNull( tree.insert( 3, 3 ) );
@@ -198,15 +205,16 @@ public class AvlTreeMapTest
     @Test
     public void testRemove()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         tree.insert( 3, 3 );
         tree.insert( 2, 2 );
         tree.insert( 1, 1 );
         
         tree.remove( 2, 2 );
-        assertEquals("1,3", getInorderForm());
+        assertEquals("1,3", getInorderForm( tree ));
         
         tree.remove( 1, 1 );
-        assertEquals("3", getInorderForm());
+        assertEquals("3", getInorderForm( tree ));
         assertTrue( 3 == tree.getRoot().key );
         
         assertNull( tree.remove( 777, 0 ) );// key not present
@@ -220,22 +228,22 @@ public class AvlTreeMapTest
         tree.insert( 21, 21 );
         tree.insert( 26, 26 );
         tree.insert( 43, 43 );
-        assertEquals( "21,26,27,37,38,39,43", getInorderForm() );
+        assertEquals( "21,26,27,37,38,39,43", getInorderForm( tree ) );
 
         tree.remove( 26, 26 ); // remove a non-root non-leaf node in the left sub tree of root
-        assertEquals( "21,27,37,38,39,43", getInorderForm() );
+        assertEquals( "21,27,37,38,39,43", getInorderForm( tree ) );
 
         tree.remove( 43, 43 );
-        assertEquals( "21,27,37,38,39", getInorderForm() );
+        assertEquals( "21,27,37,38,39", getInorderForm( tree ) );
 
         tree.remove( 39, 39 );
-        assertEquals( "21,27,37,38", getInorderForm() );
+        assertEquals( "21,27,37,38", getInorderForm( tree ) );
         
         assertTrue( 37 == tree.getRoot().key ); // check the root value
         
         tree.remove( 38, 38 ); // a double right rotation has to happen after this
         assertTrue( 27 == tree.getRoot().key ); // check the root value after double right rotation
-        assertEquals( "21,27,37", getInorderForm() );
+        assertEquals( "21,27,37", getInorderForm( tree ) );
         
         if( LOG.isDebugEnabled() ) 
         {
@@ -247,9 +255,10 @@ public class AvlTreeMapTest
     @Test
     public void testRemoveWithDuplicateKeys()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         tree.insert( 1, 1 );
         
-        // insert deuplicates
+        // insert duplicates
         tree.insert( 3, 3 );
         tree.insert( 3, 2 );
         tree.insert( 3, 1 );
@@ -257,16 +266,16 @@ public class AvlTreeMapTest
         tree.insert( 2, 3 );
         
         tree.remove( 2, 3 );
-        assertEquals("1,3", getInorderForm());
+        assertEquals("1,3", getInorderForm( tree ));
         assertEquals( 2, tree.getSize() );
         
         tree.remove( 3, 3 );
         // removing a duplicate key,value shouldn't change the size  
-        assertEquals("1,3", getInorderForm());
+        assertEquals("1,3", getInorderForm( tree ));
         assertEquals( 2, tree.getSize() );
         
         tree.remove( 3, 3 );
-        assertEquals("1,3", getInorderForm());
+        assertEquals("1,3", getInorderForm( tree ));
         assertEquals( 2, tree.getSize() );
         
         // add some more
@@ -275,7 +284,7 @@ public class AvlTreeMapTest
         assertEquals( 2, tree.getSize() );
         
         tree.remove( 3, 3 );
-        assertEquals("1,3", getInorderForm());
+        assertEquals("1,3", getInorderForm( tree ));
         assertEquals( 2, tree.getSize() );
         
         tree.remove( 3, 2 );
@@ -294,6 +303,7 @@ public class AvlTreeMapTest
     @Test
     public void testRemoveDuplictesOnRoot()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         assertTrue( tree.isDupsAllowed() );
         tree.insert( 3, 4 );
         tree.insert( 3, 5 );
@@ -321,6 +331,7 @@ public class AvlTreeMapTest
     @Test
     public void testRemoveWithoutDupKeys()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         tree = new AvlTreeMapImpl<Integer, Integer>( comparator, comparator, false );
         assertFalse( tree.isDupsAllowed() );
         
@@ -336,6 +347,7 @@ public class AvlTreeMapTest
     @Test
     public void testRemoveWithKeyOnly()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         assertTrue( tree.isDupsAllowed() );
         tree.insert( 3, 1 );
         tree.insert( 3, 2 );
@@ -364,16 +376,17 @@ public class AvlTreeMapTest
     @Test
     public void testSingleRightRotation()
     {
+        AvlTreeMap<Integer, Integer> tree = createTree();
         // right rotation
         tree.insert( 3, 3 );
         tree.insert( 2, 2 );
         tree.insert( 1, 1 );
 
-        assertEquals( "1,2,3", getInorderForm() );
+        assertEquals( "1,2,3", getInorderForm( tree ) );
     }
 
     
-    private String getInorderForm()
+    private String getInorderForm( AvlTreeMap<Integer, Integer> tree )
     {
       StringBuilder sb = new StringBuilder();
       List<LinkedAvlMapNode<Integer,Integer>> path = new ArrayList<LinkedAvlMapNode<Integer,Integer>>();

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java (original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java Wed Jun 16 10:46:18 2010
@@ -33,9 +33,12 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.Comparator;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.junit.AfterClass;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,6 +48,8 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class AvlTreeMarshallerTest
 {
     private static final long[] AVLTREE_KEYS_PRE_REMOVE =
@@ -85,20 +90,17 @@ public class AvlTreeMarshallerTest
 //        0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, -74, 
 //        0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0 
 //    };
-
-    AvlTree<Integer> tree;
-    Comparator<Integer> comparator;
-    AvlTreeMarshaller<Integer> treeMarshaller;
-    
+   
     static AvlTree<Integer> savedTree;
     
     static File treeFile = new File( System.getProperty( "java.io.tmpdir" ) + File.separator + "avl.tree");
     
+    private static Comparator<Integer> comparator;
+    
     private static final Logger LOG = LoggerFactory.getLogger( AvlTreeMarshallerTest.class.getSimpleName() );
 
-    
-    @Before
-    public void createTree()
+    @BeforeClass
+    public static void createComparator()
     {
         comparator = new Comparator<Integer>() 
         {
@@ -107,10 +109,16 @@ public class AvlTreeMarshallerTest
                 return i1.compareTo( i2 );
             }
         };
-        
-      
-        tree = new AvlTreeImpl<Integer>( comparator );
-        treeMarshaller = new AvlTreeMarshaller<Integer>( comparator, new IntegerKeyMarshaller() );
+    }
+    private AvlTree<Integer> createTree()
+    {
+        return new AvlTreeImpl<Integer>( comparator );
+    }
+
+    
+    private AvlTreeMarshaller<Integer> createTreeMarshaller()
+    {
+        return new AvlTreeMarshaller<Integer>( comparator, new IntegerKeyMarshaller() );
     }
 
     
@@ -163,6 +171,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testMarshalEmptyTree() throws IOException
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         byte[] bites = treeMarshaller.serialize( new AvlTreeImpl<Integer>( comparator ) );
         AvlTree<Integer> tree = treeMarshaller.deserialize( bites );
         assertNotNull( tree );
@@ -172,6 +181,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testRoundTripEmpty() throws IOException
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         AvlTree<Integer> original = new AvlTreeImpl<Integer>( comparator );
         byte[] bites = treeMarshaller.serialize( original );
         AvlTree<Integer> deserialized = treeMarshaller.deserialize( bites );
@@ -182,6 +192,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testRoundTripOneEntry() throws IOException
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         AvlTree<Integer> original = new AvlTreeImpl<Integer>( comparator );
         original.insert( 0 );
         byte[] bites = treeMarshaller.serialize( original );
@@ -195,6 +206,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testRoundTripOneEntryFirstLast() throws IOException
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         AvlTree<Integer> original = new AvlTreeImpl<Integer>( comparator );
         original.insert( 0 );
         byte[] bites = treeMarshaller.serialize( original );
@@ -221,6 +233,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testRoundTripTwoEntries() throws IOException
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         AvlTree<Integer> original = new AvlTreeImpl<Integer>( comparator );
         original.insert( 0 );
         original.insert( 1 );
@@ -236,6 +249,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testRoundTripTwoEntriesFirstLast() throws IOException
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         AvlTree<Integer> original = new AvlTreeImpl<Integer>( comparator );
         original.insert( 0 );
         original.insert( 1 );
@@ -264,6 +278,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testRoundTripManyEntries() throws Exception
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         AvlTree<Integer> original = new AvlTreeImpl<Integer>( comparator );
         for ( int ii = 0; ii < 100; ii++ )
         {
@@ -287,6 +302,7 @@ public class AvlTreeMarshallerTest
     @Test
     public void testRoundTripManyEntriesFirstLast() throws Exception
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         AvlTree<Integer> original = new AvlTreeImpl<Integer>( comparator );
         for ( int ii = 0; ii < 100; ii++ )
         {
@@ -355,6 +371,8 @@ public class AvlTreeMarshallerTest
 
     static class Bar implements Serializable
     {
+        private static final long serialVersionUID = -6304421912253987925L;
+
         Integer intValue = 37;
         String stringValue = "bar";
         long longValue = 32L;
@@ -370,6 +388,8 @@ public class AvlTreeMarshallerTest
 
     static class Foo implements Serializable
     {
+        private static final long serialVersionUID = 2036800942831561377L;
+
         float floatValue = 3;
         String stringValue = "foo";
         double doubleValue = 1.2;
@@ -379,8 +399,11 @@ public class AvlTreeMarshallerTest
 
 
     @Test
-    public void testMarshal() throws IOException
+    public void testMarshal_UnMarshal() throws FileNotFoundException, IOException
     {
+        // Marhsall
+        AvlTree<Integer> tree = createTree();
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         tree.insert( 37 );
         tree.insert( 7 );
         tree.insert( 25 );
@@ -400,12 +423,8 @@ public class AvlTreeMarshallerTest
         }
         
         assertTrue( true );
-    }
-
 
-    @Test
-    public void testUnMarshal() throws FileNotFoundException, IOException
-    {
+        // UnMarshall
         FileInputStream fin = new FileInputStream(treeFile);
         
         byte[] data = new byte[ ( int )treeFile.length() ];
@@ -449,6 +468,7 @@ public class AvlTreeMarshallerTest
     @Test( expected = IOException.class )
     public void testDeserializeNullData() throws IOException
     {
+        AvlTreeMarshaller<Integer> treeMarshaller = createTreeMarshaller();
         treeMarshaller.deserialize( null );
     }
     

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java (original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeTest.java Wed Jun 16 10:46:18 2010
@@ -29,8 +29,10 @@ import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 
-import org.junit.Before;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -39,17 +41,16 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class AvlTreeTest
 {
 
-    AvlTree<Integer> tree;
-
     private static final Logger LOG = LoggerFactory.getLogger( AvlTreeTest.class );
     
-    @Before
-    public void createTree()
+    private AvlTree<Integer> createTree()
     {
-      tree = new AvlTreeImpl<Integer>( new Comparator<Integer>() 
+      return new AvlTreeImpl<Integer>( new Comparator<Integer>() 
           {
 
             public int compare( Integer i1, Integer i2 )
@@ -64,6 +65,7 @@ public class AvlTreeTest
     @Test
     public void testEmpty()
     {
+      AvlTree<Integer> tree = createTree();
       assertTrue( tree.isEmpty() );
       assertNull( tree.getFirst() );
       assertNull( tree.getLast() );
@@ -81,6 +83,7 @@ public class AvlTreeTest
     @Test 
     public void testFirstAndLast()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 7 );
         assertFalse( tree.isEmpty() );
         assertNotNull( tree.getFirst() );
@@ -107,6 +110,7 @@ public class AvlTreeTest
     @Test
     public void testInsert()
     {
+        AvlTree<Integer> tree = createTree();
         assertNull( tree.insert( 3 ) );
         assertFalse( tree.isEmpty() );
         
@@ -149,50 +153,55 @@ public class AvlTreeTest
     @Test
     public void testSingleRightRotation()
     {
-     // right rotation
+      AvlTree<Integer> tree = createTree();
+      // right rotation
       tree.insert( 3 );
       tree.insert( 2 );
       tree.insert( 1 );
       
-      assertEquals("1,2,3", getInorderForm());
+      assertEquals("1,2,3", getInorderForm( tree ));
     }
 
     @Test
     public void testSingleLeftRotation()
     {
-     // left rotation
+      AvlTree<Integer> tree = createTree();
+      // left rotation
       tree.insert( 1 );
       tree.insert( 2 );
       tree.insert( 3 );
       
-      assertEquals("1,2,3", getInorderForm());
+      assertEquals("1,2,3", getInorderForm( tree ));
     }
 
     
     @Test
     public void testDoubleLeftRotation() // left-right totation
     {
-     // double left rotation
+      AvlTree<Integer> tree = createTree();
+      // double left rotation
       tree.insert( 1 );
       tree.insert( 3 );
       tree.insert( 2 );
       
-      assertEquals("1,2,3", getInorderForm());
+      assertEquals("1,2,3", getInorderForm( tree ));
     }
     
     @Test
     public void testDoubleRightRotation() // right-left totation
     {
-     // double left rotation
+      AvlTree<Integer> tree = createTree();
+      // double left rotation
       tree.insert( 3 );
       tree.insert( 1 );
       tree.insert( 2 );
-      assertEquals("1,2,3", getInorderForm());
+      assertEquals("1,2,3", getInorderForm( tree ));
     }
     
     @Test
     public void testLinks()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 37 );
         tree.insert( 1 );
         tree.insert( 2 );
@@ -208,17 +217,18 @@ public class AvlTreeTest
     @Test
     public void testRemove()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 3 );
         tree.insert( 2 );
         tree.insert( 1 );
         
-        LOG.debug(getLinkedText());
+        LOG.debug(getLinkedText( tree ));
         tree.remove( 2 );
-        LOG.debug(getLinkedText());
-        assertEquals("1,3", getInorderForm());
+        LOG.debug(getLinkedText( tree ));
+        assertEquals("1,3", getInorderForm( tree ));
         
         tree.remove( 1 );
-        assertEquals("3", getInorderForm());
+        assertEquals("3", getInorderForm( tree ));
         assertTrue( 3 == tree.getRoot().key );
         
         assertNull( tree.remove( 777 ) );// key not present
@@ -232,22 +242,22 @@ public class AvlTreeTest
         tree.insert( 21 );
         tree.insert( 26 );
         tree.insert( 43 );
-        assertEquals( "21,26,27,37,38,39,43", getInorderForm() );
+        assertEquals( "21,26,27,37,38,39,43", getInorderForm( tree ) );
 
         tree.remove( 26 ); // remove a non-root non-leaf node in the left sub tree of root
-        assertEquals( "21,27,37,38,39,43", getInorderForm() );
+        assertEquals( "21,27,37,38,39,43", getInorderForm( tree ) );
 
         tree.remove( 43 );
-        assertEquals( "21,27,37,38,39", getInorderForm() );
+        assertEquals( "21,27,37,38,39", getInorderForm( tree ) );
 
         tree.remove( 39 );
-        assertEquals( "21,27,37,38", getInorderForm() );
+        assertEquals( "21,27,37,38", getInorderForm( tree ) );
         
         assertTrue( 37 == tree.getRoot().key ); // check the root value
         
         tree.remove( 38 ); // a double right rotation has to happen after this
         assertTrue( 27 == tree.getRoot().key ); // check the root value after double right rotation
-        assertEquals( "21,27,37", getInorderForm() );
+        assertEquals( "21,27,37", getInorderForm( tree ) );
         
         if( LOG.isDebugEnabled() ) 
         {
@@ -258,31 +268,33 @@ public class AvlTreeTest
     @Test
     public void testLinkedNodes()
     {
+        AvlTree<Integer> tree = createTree();
         for( int i=0; i< 3; i++)
         {
            tree.insert( i ); 
         }
         
-        assertEquals( "[0]-->[1]-->[2]-->NULL", getLinkedText());
+        assertEquals( "[0]-->[1]-->[2]-->NULL", getLinkedText( tree ));
         
         tree.remove( 1 );
-        assertEquals( "[0]-->[2]-->NULL", getLinkedText());
+        assertEquals( "[0]-->[2]-->NULL", getLinkedText( tree ));
         
         tree.insert( 4 );
         tree.insert( 3 );
         
-        assertEquals( "[0]-->[2]-->[3]-->[4]-->NULL", getLinkedText());
+        assertEquals( "[0]-->[2]-->[3]-->[4]-->NULL", getLinkedText( tree ));
         
         tree.remove( 0 );
-        assertEquals( "[2]-->[3]-->[4]-->NULL", getLinkedText());
+        assertEquals( "[2]-->[3]-->[4]-->NULL", getLinkedText( tree ));
         
         tree.remove( 3 );
-        assertEquals( "[2]-->[4]-->NULL", getLinkedText());
+        assertEquals( "[2]-->[4]-->NULL", getLinkedText( tree ));
     }
     
     @Test
     public void testFind()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 1 );
         tree.insert( 70 );
         tree.insert( 21 );
@@ -300,6 +312,7 @@ public class AvlTreeTest
     @Test
     public void testFindGreater()
     {
+        AvlTree<Integer> tree = createTree();
         assertNull( tree.findGreater( 1 ) );
         
         tree.insert( 1 );
@@ -321,6 +334,7 @@ public class AvlTreeTest
     @Test
     public void testFindLess()
     {
+        AvlTree<Integer> tree = createTree();
         assertNull( tree.findLess( 1 ) );
         
         tree.insert( 1 );
@@ -342,6 +356,7 @@ public class AvlTreeTest
     @Test
     public void testFindMaxMin()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 72 );
         tree.insert( 79 );
         
@@ -356,6 +371,7 @@ public class AvlTreeTest
     @Test
     public void testGetKeys()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 72 );
         tree.insert( 79 );
         tree.insert( 1 );
@@ -370,6 +386,7 @@ public class AvlTreeTest
     @Test
     public void testTreeRoationAtLeftChildAfterDeletingRoot()
     {
+        AvlTree<Integer> tree = createTree();
         int[] keys = { 86, 110, 122, 2, 134, 26, 14, 182 }; // order is important to produce the expected tree
         int[] expectedKeys = { 2, 14, 26, 86, 122, 134, 182 };
         
@@ -390,6 +407,7 @@ public class AvlTreeTest
     @Test
     public void testDetachNodesAtLeftChildAfterDeletingRoot()
     {
+        AvlTree<Integer> tree = createTree();
         int[] keys = { 110, 122, 2, 134, 86, 14, 26, 182 }; // order is important to produce the expected tree
         
         for( int key:keys )
@@ -406,6 +424,7 @@ public class AvlTreeTest
     @Test
     public void testRemoveInRightSubtree()
     {
+        AvlTree<Integer> tree = createTree();
         int[] keys = { 8, 4, 13, 6, 15, 7, 10, 5, 14, 2, 11, 3, 9, 1 }; // order is important to produce the expected tree
         
         for( int key:keys )
@@ -422,6 +441,7 @@ public class AvlTreeTest
     @Test
     public void testRemoveInLeftSubtree()
     {
+        AvlTree<Integer> tree = createTree();
         int[] keys = { 8, 4, 12, 6, 7, 16, 10, 5, 11, 9, 17, 5, 14, 2, 13, 1, 3 }; // order is important to produce the expected tree
         
         for( int key:keys )
@@ -438,7 +458,7 @@ public class AvlTreeTest
     }
     
     
-    private String getLinkedText() 
+    private String getLinkedText( AvlTree<Integer> tree ) 
     {
         LinkedAvlNode<Integer> first = tree.getFirst();
         StringBuilder sb = new StringBuilder();
@@ -454,7 +474,7 @@ public class AvlTreeTest
         return sb.toString();
     }
     
-    private String getInorderForm()
+    private String getInorderForm( AvlTree<Integer> tree )
     {
       StringBuilder sb = new StringBuilder();
       List<LinkedAvlNode<Integer>> path = new ArrayList<LinkedAvlNode<Integer>>();
@@ -494,6 +514,7 @@ public class AvlTreeTest
     @Test
     public void testRemoveEmptyTree()
     {
+        AvlTree<Integer> tree = createTree();
         tree.remove( null );
         
         assertEquals( 0, tree.getSize() );
@@ -507,6 +528,7 @@ public class AvlTreeTest
     @Test
     public void testRemoveOneNode()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 1 );
         assertEquals( 1, tree.getSize() );
         
@@ -518,10 +540,11 @@ public class AvlTreeTest
     @Test
     public void testRemoveOneNodeWithRight()
     {
+        AvlTree<Integer> tree = createTree();
         tree.insert( 1 );
         tree.insert( 2 );
         assertEquals( 2, tree.getSize() );
-        assertEquals( "1,2", getInorderForm() );
+        assertEquals( "1,2", getInorderForm( tree ) );
         
         tree.remove( 1 );
         assertEquals( 1, tree.getSize() );

Modified: directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java (original)
+++ directory/apacheds/trunk/core-avl/src/test/java/org/apache/directory/server/core/avltree/DefaultMarshallerTest.java Wed Jun 16 10:46:18 2010
@@ -21,7 +21,11 @@ package org.apache.directory.server.core
 
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertTrue;
@@ -34,6 +38,8 @@ import java.io.Serializable;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class DefaultMarshallerTest
 {
     DefaultMarshaller marshaller = DefaultMarshaller.INSTANCE;
@@ -61,6 +67,8 @@ public class DefaultMarshallerTest
 
     static class Bar implements Serializable
     {
+        private static final long serialVersionUID = 2982919006977619754L;
+
         int intValue = 37;
         String stringValue = "bar";
         long longValue = 32L;
@@ -70,6 +78,8 @@ public class DefaultMarshallerTest
 
     static class Foo implements Serializable
     {
+        private static final long serialVersionUID = -1366956596647335984L;
+
         float floatValue = 3;
         String stringValue = "foo";
         double doubleValue = 1.2;

Modified: directory/apacheds/trunk/core-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/pom.xml?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/pom.xml (original)
+++ directory/apacheds/trunk/core-jndi/pom.xml Wed Jun 16 10:46:18 2010
@@ -38,6 +38,12 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.directory.junit</groupId>
+      <artifactId>junit-addons</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>apacheds-i18n</artifactId>
     </dependency>

Modified: directory/apacheds/trunk/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java (original)
+++ directory/apacheds/trunk/core-jndi/src/test/java/org/apache/directory/server/core/jndi/LdapJndiPropertiesTest.java Wed Jun 16 10:46:18 2010
@@ -26,10 +26,13 @@ import javax.naming.ConfigurationExcepti
 import javax.naming.Context;
 
 import org.apache.commons.lang.ArrayUtils;
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.server.core.jndi.LdapJndiProperties;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import static org.junit.Assert.fail;
 import static org.junit.Assert.assertEquals;
@@ -40,6 +43,8 @@ import static org.junit.Assert.assertTru
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class LdapJndiPropertiesTest
 {
     @Test

Modified: directory/apacheds/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/pom.xml?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core/pom.xml (original)
+++ directory/apacheds/trunk/core/pom.xml Wed Jun 16 10:46:18 2010
@@ -39,6 +39,12 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.directory.junit</groupId>
+      <artifactId>junit-addons</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <artifactId>apacheds-i18n</artifactId>
       <groupId>${project.groupId}</groupId>
     </dependency>

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/LdapPrincipalTest.java Wed Jun 16 10:46:18 2010
@@ -26,8 +26,11 @@ import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -36,6 +39,8 @@ import org.junit.Test;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class LdapPrincipalTest
 {
     /**

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticatorOneWayEncryptedTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticatorOneWayEncryptedTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticatorOneWayEncryptedTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticatorOneWayEncryptedTest.java Wed Jun 16 10:46:18 2010
@@ -21,11 +21,14 @@
 package org.apache.directory.server.core.authn;
 
 
-import org.apache.directory.server.core.authn.SimpleAuthenticator;
+import static org.junit.Assert.assertEquals;
+
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.util.StringTools;
-import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
-import static org.junit.Assert.assertEquals;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -33,16 +36,18 @@ import static org.junit.Assert.assertEqu
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class SimpleAuthenticatorOneWayEncryptedTest
 {
-    private SimpleAuthenticator auth = null;
+    private static SimpleAuthenticator auth = null;
 
 
-    @Before
-    public void setUp() throws Exception
+    @BeforeClass
+    public static void setUp() throws Exception
     {
 
-        this.auth = new SimpleAuthenticator();
+        auth = new SimpleAuthenticator();
     }
 
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilterTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilterTest.java Wed Jun 16 10:46:18 2010
@@ -28,6 +28,8 @@ import java.util.Set;
 
 import static org.junit.Assert.assertEquals;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.server.core.authz.support.HighestPrecedenceFilter;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -35,6 +37,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.aci.UserClass;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -43,6 +46,8 @@ import org.junit.Test;
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  *
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class HighestPrecedenceFilterTest
 {
     private static final Collection<ProtectedItem> PI_EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList<ProtectedItem>() );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java Wed Jun 16 10:46:18 2010
@@ -29,6 +29,8 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.server.core.MockOperation;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -44,6 +46,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.util.LdapExceptionUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -51,6 +54,8 @@ import org.junit.Test;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class MaxImmSubFilterTest
 {
     private static final Collection<ACITuple> EMPTY_ACI_TUPLE_COLLECTION = Collections

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=955186&r1=955185&r2=955186&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java Wed Jun 16 10:46:18 2010
@@ -29,6 +29,8 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.directory.junit.tools.Concurrent;
+import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -37,15 +39,14 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
 import org.apache.directory.shared.ldap.schema.manager.impl.DefaultSchemaManager;
 import org.apache.directory.shared.ldap.util.LdapExceptionUtils;
-import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 
 
 /**
@@ -53,6 +54,8 @@ import org.junit.Test;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrent()
 public class MaxValueCountFilterTest
 {
     private static final Collection<ACITuple> EMPTY_ACI_TUPLE_COLLECTION = Collections.unmodifiableCollection( new ArrayList<ACITuple>() );
@@ -89,12 +92,7 @@ public class MaxValueCountFilterTest
         {
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
-    }
-    
-    
-    @Before 
-    public void setup() throws LdapInvalidDnException
-    {
+
         DN entryName = new DN( "ou=test, ou=system" );
         ENTRY = new DefaultEntry( schemaManager, entryName );
         FULL_ENTRY = new DefaultEntry( schemaManager, entryName );
@@ -102,8 +100,8 @@ public class MaxValueCountFilterTest
         ENTRY.put( "cn", "1" );
         FULL_ENTRY.put( "cn", "1", "2", "3" );
     }
-
-
+    
+    
     @Test 
     public void testWrongScope() throws Exception
     {



Mime
View raw message