incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1080246 - in /sling/trunk/testing/junit: core/src/main/java/org/apache/sling/junit/annotations/SlingAnnotationsTestRunner.java remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
Date Thu, 10 Mar 2011 15:22:10 GMT
Author: bdelacretaz
Date: Thu Mar 10 15:22:10 2011
New Revision: 1080246

URL: http://svn.apache.org/viewvc?rev=1080246&view=rev
Log:
SLING-1981 - do not fail if TestObjectProcessor is missing, happens when running tests with
SlingRemoteExecutionRule

Modified:
    sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/annotations/SlingAnnotationsTestRunner.java
    sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java

Modified: sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/annotations/SlingAnnotationsTestRunner.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/annotations/SlingAnnotationsTestRunner.java?rev=1080246&r1=1080245&r2=1080246&view=diff
==============================================================================
--- sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/annotations/SlingAnnotationsTestRunner.java
(original)
+++ sling/trunk/testing/junit/core/src/main/java/org/apache/sling/junit/annotations/SlingAnnotationsTestRunner.java
Thu Mar 10 15:22:10 2011
@@ -51,8 +51,10 @@ public class SlingAnnotationsTestRunner 
         }
 
         if(testObjectProcessor == null) {
-            throw new IllegalStateException("No TestObjectProcessor service available");
+            log.info("No TestObjectProcessor service available, annotations will not be processed");
+            return super.createTest();
+        } else { 
+            return testObjectProcessor.process(super.createTest());
         }
-        return testObjectProcessor.process(super.createTest());
     }
 }

Modified: sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java?rev=1080246&r1=1080245&r2=1080246&view=diff
==============================================================================
--- sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
(original)
+++ sling/trunk/testing/junit/remote/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
Thu Mar 10 15:22:10 2011
@@ -27,6 +27,11 @@ import org.junit.runners.model.Statement
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/** JUnit MethodRule that executes tests remotely if the 
+ *  {@link #SLING_REMOTE_TEST_URL} property is set.
+ *  Used to execute tests from an IDE and have then run
+ *  on a remote Sling instance. 
+ */
 public class SlingRemoteExecutionRule implements MethodRule {
    private static final Logger log = 
        LoggerFactory.getLogger(SlingRemoteExecutionRule.class);



Mime
View raw message