directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r893091 - in /directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ: FrameworkRunner.java TestClassB.java
Date Tue, 22 Dec 2009 07:08:06 GMT
Author: kayyagari
Date: Tue Dec 22 07:08:05 2009
New Revision: 893091

URL: http://svn.apache.org/viewvc?rev=893091&view=rev
Log:
o fixed an issue with running a class standalone and not having a @Factory annotation
o added a comment stating the assertions behaviour

Modified:
    directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/FrameworkRunner.java
    directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java

Modified: directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=893091&r1=893090&r2=893091&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/FrameworkRunner.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/FrameworkRunner.java
Tue Dec 22 07:08:05 2009
@@ -85,19 +85,27 @@
                 val = fac.value().newInstance();
                 val = ( ( DirectoryServiceFactory ) val ).newInstance();
             }
-            else
-            // set the parent suit's factory value
+            else // set the parent suit's factory value
             {
-                TestLevelFactory suitFactory = getSuite().getDescription().getAnnotation(
TestLevelFactory.class );
-
-                if ( suitFactory == null )
+                // for a class without a @Factory and running standalone without a suite
+                if( getSuite() == null )
                 {
-                    // instantiate a default factory
                     val = DirectoryServiceFactory.DEFAULT;
                 }
                 else
                 {
-                    val = suitFactory.value().newInstance();
+                    TestLevelFactory suitFactory = getSuite().getDescription().getAnnotation(
TestLevelFactory.class );
+                    
+                    if ( suitFactory == null )
+                    {
+                        // instantiate a default factory
+                        val = DirectoryServiceFactory.DEFAULT;
+                    }
+                    else
+                    {
+                        val = suitFactory.value().newInstance();
+                    }
+                    
                 }
 
                 val = ( ( DirectoryServiceFactory ) val ).newInstance();

Modified: directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
URL: http://svn.apache.org/viewvc/directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java?rev=893091&r1=893090&r2=893091&view=diff
==============================================================================
--- directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
(original)
+++ directory/sandbox/kayyagari/integ-test-framework/src/test/java/org/apache/directory/server/core/integ/TestClassB.java
Tue Dec 22 07:08:05 2009
@@ -26,6 +26,7 @@
     @Test
     public void testWithoutFactoryAnnotation() throws Exception
     {
+        // this assertion will only work if ran as part of TestSuite
         assertTrue( service.getAdminSession().exists( new LdapDN( "cn=testSuite,ou=system"
) ) );
     }
 }



Mime
View raw message