directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r602644 - in /directory/apacheds/branches/bigbang/core-integ/src: main/java/org/apache/directory/server/core/integ/ main/java/org/apache/directory/server/core/integ/annotations/ test/java/org/apache/directory/server/core/ test/java/org/apac...
Date Sun, 09 Dec 2007 06:27:42 GMT
Author: akarasulu
Date: Sat Dec  8 22:27:41 2007
New Revision: 602644

URL: http://svn.apache.org/viewvc?rev=602644&view=rev
Log:
changing name of CleanupLevel to Level since we can use it for more than one tag and fixing
some buggy issues

Added:
    directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/Level.java
      - copied, changed from r602639, directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/ServiceCleanupLevel.java
Removed:
    directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/ServiceCleanupLevel.java
Modified:
    directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
    directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiSuite.java
    directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/InheritableSettings.java
    directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/annotations/CleanupLevel.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzISuite.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java

Modified: directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiRunner.java
Sat Dec  8 22:27:41 2007
@@ -70,8 +70,8 @@
     public void run( final RunNotifier notifier )
     {
         super.run( notifier );
-        ServiceCleanupLevel cleanupLevel = getSettings().getCleanupLevel();
-        if ( cleanupLevel == ServiceCleanupLevel.TESTCLASS )
+        Level cleanupLevel = getSettings().getCleanupLevel();
+        if ( cleanupLevel == Level.CLASS )
         {
             try
             {
@@ -96,8 +96,8 @@
         Description description = methodDescription( method );
         test( getTestClass(), wrapMethod( method ), notifier, new InheritableSettings( description,
getSettings() ) );
 
-        ServiceCleanupLevel cleanupLevel = getSettings().getCleanupLevel();
-        if ( cleanupLevel == ServiceCleanupLevel.TESTMETHOD )
+        Level cleanupLevel = getSettings().getCleanupLevel();
+        if ( cleanupLevel == Level.METHOD )
         {
             try
             {

Modified: directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiSuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiSuite.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiSuite.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/CiSuite.java
Sat Dec  8 22:27:41 2007
@@ -112,7 +112,7 @@
          * running tests.
          */
 
-        if ( settings.getCleanupLevel() != ServiceCleanupLevel.TESTSYSTEM )
+        if ( settings.getCleanupLevel() != Level.SYSTEM )
         {
             try
             {

Modified: directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/InheritableSettings.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/InheritableSettings.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/InheritableSettings.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/InheritableSettings.java
Sat Dec  8 22:27:41 2007
@@ -44,8 +44,8 @@
     private final InheritableSettings parent;
     /** junit test description containing all annotations queried */
     private final Description description;
-    /** default scope of a service */
-    private static final ServiceCleanupLevel DEFAULT_CLEANUP_LEVEL = ServiceCleanupLevel.TESTSUITE;
+    /** default level at which a service is cleaned up */
+    private static final Level DEFAULT_CLEANUP_LEVEL = Level.SUITE;
 
 
     /**
@@ -57,12 +57,6 @@
     {
         this.description = description;
         this.parent = null;
-
-//        if ( ! description.isSuite() )
-//        {
-//            throw new IllegalStateException( String.format( "%s is not a suite! It requires
parent settings.",
-//                    description.getDisplayName() ) );
-//        }
     }
 
 
@@ -200,9 +194,9 @@
     }
 
 
-    public ServiceCleanupLevel getCleanupLevel()
+    public Level getCleanupLevel()
     {
-        ServiceCleanupLevel parentCleanupLevel = DEFAULT_CLEANUP_LEVEL;
+        Level parentCleanupLevel = DEFAULT_CLEANUP_LEVEL;
         if ( parent != null )
         {
             parentCleanupLevel = parent.getCleanupLevel();

Copied: directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/Level.java
(from r602639, directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/ServiceCleanupLevel.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/Level.java?p2=directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/Level.java&p1=directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/ServiceCleanupLevel.java&r1=602639&r2=602644&rev=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/ServiceCleanupLevel.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/Level.java
Sat Dec  8 22:27:41 2007
@@ -20,28 +20,43 @@
 
 
 /**
- * Document me!
+ * A scope or level of testing.  There are four levels:
+ *
+ * <ul>
+ *   <li>
+ *     <b>system level</b>: the level external to the testing framework</li>
+ *   </li>
+ *   <li>
+ *     <b>suite level</b>: the level representing test suite scope</li>
+ *   </li>
+ *   <li>
+ *     <b>class level</b>: the level representing test class scope</li>
+ *   </li>
+ *   <li>
+ *     <b>method level</b>: the lowest level representing test method scope</li>
+ *   </li>
+ * </ul>
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public enum ServiceCleanupLevel
+public enum Level
 {
-    TESTSUITE( 0, "service has test suite level scope" ),
-    TESTCLASS( 1, "service has test class level scope" ),
-    TESTSYSTEM( 2, "service has test system level scope" ),
-    TESTMETHOD( 3, "service has test method level scope" );
+    SUITE( 0, "test suite level" ),
+    CLASS( 1, "test class level" ),
+    SYSTEM( 2, "test system level" ),
+    METHOD( 3, "test method level" );
 
     public final int ordinal;
     public final String description;
 
-    public static final int TESTSUITE_ORDINAL = 0;
-    public static final int TESTCLASS_ORDINAL = 1;
-    public static final int TESTSYSTEM_ORDINAL = 2;
-    public static final int TESTMETHOD_ORDINAL = 2;
+    public static final int SUITE_ORDINAL = 0;
+    public static final int CLASS_ORDINAL = 1;
+    public static final int SYSTEM_ORDINAL = 2;
+    public static final int METHOD_ORDINAL = 3;
 
 
-    ServiceCleanupLevel( int ordinal, String description )
+    Level( int ordinal, String description )
     {
         this.ordinal = ordinal;
         this.description = description;

Modified: directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/annotations/CleanupLevel.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/annotations/CleanupLevel.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/annotations/CleanupLevel.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/main/java/org/apache/directory/server/core/integ/annotations/CleanupLevel.java
Sat Dec  8 22:27:41 2007
@@ -19,7 +19,7 @@
  */
 package org.apache.directory.server.core.integ.annotations;
 
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
+import org.apache.directory.server.core.integ.Level;
 
 import java.lang.annotation.*;
 
@@ -36,5 +36,5 @@
 @Target ( { ElementType.METHOD, ElementType.TYPE } )
 public @interface CleanupLevel
 {
-     ServiceCleanupLevel value();
+     Level value();
 }

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
Sat Dec  8 22:27:41 2007
@@ -25,7 +25,7 @@
 import org.apache.directory.server.core.event.EventServiceIT;
 import org.apache.directory.server.core.exception.ExceptionServiceIT;
 import org.apache.directory.server.core.integ.CiSuite;
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
+import org.apache.directory.server.core.integ.Level;
 import org.apache.directory.server.core.integ.SetupMode;
 import org.apache.directory.server.core.integ.annotations.Mode;
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
@@ -85,7 +85,7 @@
         ReferralIT.class,
         PartitionConfigurationIT.class  // Leaves the server in a bad state (partition removal
is incomplete)
         } )
-@CleanupLevel ( ServiceCleanupLevel.TESTSUITE )
+@CleanupLevel ( Level.SUITE )
 @Mode ( SetupMode.ROLLBACK )
 public class StockCoreISuite
 {

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzISuite.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzISuite.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthzISuite.java
Sat Dec  8 22:27:41 2007
@@ -19,7 +19,7 @@
 package org.apache.directory.server.core.authz;
 
 import org.apache.directory.server.core.integ.CiSuite;
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
+import org.apache.directory.server.core.integ.Level;
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
@@ -47,7 +47,7 @@
                                         // the default factory service running instead of
                                         // one with 
         } )
-@CleanupLevel ( ServiceCleanupLevel.TESTSUITE )
+@CleanupLevel ( Level.SUITE )
 public class AuthzISuite
 {
 }

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/changelog/DefaultChangeLogIT.java
Sat Dec  8 22:27:41 2007
@@ -21,6 +21,9 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
+import static org.apache.directory.server.core.integ.state.TestServiceContext.shutdown;
+import static org.apache.directory.server.core.integ.state.TestServiceContext.startup;
+import static org.apache.directory.server.core.integ.state.TestServiceContext.revert;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
@@ -86,9 +89,8 @@
         assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
         assertEquals( revision + 2, t1.getRevision() );
 
-        service.sync();
-        service.shutdown();
-        service.startup();
+        shutdown();
+        startup();
 
         assertEquals( revision + 2, service.getChangeLog().getCurrentRevision() );
         assertEquals( t1, service.getChangeLog().getLatest() );
@@ -115,8 +117,8 @@
         assertEquals( t1, service.getChangeLog().getLatest() );
 
         // no sync this time but should happen automatically
-        service.shutdown();
-        service.startup();
+        shutdown();
+        startup();
         assertEquals( revision + 7, service.getChangeLog().getCurrentRevision() );
         assertEquals( t1, service.getChangeLog().getLatest() );
         assertEquals( revision + 2, t1.getRevision() );
@@ -146,10 +148,9 @@
         sysRoot.createSubcontext( "ou=test", attrs );
         assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );
 
-        service.sync();
-        service.shutdown();
+        shutdown();
+        startup();
 
-        service.startup();
         assertEquals( revision + 1, service.getChangeLog().getCurrentRevision() );
         assertEquals( t0, service.getChangeLog().getLatest() );
 

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
Sat Dec  8 22:27:41 2007
@@ -22,9 +22,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
 import org.apache.directory.server.core.integ.SetupMode;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.server.core.integ.annotations.Mode;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
@@ -48,7 +46,6 @@
  * @version $Rev$
  */
 @RunWith ( CiRunner.class )
-@CleanupLevel ( ServiceCleanupLevel.TESTSUITE )
 @Mode ( SetupMode.ROLLBACK )
 public class CollectiveAttributeServiceIT
 {

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/event/EventServiceIT.java
Sat Dec  8 22:27:41 2007
@@ -23,8 +23,6 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.integ.CiRunner;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import static org.junit.Assert.assertEquals;

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java
Sat Dec  8 22:27:41 2007
@@ -25,7 +25,7 @@
 import org.apache.directory.server.core.integ.CiRunner;
 import org.apache.directory.server.core.integ.DirectoryServiceFactory;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getContext;
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
+import org.apache.directory.server.core.integ.Level;
 import org.apache.directory.server.core.integ.annotations.Factory;
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.server.core.partition.Partition;
@@ -55,7 +55,7 @@
  * @version $Rev$
  */
 @RunWith ( CiRunner.class )
-@CleanupLevel ( ServiceCleanupLevel.TESTCLASS )
+@CleanupLevel ( Level.CLASS )
 @Factory ( MixedCaseITest.MyFactory.class )
 public class MixedCaseITest
 {

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/SearchWithIndicesITest.java
Sat Dec  8 22:27:41 2007
@@ -26,7 +26,7 @@
 import org.apache.directory.server.core.integ.DirectoryServiceFactory;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
+import org.apache.directory.server.core.integ.Level;
 import org.apache.directory.server.core.integ.annotations.Factory;
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.apache.directory.server.core.partition.impl.btree.Index;
@@ -55,7 +55,7 @@
  * @version $Rev$
  */
 @RunWith ( CiRunner.class )
-@CleanupLevel ( ServiceCleanupLevel.TESTCLASS )
+@CleanupLevel ( Level.CLASS )
 @Factory ( SearchWithIndicesITest.MyFactory.class )
 public class SearchWithIndicesITest
 {

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java?rev=602644&r1=602643&r2=602644&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaISuite.java
Sat Dec  8 22:27:41 2007
@@ -19,7 +19,7 @@
 package org.apache.directory.server.core.schema;
 
 import org.apache.directory.server.core.integ.CiSuite;
-import org.apache.directory.server.core.integ.ServiceCleanupLevel;
+import org.apache.directory.server.core.integ.Level;
 import org.apache.directory.server.core.integ.annotations.CleanupLevel;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite;
@@ -46,7 +46,7 @@
         SubschemaSubentryIT.class,
         SchemaServiceIT.class
         } )
-@CleanupLevel ( ServiceCleanupLevel.TESTSUITE )
+@CleanupLevel ( Level.SUITE )
 public class SchemaISuite
 {
 }



Mime
View raw message