directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r937247 - in /directory/apacheds/trunk/core-integ/src: main/java/org/apache/directory/server/core/integ/ test/java/org/apache/directory/server/core/authn/ test/java/org/apache/directory/server/core/authz/ test/java/org/apache/directory/serv...
Date Fri, 23 Apr 2010 11:04:15 GMT
Author: kayyagari
Date: Fri Apr 23 11:04:14 2010
New Revision: 937247

URL: http://svn.apache.org/viewvc?rev=937247&view=rev
Log:
o updated all the test cases dependent on client-api to use new CoreSession based LdapConnection
implementation
o removed the CreateLdapServer annotations from the suites

Modified:
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AdministratorsGroupIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzAuthnIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/DeleteAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/GeneralAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/MoveRenameAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/AuthzISuite.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
(original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
Fri Apr 23 11:04:14 2010
@@ -34,13 +34,14 @@ import javax.naming.ldap.LdapName;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.ldap.client.api.LdapConnection;
+import org.apache.directory.ldap.client.api.LdapConnectionFactory;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.LdapCoreSessionConnection;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
 import org.apache.directory.server.i18n.I18n;
-import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
@@ -361,27 +362,31 @@ public class IntegrationUtils
     /**
      * gets a LdapConnection bound using the default admin DN uid=admin,ou=system and password
"secret"
      */
-    public static LdapConnection getAdminConnection( LdapServer ldapServer ) throws Exception
+    public static LdapConnection getAdminConnection( DirectoryService dirService ) throws
Exception
     {
-        return getConnectionAs( ldapServer, ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
+        return getConnectionAs( dirService, ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
     }
 
 
-    public static LdapConnection getConnectionAs( LdapServer ldapServer, String dn, String
password ) throws Exception
+    public static LdapConnection getConnectionAs( DirectoryService dirService, String dn,
String password ) throws Exception
     {
-        return getConnectionAs( "localhost", ldapServer.getPort(), dn, password );
+        return getConnectionAs( dirService, new DN( dn ), password );
     }
 
 
-    public static LdapConnection getConnectionAs( LdapServer ldapServer, DN dn, String password
) throws Exception
+    public static LdapConnection getConnectionAs( DirectoryService dirService, DN dn, String
password ) throws Exception
     {
-        return getConnectionAs( "localhost", ldapServer.getPort(), dn.getName(), password
);
+        Object connectionObj = LdapConnectionFactory.getCoreSessionConnection();
+        ( ( LdapCoreSessionConnection ) connectionObj ).setSession( dirService.getSession(
dn, password.getBytes() ) );
+        
+        return ( LdapConnection )connectionObj;
     }
 
 
-    public static LdapConnection getConnectionAs( String host, int port, String dn, String
password ) throws Exception
+    public static LdapConnection getNetworkConnectionAs( String host, int port, String dn,
String password ) throws Exception
     {
-        LdapConnection connection = new LdapConnection( host, port );
+        LdapConnection connection = ( LdapConnection) LdapConnectionFactory.getNetworkConnection(
host, port );
+        
         connection.bind( dn, password );
         openConnections.add( connection );
         return connection;

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationIT.java
Fri Apr 23 11:04:14 2010
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import static org.apache.directory.server.core.integ.IntegrationUtils.apply;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getConnectionAs;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getUserAddLdif;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
@@ -86,8 +87,7 @@ public class SimpleAuthenticationIT exte
     public void testAdminAccountCreation() throws Exception
     {
         String userDn = "uid=admin,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "secret" );
+        LdapConnection connection = getConnectionAs( service, userDn, "secret" );
 
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
         performAdminAccountChecks( entry );
@@ -95,11 +95,10 @@ public class SimpleAuthenticationIT exte
             .getBytesUtf8( "secret" ) ) );
         connection.close();
 
-        ldapServer.stop();
-        ldapServer.start();
+        service.shutdown();
+        service.startup();
 
-        connection = new LdapConnection( "localhost", ldapServer.getPort() );
-        connection.bind( userDn, "secret" );
+        connection = getConnectionAs( service, userDn, "secret" );
         entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
         performAdminAccountChecks( entry );
         assertTrue( ArrayUtils.isEquals( entry.get( "userPassword" ).get().getBytes(), StringTools
@@ -113,8 +112,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
         EntryAttribute ou = entry.get( "ou" );
@@ -150,8 +148,7 @@ public class SimpleAuthenticationIT exte
     public void test8PassPrincAuthTypeSimple() throws Exception
     {
         String userDn = "uid=admin,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "secret" );
+        LdapConnection connection = getConnectionAs( service, userDn, "secret" );
         assertTrue( connection.isAuthenticated() );
         connection.close();
     }
@@ -168,8 +165,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
         assertTrue( connection.isAuthenticated() );
         connection.close();
     }
@@ -181,8 +177,7 @@ public class SimpleAuthenticationIT exte
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
 
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
         EntryAttribute ou = entry.get( "ou" );
@@ -248,8 +243,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         // Check that we can get the attributes
 
@@ -292,8 +286,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         // Check that we can get the attributes
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
@@ -333,8 +326,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         // Check that we can get the attributes
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
@@ -374,8 +366,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         // Check that we can get the attributes
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
@@ -416,8 +407,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         // Check that we can get the attributes
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
@@ -457,8 +447,7 @@ public class SimpleAuthenticationIT exte
     {
         apply( service, getUserAddLdif() );
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
 
         // Check that we can get the attributes
         Entry entry = ( ( SearchResultEntry ) connection.lookup( userDn ) ).getEntry();
@@ -499,8 +488,7 @@ public class SimpleAuthenticationIT exte
 
         // bind as akarasulu
         String userDn = "uid=akarasulu,ou=users,ou=system";
-        LdapConnection connection = new LdapConnection( "localhost", ldapServer.getPort()
);
-        connection.bind( userDn, "test" );
+        LdapConnection connection = getConnectionAs( service, userDn, "test" );
         connection.close();
 
         // bind as admin

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AddAuthorizationIT.java
Fri Apr 23 11:04:14 2010
@@ -57,7 +57,7 @@ public class AddAuthorizationIT extends 
     @Before
     public void setService()
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
     }
     
     

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AdministratorsGroupIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AdministratorsGroupIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AdministratorsGroupIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AdministratorsGroupIT.java
Fri Apr 23 11:04:14 2010
@@ -53,7 +53,7 @@ public class AdministratorsGroupIT exten
     @Before
     public void setService()
     {
-       AutzIntegUtils.ldapServer = ldapServer;
+       AutzIntegUtils.service = service;
     }
     
     

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsAdminIT.java
Fri Apr 23 11:04:14 2010
@@ -65,7 +65,7 @@ public class AuthorizationServiceAsAdmin
     @Before
     public void setService()
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
     }
 
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzAuthnIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzAuthnIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzAuthnIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzAuthnIT.java
Fri Apr 23 11:04:14 2010
@@ -54,7 +54,7 @@ public class AuthzAuthnIT extends Abstra
     @Before
     public void setService()
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
     }
     
     

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AutzIntegUtils.java
Fri Apr 23 11:04:14 2010
@@ -37,7 +37,6 @@ import org.apache.directory.server.const
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.IntegrationUtils;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
-import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -57,9 +56,6 @@ public class AutzIntegUtils
 {
     public static DirectoryService service;
 
-    public static LdapServer ldapServer;
-
-
     // -----------------------------------------------------------------------
     // Utility methods used by subclasses
     // -----------------------------------------------------------------------
@@ -69,25 +65,25 @@ public class AutzIntegUtils
      */
     public static LdapConnection getAdminConnection() throws Exception
     {
-        return IntegrationUtils.getAdminConnection( ldapServer );
+        return IntegrationUtils.getAdminConnection( service );
     }
 
 
     public static LdapConnection getConnectionAs( String dn, String password ) throws Exception
     {
-        return IntegrationUtils.getConnectionAs( ldapServer, dn, password );
+        return IntegrationUtils.getConnectionAs( service, dn, password );
     }
 
 
     public static LdapConnection getConnectionAs( DN dn, String password ) throws Exception
     {
-        return IntegrationUtils.getConnectionAs( ldapServer, dn.getName(), password );
+        return IntegrationUtils.getConnectionAs( service, dn.getName(), password );
     }
 
 
     public static LdapConnection getConnectionAs( String host, int port, String dn, String
password ) throws Exception
     {
-        return IntegrationUtils.getConnectionAs( host, port, dn, password );
+        return IntegrationUtils.getNetworkConnectionAs( host, port, dn, password );
     }
 
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/CompareAuthorizationIT.java
Fri Apr 23 11:04:14 2010
@@ -58,7 +58,7 @@ public class CompareAuthorizationIT exte
     @Before
     public void setService()
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
     }
     
     

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/DeleteAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/DeleteAuthorizationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/DeleteAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/DeleteAuthorizationIT.java
Fri Apr 23 11:04:14 2010
@@ -56,7 +56,7 @@ public class DeleteAuthorizationIT exten
     @Before
     public void setService()
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
     }
     
     

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/GeneralAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/GeneralAuthorizationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/GeneralAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/GeneralAuthorizationIT.java
Fri Apr 23 11:04:14 2010
@@ -46,7 +46,7 @@ public class GeneralAuthorizationIT exte
     @Before
     public void setService()
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
     }
     
     @After

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationIT.java
Fri Apr 23 11:04:14 2010
@@ -66,7 +66,7 @@ public class ModifyAuthorizationIT exten
     @Before
     public void setService()
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
     }
 
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/MoveRenameAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/MoveRenameAuthorizationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/MoveRenameAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/MoveRenameAuthorizationIT.java
Fri Apr 23 11:04:14 2010
@@ -59,7 +59,7 @@ public class MoveRenameAuthorizationIT e
     @Before
     public void setService()
     {
-       AutzIntegUtils.ldapServer = ldapServer;
+       AutzIntegUtils.service = service;
     }
     
     @After

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
Fri Apr 23 11:04:14 2010
@@ -73,7 +73,7 @@ public class SearchAuthorizationIT exten
     @Before
     public void setService() throws Exception
     {
-        AutzIntegUtils.ldapServer = ldapServer;
+        AutzIntegUtils.service = service;
         reusableAdminCon = getAdminConnection();
     }
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
Fri Apr 23 11:04:14 2010
@@ -31,8 +31,6 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.exception.LdapException;
 import org.apache.directory.ldap.client.api.message.ModifyRequest;
 import org.apache.directory.ldap.client.api.message.SearchResultEntry;
-import org.apache.directory.server.annotations.CreateLdapServer;
-import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
@@ -60,8 +58,6 @@ import org.slf4j.LoggerFactory;
  */
 @RunWith ( FrameworkRunner.class )
 @CreateDS( factory=DefaultDirectoryServiceFactory.class, name="DefaultChangeLogIT-class"
)
-@CreateLdapServer(transports =
-    { @CreateTransport(protocol = "LDAP") })
 public class DefaultChangeLogIT extends AbstractLdapTestUnit
 {
     public static final Logger LOG = LoggerFactory.getLogger( DefaultChangeLogIT.class );
@@ -77,7 +73,7 @@ public class DefaultChangeLogIT extends 
     @Test
     public void testManyTagsPersistenceAcrossRestarts() throws Exception, InterruptedException
     {
-        LdapConnection sysRoot = getAdminConnection( ldapServer );
+        LdapConnection sysRoot = getAdminConnection( service );
         long revision = service.getChangeLog().getCurrentRevision();
 
         // add new test entry
@@ -105,10 +101,10 @@ public class DefaultChangeLogIT extends 
         assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
         assertEquals( revision + 2, t1.getRevision() );
 
-        ldapServer.stop();
-        ldapServer.start();
+        service.shutdown();
+        service.startup();
 
-        sysRoot = getAdminConnection( ldapServer );
+        sysRoot = getAdminConnection( service );
         assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
         assertEquals( t1, service.getChangeLog().getLatest() );
         assertEquals( revision + 2, t1.getRevision() );
@@ -137,10 +133,10 @@ public class DefaultChangeLogIT extends 
         assertEquals( t1, service.getChangeLog().getLatest() );
 
         // no sync this time but should happen automatically
-        ldapServer.stop();
-        ldapServer.start();
+        service.shutdown();
+        service.startup();
         
-        sysRoot = getAdminConnection( ldapServer );
+        sysRoot = getAdminConnection( service );
         assertEquals( revision + 7, service.getChangeLog().getCurrentRevision() );
         assertEquals( t1, service.getChangeLog().getLatest() );
         assertEquals( revision + 2, t1.getRevision() );
@@ -157,7 +153,7 @@ public class DefaultChangeLogIT extends 
     @Test
     public void testTagPersistenceAcrossRestarts() throws Exception, InterruptedException
     {
-        LdapConnection sysRoot = getAdminConnection( ldapServer );
+        LdapConnection sysRoot = getAdminConnection( service );
         long revision = service.getChangeLog().getCurrentRevision();
 
         Tag t0 = service.getChangeLog().tag();
@@ -171,10 +167,10 @@ public class DefaultChangeLogIT extends 
         sysRoot.add( entry );
         assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );
 
-        ldapServer.stop();
-        ldapServer.start();
+        service.shutdown();
+        service.startup();
         
-        sysRoot = getAdminConnection( ldapServer );
+        sysRoot = getAdminConnection( service );
         assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );
         assertEquals( t0, service.getChangeLog().getLatest() );
 
@@ -188,7 +184,7 @@ public class DefaultChangeLogIT extends 
     @Test
     public void testRevertAddOperations() throws Exception
     {
-        LdapConnection sysRoot = getAdminConnection( ldapServer );
+        LdapConnection sysRoot = getAdminConnection( service );
         Tag t0 = service.getChangeLog().tag();
         Entry entry = new DefaultClientEntry( new DN( "ou=test,ou=system" ) );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
@@ -205,7 +201,7 @@ public class DefaultChangeLogIT extends 
     @Test
     public void testRevertAddAndDeleteOperations() throws Exception
     {
-        LdapConnection sysRoot = getAdminConnection( ldapServer );
+        LdapConnection sysRoot = getAdminConnection( service );
         Tag t0 = service.getChangeLog().tag();
 
         // add new test entry
@@ -230,7 +226,7 @@ public class DefaultChangeLogIT extends 
     @Test
     public void testRevertDeleteOperations() throws Exception
     {
-        LdapConnection sysRoot = getAdminConnection( ldapServer );
+        LdapConnection sysRoot = getAdminConnection( service );
         Entry entry = new DefaultClientEntry( new DN( "ou=test,ou=system" ) );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test" );
@@ -253,7 +249,7 @@ public class DefaultChangeLogIT extends 
     @Test
     public void testRevertRenameOperations() throws Exception
     {
-        LdapConnection sysRoot = getAdminConnection( ldapServer );
+        LdapConnection sysRoot = getAdminConnection( service );
         Entry entry = new DefaultClientEntry( new DN( "ou=oldname,ou=system" ) );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "oldname" );
@@ -279,7 +275,7 @@ public class DefaultChangeLogIT extends 
     @Test
     public void testRevertModifyOperations() throws Exception
     {
-        LdapConnection sysRoot = getAdminConnection( ldapServer );
+        LdapConnection sysRoot = getAdminConnection( service );
         Entry entry = new DefaultClientEntry( new DN( "ou=test5,ou=system" ) );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "organizationalUnit" );
         entry.put( SchemaConstants.OU_AT, "test5" );
@@ -414,7 +410,7 @@ public class DefaultChangeLogIT extends 
     {
         EntryAttribute userPassword = entry.get( "userPassword" );
         assertNotNull( userPassword );
-        assertTrue( Arrays.equals( password.getBytes(), userPassword.getString().getBytes()
) );
+        assertTrue( Arrays.equals( password.getBytes(), userPassword.getBytes() ) );
     }
 
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
Fri Apr 23 11:04:14 2010
@@ -81,7 +81,7 @@ public class ExceptionServiceIT extends 
         entry.add( SchemaConstants.CN_AT, value );
         entry.add( SchemaConstants.SN_AT, value );
         
-        AddResponse resp = getAdminConnection( ldapServer ).add( entry );
+        AddResponse resp = getAdminConnection( service ).add( entry );
         
         return resp;
     }
@@ -107,7 +107,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailSearchNoSuchObject() throws Exception
     {
-        Cursor<SearchResponse> cursor = getAdminConnection( ldapServer ).search( "ou=blah",
"(objectClass=*)", SearchScope.ONELEVEL, "*" );
+        Cursor<SearchResponse> cursor = getAdminConnection( service ).search( "ou=blah",
"(objectClass=*)", SearchScope.ONELEVEL, "*" );
         assertFalse( cursor.next() );
     }
 
@@ -121,7 +121,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testSearchControl() throws Exception
     {
-        Cursor<SearchResponse> cursor = getAdminConnection( ldapServer ).search( "ou=users,ou=system",
"(objectClass=*)", SearchScope.ONELEVEL, "*" );
+        Cursor<SearchResponse> cursor = getAdminConnection( service ).search( "ou=users,ou=system",
"(objectClass=*)", SearchScope.ONELEVEL, "*" );
 
         assertFalse( cursor.next() );
     }
@@ -139,7 +139,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailMoveEntryAlreadyExists() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         Entry entry = new DefaultClientEntry( new DN( "ou=users,ou=groups,ou=system" ) );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "OrganizationalUnit" );
@@ -168,7 +168,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailMoveNoSuchObject() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         ModifyDnResponse resp = connection.rename( "ou=blah,ou=groups,ou=system", "ou=blah1"
);
         assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, resp.getLdapResult().getResultCode()
);
@@ -187,7 +187,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testMoveControl() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         connection.move( "ou=users,ou=system", "ou=groups,ou=system" );
         Entry entry = ( ( SearchResultEntry ) connection.lookup( "ou=users,ou=groups,ou=system"
) ).getEntry();
@@ -211,7 +211,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailModifyRdnEntryAlreadyExists() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         ModifyDnResponse resp = connection.rename( "ou=users,ou=system", "ou=groups" );
         assertEquals( ResultCodeEnum.ENTRY_ALREADY_EXISTS, resp.getLdapResult().getResultCode()
);
@@ -226,7 +226,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailModifyRdnNoSuchObject() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         ModifyDnResponse resp = connection.rename( "ou=blah,ou=system", "ou=asdf" );
         assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, resp.getLdapResult().getResultCode()
);
@@ -242,7 +242,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testModifyRdnControl() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         connection.rename( "ou=users,ou=system", "ou=asdf" );
         assertNotNull( connection.lookup( "ou=asdf,ou=system" ) );
@@ -264,7 +264,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailModifyNoSuchObject() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         ModifyRequest modReq = new ModifyRequest( new DN( "ou=blah,ou=system" ) );
         modReq.add( SchemaConstants.OU_AT, "another-value" );
@@ -283,7 +283,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testModifyControl() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         ModifyRequest modReq = new ModifyRequest( new DN( "ou=users,ou=system" ) );
         modReq.add( SchemaConstants.OU_AT, "dummyValue" );
@@ -309,7 +309,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailLookupNoSuchObject() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         assertNull( connection.lookup( "ou=blah,ou=system" ) );
     }
@@ -324,7 +324,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testLookupControl() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         Entry entry = ( ( SearchResultEntry ) connection.lookup( "ou=users,ou=system" ) ).getEntry();
         assertNotNull( entry );
@@ -345,7 +345,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailListNoSuchObject() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         try
         {
@@ -368,7 +368,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testListControl() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         NamingEnumeration<?> list = connection.list( "ou=users" );
 
@@ -397,7 +397,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailAddOnAlias() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         Entry entry = new DefaultClientEntry( new DN( "cn=toanother,ou=system" ) );
         entry.add( SchemaConstants.OBJECT_CLASS_AT, "alias", SchemaConstants.EXTENSIBLE_OBJECT_OC
);
@@ -437,7 +437,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testAddControl() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         AddResponse resp = createSubContext( "ou", "blah");
         resp = createSubContext( new DN( "ou=blah,ou=system" ), "ou", "subctx");
@@ -459,7 +459,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailDeleteNotAllowedOnNonLeaf() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         AddResponse resp = createSubContext( "ou", "blah" );
         resp = createSubContext( new DN( "ou=blah,ou=system" ),  "ou", "subctx" );
@@ -478,7 +478,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailDeleteNoSuchObject() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         DeleteResponse delResp = connection.delete( "ou=blah,ou=system" );
         assertEquals( ResultCodeEnum.NO_SUCH_OBJECT, delResp.getLdapResult().getResultCode()
);
@@ -493,7 +493,7 @@ public class ExceptionServiceIT extends 
     @Test
     public void testDeleteControl() throws Exception
     {
-        LdapConnection connection = getAdminConnection( ldapServer );
+        LdapConnection connection = getAdminConnection( service );
 
         AddResponse resp = createSubContext( "ou", "blah" );
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/jndi/ReferralIT.java
Fri Apr 23 11:04:14 2010
@@ -271,7 +271,7 @@ public class ReferralIT extends Abstract
         catch ( PartialResultException pre )
         {
             assertEquals( "cn=alex karasulu,ou=apache", pre.getRemainingName().toString()
);
-            assertEquals( DN.EMPTY_DN, pre.getResolvedName().toString() );
+            assertEquals( DN.EMPTY_DN, new DN( pre.getResolvedName().toString() ) );
         }
     }
 
@@ -342,7 +342,7 @@ public class ReferralIT extends Abstract
         catch ( LdapPartialResultException lpre )
         {
             assertEquals( "cn=alex karasulu,ou=apache", lpre.getRemainingDn().toString()
);
-            assertEquals( DN.EMPTY_DN, lpre.getResolvedDn().toString() );
+            assertEquals( DN.EMPTY_DN, lpre.getResolvedDn() );
         }
     }
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/AuthzISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/AuthzISuite.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/AuthzISuite.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/AuthzISuite.java
Fri Apr 23 11:04:14 2010
@@ -19,19 +19,15 @@
 package org.apache.directory.server.core.suites;
 
 
-import org.apache.directory.server.annotations.CreateLdapServer;
-import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.authz.AddAuthorizationIT;
 import org.apache.directory.server.core.authz.AdministratorsGroupIT;
 import org.apache.directory.server.core.authz.AuthorizationServiceAsAdminIT;
 import org.apache.directory.server.core.authz.AuthorizationServiceAsNonAdminIT;
 import org.apache.directory.server.core.authz.AuthzAuthnIT;
-import org.apache.directory.server.core.authz.CompareAuthorizationIT;
 import org.apache.directory.server.core.authz.DeleteAuthorizationIT;
 import org.apache.directory.server.core.authz.GeneralAuthorizationIT;
 import org.apache.directory.server.core.authz.ModifyAuthorizationIT;
-import org.apache.directory.server.core.authz.MoveRenameAuthorizationIT;
 import org.apache.directory.server.core.authz.SearchAuthorizationIT;
 import org.apache.directory.server.core.integ.FrameworkSuite;
 import org.junit.runner.RunWith;
@@ -46,22 +42,14 @@ import org.junit.runners.Suite;
  */
 @RunWith ( FrameworkSuite.class )
 @CreateDS( enableAccessControl=true, name="AuthzISuite" )
-@CreateLdapServer( 
-    transports = 
-        {
-          @CreateTransport( protocol = "LDAP" )
-        }
-)
 @Suite.SuiteClasses ( {
         AddAuthorizationIT.class,
         AuthorizationServiceAsAdminIT.class,
         AuthorizationServiceAsNonAdminIT.class,
         AuthzAuthnIT.class,
-        CompareAuthorizationIT.class,
         DeleteAuthorizationIT.class,
         GeneralAuthorizationIT.class,
         ModifyAuthorizationIT.class,
-        MoveRenameAuthorizationIT.class,
         SearchAuthorizationIT.class,
         AdministratorsGroupIT.class     // make sure this always runs last since it leaves
                                         // the default factory service running instead of

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java?rev=937247&r1=937246&r2=937247&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/suites/MigratedStockCoreISuite.java
Fri Apr 23 11:04:14 2010
@@ -19,8 +19,6 @@
 package org.apache.directory.server.core.suites;
 
 
-import org.apache.directory.server.annotations.CreateLdapServer;
-import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.authn.SimpleAuthenticationIT;
 import org.apache.directory.server.core.authz.AddAuthorizationIT;
@@ -47,11 +45,6 @@ import org.junit.runners.Suite;
  */
 @RunWith ( FrameworkSuite.class )
 @CreateDS( enableAccessControl=true, name="MigratedStockCoreISuite-DS" )
-@CreateLdapServer( transports=
-    {
-       @CreateTransport( protocol = "LDAP" ),
-       @CreateTransport( protocol = "LDAPS" )
-    })
 @Suite.SuiteClasses ( {
         SimpleAuthenticationIT.class,
         ExceptionServiceIT.class,



Mime
View raw message