directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r894557 - in /directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ: AbstractLdapTestUnit.java FrameworkRunner.java FrameworkSuite.java
Date Wed, 30 Dec 2009 07:50:06 GMT
Author: elecharny
Date: Wed Dec 30 07:50:05 2009
New Revision: 894557

URL: http://svn.apache.org/viewvc?rev=894557&view=rev
Log:
Injected the LdapServer into the AbstractLdapServer class 

Modified:
    directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
    directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java?rev=894557&r1=894556&r2=894557&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java
Wed Dec 30 07:50:05 2009
@@ -20,6 +20,7 @@
 package org.apache.directory.server.core.integ;
 
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.ldap.LdapServer;
 
 
 /**
@@ -32,6 +33,10 @@
 {
     /** The used DirectoryService instance */
     public static DirectoryService service;
+
+    /** The used LdapServer instance */
+    public static LdapServer ldapServer;
+
     
     /** A flag set if the test is run in a suite */
     public static boolean isRunInSuite;

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=894557&r1=894556&r2=894557&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Wed Dec 30 07:50:05 2009
@@ -28,7 +28,6 @@
 import org.apache.directory.server.core.factory.DSAnnotationProcessor;
 import org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory;
 import org.apache.directory.server.core.factory.DirectoryServiceFactory;
-import org.apache.directory.server.factory.DefaultLdapServerFactory;
 import org.junit.Ignore;
 import org.junit.runner.Description;
 import org.junit.runner.notification.RunNotifier;
@@ -54,6 +53,9 @@
     /** The 'service' field in the run tests */
     private static final String DIRECTORY_SERVICE_FIELD_NAME = "service";
     
+    /** The 'ldapServer' field in the run tests */
+    private static final String LDAP_SERVER_FIELD_NAME = "ldapServer";
+    
     /** The filed used to tell the test that it is run in a suite */
     private static final String IS_RUN_IN_SUITE_FIELD_NAME = "isRunInSuite";
 
@@ -263,14 +265,20 @@
             // if we run this class in a suite, tell it to the test
             field = getTestClass().getJavaClass().getField( IS_RUN_IN_SUITE_FIELD_NAME );
             field.set( getTestClass().getJavaClass(), suite != null );
-
+            
             // Last not least, see if we have to start a server
-            if ( ( suite != null ) && ( suite.getSuiteLdapServerBuilder() != null
) )
+            if ( suite != null )
             {
-                CreateLdapServer ldapServerBuilder = suite.getSuiteLdapServerBuilder();
+                // If we have a LdapServer instance, feed the associated field too
+                field = getTestClass().getJavaClass().getField( LDAP_SERVER_FIELD_NAME );
+                field.set( getTestClass().getJavaClass(), suite.getLdapServer() );
+                
+                /*
+                CreateLdapServer ldapServerBuilder = suite.getLdapServerBuilder();
                 
                 DefaultLdapServerFactory ldapServerFactory = (DefaultLdapServerFactory)ldapServerBuilder.factory().newInstance();
                 ldapServerFactory.setDirectoryService( directoryService );
+                */
             }
 
             // Run the test

Modified: directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java?rev=894557&r1=894556&r2=894557&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
(original)
+++ directory/apacheds/branches/apacheds-schema/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
Wed Dec 30 07:50:05 2009
@@ -211,7 +211,7 @@
     /**
      * @return the suiteLdapServerBuilder
      */
-    public CreateLdapServer getSuiteLdapServerBuilder()
+    public CreateLdapServer getLdapServerBuilder()
     {
         return ldapServerBuilder;
     }
@@ -220,7 +220,7 @@
     /**
      * @return the suiteLdapServer
      */
-    public LdapServer getSuiteLdapServer()
+    public LdapServer getLdapServer()
     {
         return ldapServer;
     }



Mime
View raw message