directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1071769 [4/4] - in /directory/apacheds/branches/m1: core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/ kerberos-test/src/test/java/org/apache/directory/server/kerberos/kdc/ ldap-client-test/src/test/java/org/apache/di...
Date Thu, 17 Feb 2011 20:23:42 GMT
Modified: directory/apacheds/branches/m1/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=1071769&r1=1071768&r2=1071769&view=diff
==============================================================================
--- directory/apacheds/branches/m1/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/apacheds/branches/m1/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Thu Feb 17 20:23:38 2011
@@ -59,12 +59,10 @@ public class FrameworkRunner extends Blo
     private static final Logger LOG = LoggerFactory.getLogger( FrameworkRunner.class );
 
     /** The 'service' field in the run tests */
-    private static final String DIRECTORY_SERVICE_FIELD_NAME = "service";
-    private static final String GET_SERVICE_METHOD_NAME = "getService";
     private static final String SET_SERVICE_METHOD_NAME = "setService";
 
     /** The 'ldapServer' field in the run tests */
-    private static final String LDAP_SERVER_FIELD_NAME = "ldapServer";
+    private static final String SET_LDAP_SERVER_METHOD_NAME = "setLdapServer";
 
     /** The 'kdcServer' field in the run tests */
     private static final String KDC_SERVER_FIELD_NAME = "kdcServer";
@@ -393,14 +391,14 @@ public class FrameworkRunner extends Blo
             // At this point, we know which service to use.
             // Inject it into the class
             Method setService = getTestClass().getJavaClass().getMethod( SET_SERVICE_METHOD_NAME,
DirectoryService.class );
-            Method getService = getTestClass().getJavaClass().getMethod( GET_SERVICE_METHOD_NAME
);
             setService.invoke( getTestClass().getJavaClass(), directoryService );
 
             // if we run this class in a suite, tell it to the test
             Field runInSuiteField = getTestClass().getJavaClass().getField( IS_RUN_IN_SUITE_FIELD_NAME
);
             runInSuiteField.set( getTestClass().getJavaClass(), suite != null );
 
-            Field ldapServerField = getTestClass().getJavaClass().getField( LDAP_SERVER_FIELD_NAME
);
+            Method setServer = getTestClass().getJavaClass().getMethod( SET_LDAP_SERVER_METHOD_NAME,
LdapServer.class );
+            //Field ldapServerField = getTestClass().getJavaClass().getField( LDAP_SERVER_FIELD_NAME
);
 
             DirectoryService oldLdapServerDirService = null;
             DirectoryService oldKdcServerDirService = null;
@@ -409,7 +407,7 @@ public class FrameworkRunner extends Blo
                 // setting the directoryService is required to inject the correct level DS
instance in the class or suite level LdapServer
                 methodLdapServer.setDirectoryService( directoryService );
                 
-                ldapServerField.set( getTestClass().getJavaClass(), methodLdapServer );
+                setServer.invoke( getTestClass().getJavaClass(), methodLdapServer );
             }    
             else if ( classLdapServer != null )
             {
@@ -418,7 +416,7 @@ public class FrameworkRunner extends Blo
                 // setting the directoryService is required to inject the correct level DS
instance in the class or suite level LdapServer
                 classLdapServer.setDirectoryService( directoryService );
                 
-                ldapServerField.set( getTestClass().getJavaClass(), classLdapServer );
+                setServer.invoke( getTestClass().getJavaClass(), classLdapServer );
             }
             else if ( classKdcServer != null )
             {

Modified: directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java?rev=1071769&r1=1071768&r2=1071769&view=diff
==============================================================================
--- directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java
(original)
+++ directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java
Thu Feb 17 20:23:38 2011
@@ -44,7 +44,7 @@ public class TestMultiLevelDS extends Ab
         // to make this test pass standalone
         if( isRunInSuite )
         {
-            assertTrue( ldapServer.getDirectoryService() == getService() );
+            assertTrue( getLdapServer().getDirectoryService() == getService() );
         }
         assertFalse( getService().isAccessControlEnabled() );
         assertEquals( "TestMultiLevelDS-class", getService().getInstanceId() );
@@ -58,7 +58,7 @@ public class TestMultiLevelDS extends Ab
         // to make this test pass standalone
         if( isRunInSuite )
         {
-            assertTrue( ldapServer.getDirectoryService() == getService() );
+            assertTrue( getLdapServer().getDirectoryService() == getService() );
         }
         assertTrue( getService().isAccessControlEnabled() );
         assertEquals( "testMethodWithClassLevelDs-method", getService().getInstanceId() );

Modified: directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java?rev=1071769&r1=1071768&r2=1071769&view=diff
==============================================================================
--- directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java
(original)
+++ directory/apacheds/branches/m1/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java
Thu Feb 17 20:23:38 2011
@@ -47,15 +47,15 @@ public class TestWithClassLevelLdapServe
         {
             assertTrue( getService().getAdminSession().exists( new Dn( "dc=example,dc=com"
) ) );
             // the SuiteDS is the name given to the DS instance in the enclosing TestSuite
-            assertEquals( "SuiteDS", ldapServer.getDirectoryService().getInstanceId() );
+            assertEquals( "SuiteDS", getLdapServer().getDirectoryService().getInstanceId()
);
         }
         else // should run with a default DS created in FrameworkRunner
         {
-            assertTrue( ldapServer.getDirectoryService().getInstanceId().startsWith( "default"
) ); // after 'default' a UUID follows
+            assertTrue( getLdapServer().getDirectoryService().getInstanceId().startsWith(
"default" ) ); // after 'default' a UUID follows
         }
         
         assertTrue( getService().getAdminSession().exists( new Dn( "cn=testPerson2,ou=system"
) ) );
         
-        assertNotNull( ldapServer );
+        assertNotNull( getLdapServer() );
     }
 }



Mime
View raw message