You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/06/29 01:00:26 UTC

svn commit: r958776 - in /directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api: LdapConnectionTest.java LdapSSLConnectionTest.java

Author: elecharny
Date: Mon Jun 28 23:00:26 2010
New Revision: 958776

URL: http://svn.apache.org/viewvc?rev=958776&view=rev
Log:
Fixed some failing tests (NPE)

Modified:
    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

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=958776&r1=958775&r2=958776&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java (original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java Mon Jun 28 23:00:26 2010
@@ -47,7 +47,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -72,18 +74,21 @@ public class LdapConnectionTest extends 
     private static LdapConnection connection;
     
     
-    @BeforeClass
-    public static void bindConnection() throws Exception
+    @Before
+    public void bindConnection() throws Exception
     {
         connection = new LdapNetworkConnection( "localhost", ldapServer.getPort() );
         connection.bind( ADMIN_DN, "secret" );
     }
     
     
-    @AfterClass
-    public static void unbindConnection() throws Exception
+    @After
+    public void unbindConnection() throws Exception
     {
-        connection.close();
+        if ( connection != null )
+        {
+            connection.close();
+        }
     }
     
     

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java?rev=958776&r1=958775&r2=958776&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java (original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapSSLConnectionTest.java Mon Jun 28 23:00:26 2010
@@ -48,6 +48,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
 import org.apache.directory.shared.ldap.name.DN;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -83,8 +84,8 @@ public class LdapSSLConnectionTest exten
     private static LdapConnectionConfig config;
     
     
-    @BeforeClass
-    public static void setup()
+    @Before
+    public void setup()
     {
         X509TrustManager X509 = new X509TrustManager()
         {