sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-org-apache-sling-junit-healthcheck] 09/45: SLING-2015 - additional JUnit tests runner servlet that runs as a Sling servlet
Date Tue, 07 Nov 2017 09:51:25 GMT
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.junit.healthcheck-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-junit-healthcheck.git

commit a031fc29d387ea66816624deef612d5190f6e0a5
Author: Bertrand Delacretaz <bdelacretaz@apache.org>
AuthorDate: Thu Mar 3 15:11:07 2011 +0000

    SLING-2015 - additional JUnit tests runner servlet that runs as a Sling servlet
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1076648
13f79535-47bb-0310-9956-ffa450edef68
---
 .../junit/remote/httpclient/RemoteTestHttpClient.java    | 16 +++++++++++-----
 .../sling/junit/remote/ide/SerializedRenderer.java       | 11 ++++++++---
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/sling/junit/remote/httpclient/RemoteTestHttpClient.java
b/src/main/java/org/apache/sling/junit/remote/httpclient/RemoteTestHttpClient.java
index 007109a..6cecb44 100644
--- a/src/main/java/org/apache/sling/junit/remote/httpclient/RemoteTestHttpClient.java
+++ b/src/main/java/org/apache/sling/junit/remote/httpclient/RemoteTestHttpClient.java
@@ -59,21 +59,27 @@ public class RemoteTestHttpClient {
             }
         };
         
-        // POST request executes the tests
+        // Build path for POST request to execute the tests
+        
+        // Test classes selector
         subpath = new StringBuilder();
         if(!junitServletUrl.endsWith(SLASH)) {
             subpath.append(SLASH);
         }
         subpath.append(testClassesSelector);
-        if(!extension.startsWith(DOT)) {
-            subpath.append(DOT);
-        }
-        subpath.append(extension);
+        
+        // Test method selector
         if(testMethodSelector != null && testMethodSelector.length() > 0) {
             subpath.append("/");
             subpath.append(testMethodSelector);
         }
         
+        // Extension
+        if(!extension.startsWith(DOT)) {
+            subpath.append(DOT);
+        }
+        subpath.append(extension);
+        
         log.info("Executing test remotely, path={} JUnit servlet URL={}", 
                 subpath, junitServletUrl);
         final Request r = builder.buildPostRequest(subpath.toString());
diff --git a/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java b/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java
index ddb0dc3..26185cd 100644
--- a/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java
+++ b/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.junit.Renderer;
-import org.apache.sling.junit.RequestParser;
+import org.apache.sling.junit.TestSelector;
 import org.junit.runner.Result;
 import org.junit.runner.notification.RunListener;
 import org.slf4j.Logger;
@@ -46,8 +46,13 @@ public class SerializedRenderer extends RunListener implements Renderer
{
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     /** @inheritDoc */
-    public boolean appliesTo(RequestParser p) {
-        return EXTENSION.equals(p.getExtension());
+    public boolean appliesTo(TestSelector s) {
+        return EXTENSION.equals(s.getExtension());
+    }
+    
+    /** @inheritDoc */
+    public String getExtension() {
+        return EXTENSION;
     }
 
     /** @inheritDoc */

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Mime
View raw message