directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1039011 - in /directory/apacheds/trunk/server-integ: ./ src/test/java/org/apache/directory/server/operations/bind/ src/test/java/org/apache/directory/server/ssl/
Date Thu, 25 Nov 2010 12:02:58 GMT
Author: seelmann
Date: Thu Nov 25 12:02:57 2010
New Revision: 1039011

URL: http://svn.apache.org/viewvc?rev=1039011&view=rev
Log:
Added dependency to junit-addons. Added MultiThreadedMultiInvoker rule to some test classes.
Fixed issues with unclosed resources

Modified:
    directory/apacheds/trunk/server-integ/pom.xml
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/BindIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsUpdateCertificateIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsConfidentialityIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsUpdateCertificateIT.java

Modified: directory/apacheds/trunk/server-integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/pom.xml?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/pom.xml (original)
+++ directory/apacheds/trunk/server-integ/pom.xml Thu Nov 25 12:02:57 2010
@@ -107,6 +107,12 @@
     </dependency>
     
     <dependency>
+      <groupId>org.apache.directory.junit</groupId>
+      <artifactId>junit-addons</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>commons-net</groupId>
       <artifactId>commons-net</artifactId>
       <scope>test</scope>

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/BindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/BindIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/BindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/BindIT.java
Thu Nov 25 12:02:57 2010
@@ -32,12 +32,14 @@ import netscape.ldap.LDAPConstraints;
 import netscape.ldap.LDAPControl;
 import netscape.ldap.LDAPException;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -84,6 +86,9 @@ import org.junit.runner.RunWith;
     })
 public class BindIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
 
     /**
      * Test with bindDn which is not even found under any namingContext of the

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java
Thu Nov 25 12:02:57 2010
@@ -48,6 +48,7 @@ import netscape.ldap.LDAPException;
 import netscape.ldap.LDAPUrl;
 
 import org.apache.commons.lang.ArrayUtils;
+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;
@@ -70,6 +71,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -106,6 +108,9 @@ import org.junit.runner.RunWith;
     })
 public class MiscBindIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     private boolean oldAnnonymousAccess;
 
     @Before
@@ -298,6 +303,7 @@ public class MiscBindIT extends Abstract
         list.close();
         Attribute creatorsName = result.getAttributes().get( "creatorsName" );
         assertEquals( "", creatorsName.get() );
+        ctx.destroySubcontext( "ou=blah,ou=system" );
     }
 
 
@@ -340,6 +346,8 @@ public class MiscBindIT extends Abstract
 
         InitialDirContext userCtx = new InitialDirContext( env );
         assertNotNull( userCtx );
+
+        ctx.destroySubcontext( "cn=Kate Bush" );
     }
 
 
@@ -428,5 +436,7 @@ public class MiscBindIT extends Abstract
         assertNotNull( kate );
         assertTrue( ArrayUtils.isEquals( Asn1StringUtils.getBytesUtf8( "Aerial" ), kate.getAttributes(
"" ).get(
                 "userPassword" ).get() ) );
+
+        ctx.destroySubcontext( "cn=Kate Bush" );
     }
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
Thu Nov 25 12:02:57 2010
@@ -37,6 +37,7 @@ import javax.naming.directory.InitialDir
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.net.SocketClient;
+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.CreateKdcServer;
@@ -74,6 +75,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -161,6 +163,9 @@ import org.slf4j.LoggerFactory;
     })
 public class SaslBindIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     public SaslBindIT() throws Exception
     {
         // On Windows 7 and Server 2008 the loopback address 127.0.0.1

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java
Thu Nov 25 12:02:57 2010
@@ -45,6 +45,7 @@ import netscape.ldap.LDAPException;
 import netscape.ldap.LDAPSearchResults;
 import netscape.ldap.LDAPUrl;
 
+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;
@@ -56,6 +57,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.message.BindResponse;
 import org.apache.directory.shared.ldap.message.LdapResult;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -77,6 +79,9 @@ import org.junit.runner.RunWith;
     { @CreateTransport(protocol = "LDAP") })
 public class SimpleBindIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     private static final String BASE = "ou=users,ou=system";
 
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java
Thu Nov 25 12:02:57 2010
@@ -29,6 +29,7 @@ import javax.naming.directory.Attributes
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.annotations.SaslMechanism;
@@ -44,6 +45,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.operations.bind.BogusNtlmProvider;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -80,6 +82,9 @@ import org.junit.runner.RunWith;
     )
 public class LdapsIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     private static final String RDN = "cn=The Person";
     
     
@@ -118,5 +123,8 @@ public class LdapsIT extends AbstractLda
         DirContext person = ctx.createSubcontext( RDN, attributes );
 
         assertNotNull( person );
+
+        person.close();
+        ctx.destroySubcontext( RDN );
     }
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsUpdateCertificateIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsUpdateCertificateIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsUpdateCertificateIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsUpdateCertificateIT.java
Thu Nov 25 12:02:57 2010
@@ -31,6 +31,7 @@ import javax.naming.directory.DirContext
 import javax.naming.directory.InitialDirContext;
 import javax.naming.directory.ModificationItem;
 
+import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.annotations.SaslMechanism;
@@ -48,6 +49,7 @@ import org.apache.directory.server.opera
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.name.DN;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -84,6 +86,9 @@ import org.junit.runner.RunWith;
     )
 public class LdapsUpdateCertificateIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     /**
      * Create an entry for a person.
      */

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsConfidentialityIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsConfidentialityIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsConfidentialityIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsConfidentialityIT.java
Thu Nov 25 12:02:57 2010
@@ -52,6 +52,7 @@ import javax.naming.ldap.StartTlsRespons
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLSession;
 
+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.CoreSession;
@@ -64,6 +65,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -92,6 +94,9 @@ import org.slf4j.LoggerFactory;
     )
 public class StartTlsConfidentialityIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     private static final Logger LOG = LoggerFactory.getLogger( StartTlsConfidentialityIT.class
);
     private static final String[] CERT_IDS = new String[] { "userCertificate" };
     private File ksFile;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java
Thu Nov 25 12:02:57 2010
@@ -45,6 +45,7 @@ import javax.naming.ldap.StartTlsRespons
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLSession;
 
+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.CoreSession;
@@ -56,6 +57,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -84,6 +86,9 @@ import org.slf4j.LoggerFactory;
     )
 public class StartTlsIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     private static final Logger LOG = LoggerFactory.getLogger( StartTlsIT.class );
     private static final String[] CERT_IDS = new String[] { "userCertificate" };
     private static final int CONNECT_ITERATIONS = 10;
@@ -237,8 +242,21 @@ public class StartTlsIT extends Abstract
             tls.negotiate( ReloadableSSLSocketFactory.getDefault() );
 
             search( ii, ctx );
-            
-            tls.close();
+
+            // Don't call tls.close(), sometimes it hangs in socket.read() operation:
+            // Stack trace:
+            //     java.net.SocketInputStream.socketRead0(Native Method)
+            //     java.net.SocketInputStream.read(SocketInputStream.java:129)
+            //     com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
+            //     com.sun.net.ssl.internal.ssl.InputRecord.readV3Record(InputRecord.java:405)
+            //     com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:360)
+            //     com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
+            //        - locked java.lang.obj...@3dec90c3
+            //     com.sun.net.ssl.internal.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1467)
+            //     com.sun.net.ssl.internal.ssl.SSLSocketImpl.closeInternal(SSLSocketImpl.java:1419)
+            //     com.sun.net.ssl.internal.ssl.SSLSocketImpl.close(SSLSocketImpl.java:1313)
+            //     com.sun.jndi.ldap.ext.StartTlsResponseImpl.close(StartTlsResponseImpl.java:267)
+            // tls.close();
             ctx.close();
         }
     }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsUpdateCertificateIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsUpdateCertificateIT.java?rev=1039011&r1=1039010&r2=1039011&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsUpdateCertificateIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsUpdateCertificateIT.java
Thu Nov 25 12:02:57 2010
@@ -42,6 +42,7 @@ import javax.naming.ldap.StartTlsRespons
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLSession;
 
+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.CoreSession;
@@ -54,6 +55,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
@@ -82,6 +84,9 @@ import org.slf4j.LoggerFactory;
     )
 public class StartTlsUpdateCertificateIT extends AbstractLdapTestUnit
 {
+    @Rule
+    public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
+
     private static final Logger LOG = LoggerFactory.getLogger( StartTlsUpdateCertificateIT.class
);
     private static final String[] CERT_IDS = new String[] { "userCertificate" };
     private File ksFile;



Mime
View raw message