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 2012/10/15 23:09:01 UTC
svn commit: r1398522 - in /directory/apacheds/trunk/test-framework/src:
main/java/org/apache/directory/server/core/integ/
test/java/org/apache/directory/server/core/integ/
Author: elecharny
Date: Mon Oct 15 21:09:00 2012
New Revision: 1398522
URL: http://svn.apache.org/viewvc?rev=1398522&view=rev
Log:
Removed anything related to suites
Removed:
directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuite.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuiteServer.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestSuiteWithoutFactory.java
Modified:
directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java
directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassC.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassServer.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java
directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java
Modified: directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java (original)
+++ directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/AbstractLdapTestUnit.java Mon Oct 15 21:09:00 2012
@@ -41,10 +41,6 @@ public abstract class AbstractLdapTestUn
/** The used KdcServer instance */
public static KdcServer kdcServer;
- /** A flag set if the test is run in a suite */
- public static boolean isRunInSuite;
-
-
public static DirectoryService getService()
{
return service;
@@ -79,16 +75,4 @@ public abstract class AbstractLdapTestUn
{
AbstractLdapTestUnit.kdcServer = kdcServer;
}
-
-
- public static boolean isRunInSuite()
- {
- return isRunInSuite;
- }
-
-
- public static void setRunInSuite( boolean isRunInSuite )
- {
- AbstractLdapTestUnit.isRunInSuite = isRunInSuite;
- }
}
Modified: directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java (original)
+++ directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java Mon Oct 15 21:09:00 2012
@@ -19,7 +19,6 @@
package org.apache.directory.server.core.integ;
-import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.UUID;
@@ -36,7 +35,6 @@ import org.apache.directory.server.facto
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.kerberos.kdc.KdcServer;
import org.apache.directory.server.ldap.LdapServer;
-import org.apache.directory.server.protocol.shared.transport.Transport;
import org.apache.directory.shared.ldap.codec.standalone.StandaloneLdapApiService;
import org.junit.Ignore;
import org.junit.runner.Description;
@@ -69,12 +67,6 @@ public class FrameworkRunner extends Blo
/** The 'kdcServer' field in the run tests */
private static final String SET_KDC_SERVER_METHOD_NAME = "setKdcServer";
- /** 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";
-
- /** The suite this class depend on, if any */
- private FrameworkSuite suite;
-
/** The DirectoryService for this class, if any */
private DirectoryService classDS;
@@ -146,70 +138,24 @@ public class FrameworkRunner extends Blo
// We have a class DS defined, update it
directoryService = classDS;
- // Get the applyLdifs for each level and apply them
- if ( suite != null )
- {
- DSAnnotationProcessor.applyLdifs( suite.getDescription(), classDS );
- }
-
DSAnnotationProcessor.applyLdifs( getDescription(), classDS );
}
else
{
- // No class DS. Do we have a Suite ?
- if ( suite != null )
- {
- // yes. Do we have a suite DS ?
- directoryService = suite.getDirectoryService();
-
- if ( directoryService != null )
- {
- // yes : apply the class LDIFs only, and tag for reversion
- revision = getCurrentRevision( directoryService );
-
- // apply the class LDIFs
- DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
- }
- else
- {
- // No : define a default DS for the suite then
- DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();
-
- directoryService = dsf.getDirectoryService();
- // enable CL explicitly cause we are not using DSAnnotationProcessor
- directoryService.getChangeLog().setEnabled( true );
-
- dsf.init( "default" + UUID.randomUUID().toString() );
-
- // Stores it into the suite
- suite.setDirectoryService( directoryService );
-
- // Apply the suite LDIF first
- DSAnnotationProcessor.applyLdifs( suite.getDescription(), directoryService );
-
- // Then tag for reversion and apply the class LDIFs
- revision = getCurrentRevision( directoryService );
-
- DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
- }
- }
- else
- {
- // No : define a default class DS then
- DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();
-
- directoryService = dsf.getDirectoryService();
- // enable CL explicitly cause we are not using DSAnnotationProcessor
- directoryService.getChangeLog().setEnabled( true );
-
- dsf.init( "default" + UUID.randomUUID().toString() );
-
- // Stores the defaultDS in the classDS
- classDS = directoryService;
-
- // Apply the class LDIFs
- DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
- }
+ // No : define a default class DS then
+ DirectoryServiceFactory dsf = DefaultDirectoryServiceFactory.class.newInstance();
+
+ directoryService = dsf.getDirectoryService();
+ // enable CL explicitly cause we are not using DSAnnotationProcessor
+ directoryService.getChangeLog().setEnabled( true );
+
+ dsf.init( "default" + UUID.randomUUID().toString() );
+
+ // Stores the defaultDS in the classDS
+ classDS = directoryService;
+
+ // Apply the class LDIFs
+ DSAnnotationProcessor.applyLdifs( getDescription(), directoryService );
}
// check if it has a LdapServerBuilder
@@ -218,19 +164,6 @@ public class FrameworkRunner extends Blo
{
classLdapServer = ServerAnnotationProcessor.createLdapServer( getDescription(), directoryService );
}
- else if ( ( suite != null ) && ( suite.getLdapServer() != null ) )
- {
- classLdapServer = suite.getLdapServer();
-
- // set directoryService only if there is no class level DS
- if ( directoryService == null )
- {
- directoryService = classLdapServer.getDirectoryService();
- }
-
- // no need to inject the LDIF data that would have been done above
- // if ApplyLdifs is present
- }
if ( classKdcServer == null )
{
@@ -239,23 +172,16 @@ public class FrameworkRunner extends Blo
classKdcServer = ServerAnnotationProcessor.getKdcServer( getDescription(), directoryService,
minPort + 1 );
}
- else if ( suite != null )
- {
- // TODO add suite level KdcServer support
- }
- if ( suite == null )
- {
- // print out information which partition factory we use
- DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
- PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
- LOG.debug( "Using partition factory {}", partitionFactory.getClass().getSimpleName() );
- }
+ // print out information which partition factory we use
+ DirectoryServiceFactory dsFactory = DefaultDirectoryServiceFactory.class.newInstance();
+ PartitionFactory partitionFactory = dsFactory.getPartitionFactory();
+ LOG.debug( "Using partition factory {}", partitionFactory.getClass().getSimpleName() );
// Now run the class
super.run( notifier );
- if ( classLdapServer != null && ( ( suite == null ) || ( suite.getLdapServer() != classLdapServer ) ) )
+ if ( classLdapServer != null )
{
classLdapServer.stop();
}
@@ -289,7 +215,6 @@ public class FrameworkRunner extends Blo
finally
{
// help GC to get rid of the directory service with all its references
- suite = null;
classDS = null;
classLdapServer = null;
classKdcServer = null;
@@ -304,22 +229,6 @@ public class FrameworkRunner extends Blo
{
int minPort = 0;
- if ( suite != null )
- {
- LdapServer suiteServer = suite.getLdapServer();
-
- if ( suiteServer != null )
- {
- for ( Transport transport : suiteServer.getTransports() )
- {
- if ( minPort <= transport.getPort() )
- {
- minPort = transport.getPort();
- }
- }
- }
- }
-
return minPort;
}
@@ -347,11 +256,6 @@ public class FrameworkRunner extends Blo
// Get the applyLdifs for each level
Description suiteDescription = null;
- if ( suite != null )
- {
- suiteDescription = suite.getDescription();
- }
-
Description classDescription = getDescription();
Description methodDescription = describeChild( method );
@@ -408,20 +312,9 @@ public class FrameworkRunner extends Blo
DSAnnotationProcessor.applyLdifs( methodDescription, directoryService );
}
- else if ( suite != null )
- {
- directoryService = suite.getDirectoryService();
-
- // apply the method LDIFs, and tag for reversion
- revision = getCurrentRevision( directoryService );
-
- DSAnnotationProcessor.applyLdifs( methodDescription, directoryService );
- }
if ( methodLdapServerBuilder != null )
{
- int minPort = getMinPort();
-
methodLdapServer = ServerAnnotationProcessor.createLdapServer( methodDescription, directoryService );
}
@@ -440,9 +333,6 @@ public class FrameworkRunner extends Blo
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 );
-
Method setLdapServer = getTestClass().getJavaClass().getMethod( SET_LDAP_SERVER_METHOD_NAME,
LdapServer.class );
Method setKdcServer = getTestClass().getJavaClass().getMethod( SET_KDC_SERVER_METHOD_NAME, KdcServer.class );
@@ -524,26 +414,6 @@ public class FrameworkRunner extends Blo
}
- /**
- * Set the Suite reference into this class
- *
- * @param suite The suite this classd is contained into
- */
- public void setSuite( FrameworkSuite suite )
- {
- this.suite = suite;
- }
-
-
- /**
- * @return The Suite this class is contained nto, if any
- */
- public FrameworkSuite getSuite()
- {
- return suite;
- }
-
-
private long getCurrentRevision( DirectoryService dirService ) throws Exception
{
if ( ( dirService != null ) && ( dirService.getChangeLog().isEnabled() ) )
Modified: directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java (original)
+++ directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassA.java Mon Oct 15 21:09:00 2012
@@ -56,11 +56,6 @@ public class TestClassA extends Abstract
})
public void testWithFactoryAnnotation() throws Exception
{
- if ( isRunInSuite )
- {
- assertTrue( getService().getAdminSession().exists( new Dn( "cn=testSuite,ou=system" ) ) );
- }
-
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testClassA,ou=system" ) ) );
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testMethodA,ou=system" ) ) );
}
@@ -76,11 +71,6 @@ public class TestClassA extends Abstract
})
public void testWithoutFactoryAnnotation() throws Exception
{
- if ( isRunInSuite )
- {
- assertTrue( getService().getAdminSession().exists( new Dn( "cn=testSuite,ou=system" ) ) );
- }
-
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testClassA,ou=system" ) ) );
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testClassA2,ou=system" ) ) );
assertFalse( getService().getAdminSession().exists( new Dn( "cn=testMethodA,ou=system" ) ) );
Modified: directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java (original)
+++ directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java Mon Oct 15 21:09:00 2012
@@ -42,11 +42,6 @@ public class TestClassB extends Abstract
@CreateDS(name = "testDS")
public void testWithFactoryAnnotation() throws Exception
{
- if ( isRunInSuite )
- {
- assertTrue( getService().getAdminSession().exists( new Dn( "cn=testSuite,ou=system" ) ) );
- }
-
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testClassB,ou=system" ) ) );
}
@@ -54,15 +49,6 @@ public class TestClassB extends Abstract
@Test
public void testWithoutFactoryAnnotation() throws Exception
{
- // this assertion will only work if ran as part of TestSuite
- // commenting this to make maven report test success, uncomment in an IDE
- // while running the TestSuite
- // assertTrue( getService().getAdminSession().exists( new Dn( "cn=testSuite,ou=system" ) ) );
- if ( isRunInSuite )
- {
- assertTrue( getService().getAdminSession().exists( new Dn( "cn=testSuite,ou=system" ) ) );
- }
-
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testClassB,ou=system" ) ) );
}
}
Modified: directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassC.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassC.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassC.java (original)
+++ directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassC.java Mon Oct 15 21:09:00 2012
@@ -34,11 +34,6 @@ public class TestClassC extends Abstract
@Test
public void testWithoutMethodOrClassLevelFactory() throws Exception
{
- if ( isRunInSuite )
- {
- assertTrue( getService().getAdminSession().exists( new Dn( "cn=testSuite,ou=system" ) ) );
- }
-
assertFalse( getService().getAdminSession().exists( new Dn( "cn=testClassC,ou=system" ) ) );
// the below Dn will be injected in TestClassB when ran as suite, but that Dn
Modified: directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassServer.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassServer.java (original)
+++ directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassServer.java Mon Oct 15 21:09:00 2012
@@ -36,11 +36,6 @@ public class TestClassServer extends Abs
{
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testPerson1,ou=system" ) ) );
- if ( isRunInSuite )
- {
- assertTrue( getService().getAdminSession().exists( new Dn( "dc=example,dc=com" ) ) );
- }
-
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testPerson2,ou=system" ) ) );
}
}
Modified: directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java (original)
+++ directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestMultiLevelDS.java Mon Oct 15 21:09:00 2012
@@ -39,15 +39,9 @@ import org.junit.runner.RunWith;
@CreateDS(name = "TestMultiLevelDS-class")
public class TestMultiLevelDS extends AbstractLdapTestUnit
{
-
@Test
public void testMethodWithClassLevelDs()
{
- // to make this test pass standalone
- if ( isRunInSuite )
- {
- assertTrue( getLdapServer().getDirectoryService() == getService() );
- }
assertFalse( getService().isAccessControlEnabled() );
assertEquals( "TestMultiLevelDS-class", getService().getInstanceId() );
}
@@ -57,11 +51,6 @@ public class TestMultiLevelDS extends Ab
@CreateDS(enableAccessControl = true, name = "testMethodWithClassLevelDs-method")
public void testMethodWithMethodLevelDs()
{
- // to make this test pass standalone
- if ( isRunInSuite )
- {
- assertTrue( getLdapServer().getDirectoryService() == getService() );
- }
assertTrue( getService().isAccessControlEnabled() );
assertEquals( "testMethodWithClassLevelDs-method", getService().getInstanceId() );
}
Modified: directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java?rev=1398522&r1=1398521&r2=1398522&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java (original)
+++ directory/apacheds/trunk/test-framework/src/test/java/org/apache/directory/server/core/integ/TestWithClassLevelLdapServer.java Mon Oct 15 21:09:00 2012
@@ -45,17 +45,7 @@ public class TestWithClassLevelLdapServe
{
assertTrue( getService().getAdminSession().exists( new Dn( "cn=testPerson1,ou=system" ) ) );
- if ( isRunInSuite )
- {
- 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", getLdapServer().getDirectoryService().getInstanceId() );
- }
- else
- // should run with a default DS created in FrameworkRunner
- {
- assertTrue( getLdapServer().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" ) ) );