You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:51:16 UTC
[sling-org-apache-sling-junit-healthcheck] annotated tag
org.apache.sling.junit.healthcheck-1.0.4 created (now 867c546)
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a change 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.
at 867c546 (tag)
tagging d870de29b16d1929ce99589081e38354cfdaedd6 (commit)
by Bertrand Delacretaz
on Thu Sep 26 15:12:53 2013 +0000
- Log -----------------------------------------------------------------
org.apache.sling.junit.healthcheck-1.0.4
-----------------------------------------------------------------------
This annotated tag includes the following new commits:
new 226355a SLING-1963 - remote tests runner, work in progress
new daa3713 SLING-1981 - better name
new de2ea40 SLING-1963 - JUnitServlet requires POST to execute tests, GET only lists them
new 4abc3c6 SLING-1963 - use failingtests bundle to verify that server-side test failures are correctly reported
new fea96a6 SLING-1981 - fork the stanbol helper classes here to avoid depending on SNAPSHOTS - the http stuff might move to httpclient anyway
new 1614589 SLING-1981 - support running single tests methods using JUnit servlet paths like /system/sling/junit/TEST_CLASS_NAME.json/TEST_METHOD_NAME
new eddf918 SLING-1984 - support for running individual tests remotely from an IDE. Based on a contribution by Pooja Kothari, thanks!
new 5cdc928 SLING-1963 - do not check number of tests if < 0
new a031fc2 SLING-2015 - additional JUnit tests runner servlet that runs as a Sling servlet
new 53b7072 Export remote.ide package as well
new c8e2a55 SLING-1981 - do not fail if TestObjectProcessor is missing, happens when running tests with SlingRemoteExecutionRule
new 9c9239b SLING-2027 - SlingRemoteTestParameters: make tests count check optional
new dd11d79 SLING-2029 - RequestCustomizer allows for setting credentials (or other options) in RemoteTestHttpClient
new b76ea9a [maven-release-plugin] prepare release org.apache.sling.testing.tools-1.0.2
new 9f53a37 [maven-release-plugin] prepare for next development iteration
new 6f3c873 [maven-release-plugin] prepare release org.apache.sling.testing.tools-1.0.4
new 29f2df8 [maven-release-plugin] prepare for next development iteration
new 3a3c1b9 Use released versions to release this module
new f80e0f6 [maven-release-plugin] prepare release org.apache.sling.junit.remote-1.0.6
new 53dbe12 [maven-release-plugin] prepare for next development iteration
new 197f696 Back to snapshots until releases are out
new cc47860 SLING-2091 - add missing credentials to testing tools in several places. Patch contributed by Mark Adamcin, thanks!
new 4f3f655 SLING-2150 : Update plugins to use the latest available versions
new e3cea08 SLING-2153 - fixing parent path reference
new 6645e7e Update to recent snapshot
new 585c383 Using latest released parent pom
new fe915d3 SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
new 0776634 temporarily using snapshots during release vote
new 6a75d83 using latest releases
new 3500a49 SLING-2480 : Add config for maven-sling-plugin to m2e configuration
new 0d6bc5f Update to latest parent pom
new 51376e0 Use released versions
new 8369924 Use latest releases and update to new parent pom
new d0be351 SLING-2419 - support non-default credential in test utilities - patch contributed by Mark Adamcin, thanks!
new c7bde68 Prepare for release: use released version
new 81bb703 [maven-release-plugin] prepare release org.apache.sling.junit.remote-1.0.8
new deb797d [maven-release-plugin] prepare for next development iteration
new ef7a70c Use snapshot version after release
new 5272ac5 Update to latest parent pom and use latest releases in launchpad
new 8a84b7e Use released versions of testing modules and jcr classloader.
new 930a41b Correct reactor pom and update to parent pom 16
new 91d4892 Update to latest parent pom
new fe414e7 Update to parent pom 18
new a2ffd49 SLING-3084 - add forceReload option to JUnitServlet
new d870de2 [maven-release-plugin] copy for tag org.apache.sling.junit.healthcheck-1.0.4
The 45 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
--
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].
[sling-org-apache-sling-junit-healthcheck] 04/45: SLING-1963 - use
failingtests bundle to verify that server-side test failures are correctly
reported
Posted by ro...@apache.org.
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 4abc3c6e423c5602a40d2038a1c47f1912bc27c2
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Feb 23 14:17:58 2011 +0000
SLING-1963 - use failingtests bundle to verify that server-side test failures are correctly reported
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1073752 13f79535-47bb-0310-9956-ffa450edef68
---
.../org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index aaa9123..f10a2a3 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -84,7 +84,7 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
builder = new RequestBuilder(testParameters.getServerBaseUrl());
// POST request executes the tests
- final Request r = builder.buildPostRequest(testParameters.getJunitServletPath() + "/.json");
+ final Request r = builder.buildPostRequest(testParameters.getJunitServletPath() + ".json");
executor.execute(r)
.assertStatus(200)
.assertContentType("application/json");
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 14/45:
[maven-release-plugin] prepare release org.apache.sling.testing.tools-1.0.2
Posted by ro...@apache.org.
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 b76ea9a24be5737670750d320e5bb58b25afd414
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 11:51:57 2011 +0000
[maven-release-plugin] prepare release org.apache.sling.testing.tools-1.0.2
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092146 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index a1f6487..4097515 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,16 +27,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>0.1.1-SNAPSHOT</version>
+ <version>1.0.2</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.2</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.2</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.tools-1.0.2</url>
</scm>
<build>
@@ -76,7 +76,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>0.1.1-SNAPSHOT</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>0.1.1-SNAPSHOT</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 02/45: SLING-1981 -
better name
Posted by ro...@apache.org.
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 daa3713152b6901e224d47d788eac2f8aeada13b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Feb 22 17:01:21 2011 +0000
SLING-1981 - better name
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1073409 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 78a3a3a..d2a6b56 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,8 +30,8 @@
<version>0.1.1-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Apache Sling JUnit Remote Extension</name>
- <description>Runs JUnit tests remotely</description>
+ <name>Apache Sling JUnit Remote Tests Runners</name>
+ <description>Utilities to run server-side JUnit tests remotely</description>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 09/45: SLING-2015 -
additional JUnit tests runner servlet that runs as a Sling servlet
Posted by ro...@apache.org.
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 <bd...@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" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 44/45: SLING-3084 - add
forceReload option to JUnitServlet
Posted by ro...@apache.org.
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 a2ffd495c3eafee173d6c0b549afc804828a191c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Sep 19 12:42:13 2013 +0000
SLING-3084 - add forceReload option to JUnitServlet
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1524717 13f79535-47bb-0310-9956-ffa450edef68
---
.../remote/httpclient/RemoteTestHttpClient.java | 24 ++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 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 2091236..713feeb 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
@@ -17,10 +17,16 @@
package org.apache.sling.junit.remote.httpclient;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.message.BasicNameValuePair;
import org.apache.sling.testing.tools.http.Request;
import org.apache.sling.testing.tools.http.RequestBuilder;
import org.apache.sling.testing.tools.http.RequestCustomizer;
@@ -70,7 +76,12 @@ public class RemoteTestHttpClient {
requestCustomizer = c;
}
- public RequestExecutor runTests(String testClassesSelector, String testMethodSelector, String extension)
+ public RequestExecutor runTests(String testClassesSelector, String testMethodSelector, String extension)
+ throws ClientProtocolException, IOException {
+ return runTests(testClassesSelector, testMethodSelector, extension, null);
+ }
+
+ public RequestExecutor runTests(String testClassesSelector, String testMethodSelector, String extension, Map<String, String> requestOptions)
throws ClientProtocolException, IOException {
final RequestBuilder builder = new RequestBuilder(junitServletUrl);
@@ -104,13 +115,22 @@ public class RemoteTestHttpClient {
subpath.append(DOT);
}
subpath.append(extension);
+
+ // Request options if any
+ final List<NameValuePair> opt = new ArrayList<NameValuePair>();
+ if(requestOptions != null) {
+ for(Map.Entry<String, String> e : requestOptions.entrySet()) {
+ opt.add(new BasicNameValuePair(e.getKey(), e.getValue()));
+ }
+ }
log.info("Executing test remotely, path={} JUnit servlet URL={}",
subpath, junitServletUrl);
final Request r = builder
.buildPostRequest(subpath.toString())
.withCredentials(username, password)
- .withCustomizer(requestCustomizer);
+ .withCustomizer(requestCustomizer)
+ .withEntity(new UrlEncodedFormEntity(opt));
executor.execute(r).assertStatus(200);
return executor;
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 03/45: SLING-1963 -
JUnitServlet requires POST to execute tests, GET only lists them
Posted by ro...@apache.org.
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 de2ea40d5de735a93d5a0e40c9ab6838bcdf0873
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Feb 23 13:06:27 2011 +0000
SLING-1963 - JUnitServlet requires POST to execute tests, GET only lists them
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1073729 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/junit/remote/testrunner/SlingRemoteTestRunner.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index 6d5010b..aaa9123 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -83,11 +83,8 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
}
builder = new RequestBuilder(testParameters.getServerBaseUrl());
- // TODO for now we run tests at the same time as we count them,
- // as the junit servlet uses only GET - need to change that to GET and POST
- final Request r = builder.buildGetRequest(testParameters.getJunitServletPath() + "/.json");
-
- // Get list of tests in JSON format
+ // POST request executes the tests
+ final Request r = builder.buildPostRequest(testParameters.getJunitServletPath() + "/.json");
executor.execute(r)
.assertStatus(200)
.assertContentType("application/json");
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 01/45: SLING-1963 -
remote tests runner, work in progress
Posted by ro...@apache.org.
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 226355ade941f9cd5d52be89939cc2359dab815b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Feb 22 16:56:19 2011 +0000
SLING-1963 - remote tests runner, work in progress
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1073404 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 70 ++++++++++
.../junit/remote/testrunner/SlingRemoteTest.java | 47 +++++++
.../testrunner/SlingRemoteTestParameters.java | 26 ++++
.../remote/testrunner/SlingRemoteTestRunner.java | 152 +++++++++++++++++++++
4 files changed, 295 insertions(+)
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..78a3a3a
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>10</version>
+ </parent>
+
+ <artifactId>org.apache.sling.junit.remote</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <name>Apache Sling JUnit Remote Extension</name>
+ <description>Runs JUnit tests remotely</description>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.junit.core</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.commons.testing.http</artifactId>
+ <version>0.9-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.json</artifactId>
+ <version>2.0.6</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTest.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTest.java
new file mode 100644
index 0000000..5171474
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.remote.testrunner;
+
+import org.apache.sling.commons.json.JSONException;
+import org.apache.sling.commons.json.JSONObject;
+import org.junit.runner.Description;
+
+/** Info about a remote tests, as provided by the Sling JUnit servlet */
+class SlingRemoteTest {
+ private final Class<?> testClass;
+ private final String description;
+ private final String failure;
+
+ public static final String DESCRIPTION = "description";
+ public static final String FAILURE = "failure";
+
+ SlingRemoteTest(Class<?> testClass, JSONObject json) throws JSONException {
+ this.testClass = testClass;
+ description = json.getString(DESCRIPTION);
+ failure = json.has(FAILURE) ? json.getString(FAILURE) : null;
+ }
+
+ Description describe() {
+ return Description.createTestDescription(testClass, description);
+ }
+
+ void run() {
+ if(failure != null && failure.trim().length() > 0) {
+ throw new AssertionError(failure);
+ }
+ }
+}
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
new file mode 100644
index 0000000..84e32af
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.remote.testrunner;
+
+/** Test class "proxies" implement this to indicate where to
+ * run the tests.
+ */
+public interface SlingRemoteTestParameters {
+ int getExpectedNumberOfTests();
+ String getServerBaseUrl();
+ String getJunitServletPath();
+}
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
new file mode 100644
index 0000000..6d5010b
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.remote.testrunner;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.sling.commons.json.JSONArray;
+import org.apache.sling.commons.json.JSONObject;
+import org.apache.sling.commons.json.JSONTokener;
+import org.apache.stanbol.commons.testing.http.Request;
+import org.apache.stanbol.commons.testing.http.RequestBuilder;
+import org.apache.stanbol.commons.testing.http.RequestExecutor;
+import org.junit.internal.AssumptionViolatedException;
+import org.junit.internal.runners.model.EachTestNotifier;
+import org.junit.runner.Description;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.ParentRunner;
+import org.junit.runners.model.InitializationError;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** JUnit TestRunner that talks to a remote
+ * Sling JUnit test servlet. Using this test
+ * runner lets a test class discover tests
+ * that the JUnit servlet can execute, execute
+ * them and report results exactly as if the tests
+ * ran locally.
+ */
+public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
+ private static final Logger log = LoggerFactory.getLogger(SlingRemoteTestRunner.class);
+ private final SlingRemoteTestParameters testParameters;
+ private RequestExecutor executor;
+ private RequestBuilder builder;
+ private final Class<?> testClass;
+
+ private final List<SlingRemoteTest> children = new LinkedList<SlingRemoteTest>();
+
+ public SlingRemoteTestRunner(Class<?> testClass) throws InitializationError {
+ super(testClass);
+ this.testClass = testClass;
+
+ Object o = null;
+ try {
+ o = testClass.newInstance();
+ if( !(o instanceof SlingRemoteTestParameters)) {
+ throw new IllegalArgumentException(o.getClass().getName()
+ + " is not a " + SlingRemoteTestParameters.class.getSimpleName());
+ }
+ } catch(Exception e) {
+ throw new InitializationError(e);
+ }
+
+ testParameters = (SlingRemoteTestParameters)o;
+ }
+
+ private void maybeExecuteTests() throws Exception {
+ if(executor != null) {
+ return;
+ }
+
+ // Setup request execution
+ executor = new RequestExecutor(new DefaultHttpClient());
+ if(testParameters.getServerBaseUrl() == null) {
+ throw new IllegalStateException("Server base URL is null, cannot run tests");
+ }
+ builder = new RequestBuilder(testParameters.getServerBaseUrl());
+
+ // TODO for now we run tests at the same time as we count them,
+ // as the junit servlet uses only GET - need to change that to GET and POST
+ final Request r = builder.buildGetRequest(testParameters.getJunitServletPath() + "/.json");
+
+ // Get list of tests in JSON format
+ executor.execute(r)
+ .assertStatus(200)
+ .assertContentType("application/json");
+
+ final JSONArray json = new JSONArray(new JSONTokener((executor.getContent())));
+
+ // Response contains an array of objects identified by
+ // their INFO_TYPE, extract the tests
+ // based on this vlaue
+ for(int i = 0 ; i < json.length(); i++) {
+ final JSONObject obj = json.getJSONObject(i);
+ if("test".equals(obj.getString("INFO_TYPE"))) {
+ children.add(new SlingRemoteTest(testClass, obj));
+ }
+ }
+
+ log.info("{} server-side tests executed at {}",
+ children.size(), testParameters.getJunitServletPath());
+
+ // Check that number of tests is as expected
+ assertEquals("Expecting " + testParameters.getExpectedNumberOfTests() + " tests",
+ testParameters.getExpectedNumberOfTests(),
+ children.size());
+ }
+
+ @Override
+ protected Description describeChild(SlingRemoteTest t) {
+ return t.describe();
+ }
+
+ @Override
+ protected List<SlingRemoteTest> getChildren() {
+ try {
+ maybeExecuteTests();
+ } catch(Exception e) {
+ throw new Error(e);
+ }
+ return children;
+ }
+
+ @Override
+ protected void runChild(SlingRemoteTest t, RunNotifier notifier) {
+ try {
+ maybeExecuteTests();
+ } catch(Exception e) {
+ throw new Error(e);
+ }
+
+ EachTestNotifier eachNotifier= new EachTestNotifier(notifier, t.describe());
+ eachNotifier.fireTestStarted();
+ try {
+ log.debug("Running test {}", t.describe());
+ t.run();
+ } catch (AssumptionViolatedException e) {
+ eachNotifier.addFailedAssumption(e);
+ } catch (Throwable e) {
+ eachNotifier.addFailure(e);
+ } finally {
+ eachNotifier.fireTestFinished();
+ }
+ }
+}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 22/45: SLING-2091 - add
missing credentials to testing tools in several places. Patch contributed
by Mark Adamcin, thanks!
Posted by ro...@apache.org.
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 cc478605066164a4c0a747691b8319137b6db812
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Jun 21 09:29:23 2011 +0000
SLING-2091 - add missing credentials to testing tools in several places. Patch contributed by Mark Adamcin, thanks!
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1137918 13f79535-47bb-0310-9956-ffa450edef68
---
.../org/apache/sling/junit/remote/httpclient/RemoteTestHttpClient.java | 2 ++
1 file changed, 2 insertions(+)
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 793a19e..d23c851 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
@@ -25,6 +25,7 @@ import org.apache.sling.testing.tools.http.Request;
import org.apache.sling.testing.tools.http.RequestBuilder;
import org.apache.sling.testing.tools.http.RequestCustomizer;
import org.apache.sling.testing.tools.http.RequestExecutor;
+import org.apache.sling.testing.tools.sling.SlingTestBase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -90,6 +91,7 @@ public class RemoteTestHttpClient {
subpath, junitServletUrl);
final Request r = builder
.buildPostRequest(subpath.toString())
+ .withCredentials(SlingTestBase.ADMIN, SlingTestBase.ADMIN)
.withCustomizer(requestCustomizer);
executor.execute(r).assertStatus(200);
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 26/45: Using latest
released parent pom
Posted by ro...@apache.org.
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 585c38386448d4ab71dd86ebff77fd478446560f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 8 11:31:38 2011 +0000
Using latest released parent pom
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1154924 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index df3fff0..08ff720 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>12-SNAPSHOT</version>
+ <version>11</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 36/45:
[maven-release-plugin] prepare release org.apache.sling.junit.remote-1.0.8
Posted by ro...@apache.org.
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 81bb7039433f4ad0ca61c3cdcc0d078f2aac27a9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Feb 15 11:41:04 2013 +0000
[maven-release-plugin] prepare release org.apache.sling.junit.remote-1.0.8
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1446533 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index a68ba96..46c2021 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>1.0.7-SNAPSHOT</version>
+ <version>1.0.8</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.8</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.8</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.junit.remote-1.0.8</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 45/45:
[maven-release-plugin] copy for tag
org.apache.sling.junit.healthcheck-1.0.4
Posted by ro...@apache.org.
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 d870de29b16d1929ce99589081e38354cfdaedd6
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Sep 26 15:12:53 2013 +0000
[maven-release-plugin] copy for tag org.apache.sling.junit.healthcheck-1.0.4
git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.healthcheck-1.0.4@1526557 13f79535-47bb-0310-9956-ffa450edef68
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 11/45: SLING-1981 - do
not fail if TestObjectProcessor is missing,
happens when running tests with SlingRemoteExecutionRule
Posted by ro...@apache.org.
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 c8e2a556e934874d7270c969d2b6519da56208e2
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Mar 10 15:22:10 2011 +0000
SLING-1981 - do not fail if TestObjectProcessor is missing, happens when running tests with SlingRemoteExecutionRule
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1080246 13f79535-47bb-0310-9956-ffa450edef68
---
.../org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
index 9590ab8..529d785 100644
--- a/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
+++ b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
@@ -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);
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 38/45: Use snapshot
version after release
Posted by ro...@apache.org.
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 ef7a70c68ab09bdcbbe851aa4a66b683880ee7ed
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Feb 15 11:46:27 2013 +0000
Use snapshot version after release
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1446540 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 43b82e7..295b9e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,7 +77,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.8</version>
+ <version>1.0.9-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.6</version>
+ <version>1.0.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 08/45: SLING-1963 - do
not check number of tests if < 0
Posted by ro...@apache.org.
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 5cdc9281159943f24ee4ff6ccb7ad2d0c305bcad
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Feb 28 15:04:49 2011 +0000
SLING-1963 - do not check number of tests if < 0
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1075364 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/junit/remote/testrunner/SlingRemoteTestRunner.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index d8e9118..8399d95 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -97,9 +97,11 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
testParameters.getJunitServletUrl(), testHttpClient.getTestExecutionPath());
// Check that number of tests is as expected
- assertEquals("Expecting " + testParameters.getExpectedNumberOfTests() + " tests",
- testParameters.getExpectedNumberOfTests(),
- children.size());
+ if(testParameters.getExpectedNumberOfTests() >= 0) {
+ assertEquals("Expecting " + testParameters.getExpectedNumberOfTests() + " tests",
+ testParameters.getExpectedNumberOfTests(),
+ children.size());
+ }
}
@Override
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 16/45:
[maven-release-plugin] prepare release org.apache.sling.testing.tools-1.0.4
Posted by ro...@apache.org.
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 6f3c873b59263a522e252ed3e647b9d17931f52d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 11:57:28 2011 +0000
[maven-release-plugin] prepare release org.apache.sling.testing.tools-1.0.4
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092151 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index b799e0f..3ae789e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,16 +27,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.4</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.4</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.tools-1.0.4</url>
</scm>
<build>
@@ -76,7 +76,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 15/45:
[maven-release-plugin] prepare for next development iteration
Posted by ro...@apache.org.
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 9f53a3714663e30b4126df43652f6d46dc7adc91
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 11:52:13 2011 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092148 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4097515..b799e0f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,16 +27,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.2</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.2</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.tools-1.0.2</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
</scm>
<build>
@@ -76,7 +76,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.2</version>
+ <version>1.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 43/45: Update to parent
pom 18
Posted by ro...@apache.org.
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 fe414e7f642a3da8c7da66acb7f1e9bb39643921
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 6 12:15:57 2013 +0000
Update to parent pom 18
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1520554 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e8980e2..153935b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>17</version>
+ <version>18</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 25/45: Update to recent
snapshot
Posted by ro...@apache.org.
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 6645e7e44ba6c4109363fcdcd8b0a3febc8ab952
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Aug 3 09:01:37 2011 +0000
Update to recent snapshot
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1153397 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 4aa3de1..df3fff0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>11-SNAPSHOT</version>
+ <version>12-SNAPSHOT</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 19/45:
[maven-release-plugin] prepare release org.apache.sling.junit.remote-1.0.6
Posted by ro...@apache.org.
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 f80e0f6b0e3d19607796e1c009d3c39aa3c458dd
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 12:19:30 2011 +0000
[maven-release-plugin] prepare release org.apache.sling.junit.remote-1.0.6
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092162 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index 187c8d4..d879ed6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,16 +27,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>1.0.6</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.6</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.6</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.junit.remote-1.0.6</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 20/45:
[maven-release-plugin] prepare for next development iteration
Posted by ro...@apache.org.
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 53dbe1271b6bae82ea54519bfba57a989fac864b
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 12:19:43 2011 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092164 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index d879ed6..4ca8157 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,16 +27,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>1.0.6</version>
+ <version>1.0.7-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.6</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.6</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.junit.remote-1.0.6</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 41/45: Correct reactor
pom and update to parent pom 16
Posted by ro...@apache.org.
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 930a41b7fb3b053f4c56244161150b8e0b6e5f91
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun May 5 14:38:24 2013 +0000
Correct reactor pom and update to parent pom 16
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1479333 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c9b41fc..ced33c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>15</version>
+ <version>16</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 29/45: using latest
releases
Posted by ro...@apache.org.
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 6a75d8373b33f553442e5bc681ddf362c919d2a7
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Sep 7 14:35:51 2011 +0000
using latest releases
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1166199 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 1c35ea5..2c7cdc2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>13-SNAPSHOT</version>
+ <version>12</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 33/45: Use latest
releases and update to new parent pom
Posted by ro...@apache.org.
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 83699247e47b85d09370f8abec99a6e75f421533
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Dec 23 06:53:35 2012 +0000
Use latest releases and update to new parent pom
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1425425 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 605aaf2..b35cf7a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>13</version>
+ <version>14</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 13/45: SLING-2029 -
RequestCustomizer allows for setting credentials (or other options) in
RemoteTestHttpClient
Posted by ro...@apache.org.
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 dd11d79889edc8ad32989b2551c9db3ffac8fef3
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Mar 22 15:27:12 2011 +0000
SLING-2029 - RequestCustomizer allows for setting credentials (or other options) in RemoteTestHttpClient
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1084217 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/junit/remote/exported/ExampleRemoteTest.java | 16 ++++++++++++++--
.../junit/remote/httpclient/RemoteTestHttpClient.java | 10 +++++++++-
.../sling/junit/remote/ide/SlingRemoteExecutionRule.java | 11 ++++++++++-
.../junit/remote/testrunner/SlingRemoteTestRunner.java | 8 ++++++++
4 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java b/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java
index 063a4f4..ba7b6be 100644
--- a/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java
+++ b/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java
@@ -18,8 +18,11 @@ package org.apache.sling.junit.remote.exported;
import static org.junit.Assert.fail;
import org.apache.sling.junit.remote.ide.SlingRemoteExecutionRule;
+import org.apache.sling.testing.tools.http.Request;
import org.junit.Rule;
import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/** Test that can be run remotely on a Sling instance from an IDE, by
* setting the {@link SlingRemoteExecutionRule.SLING_REMOTE_TEST_URL}
@@ -27,9 +30,18 @@ import org.junit.Test;
* the Sling JUnit servlet (like http://localhost:8080/system/sling/junit)
*/
public class ExampleRemoteTest {
-
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ /** Execute this test remotely and customize the request (could be
+ * used to set credentials for example)
+ */
@Rule
- public SlingRemoteExecutionRule execRule = new SlingRemoteExecutionRule();
+ public SlingRemoteExecutionRule execRule = new SlingRemoteExecutionRule() {
+ @Override
+ public void customizeRequest(Request r) {
+ log.info("Customizing request {}", r);
+ }
+ };
@Test
public void testAlwaysPasses() {
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 6cecb44..793a19e 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
@@ -23,6 +23,7 @@ import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.sling.testing.tools.http.Request;
import org.apache.sling.testing.tools.http.RequestBuilder;
+import org.apache.sling.testing.tools.http.RequestCustomizer;
import org.apache.sling.testing.tools.http.RequestExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,6 +35,7 @@ public class RemoteTestHttpClient {
private final String junitServletUrl;
private StringBuilder subpath;
private boolean consumeContent;
+ private RequestCustomizer requestCustomizer;
private static final String SLASH = "/";
private static final String DOT = ".";
@@ -45,6 +47,10 @@ public class RemoteTestHttpClient {
this.consumeContent = consumeContent;
}
+ public void setRequestCustomizer(RequestCustomizer c) {
+ requestCustomizer = c;
+ }
+
public RequestExecutor runTests(String testClassesSelector, String testMethodSelector, String extension)
throws ClientProtocolException, IOException {
final RequestBuilder builder = new RequestBuilder(junitServletUrl);
@@ -82,7 +88,9 @@ public class RemoteTestHttpClient {
log.info("Executing test remotely, path={} JUnit servlet URL={}",
subpath, junitServletUrl);
- final Request r = builder.buildPostRequest(subpath.toString());
+ final Request r = builder
+ .buildPostRequest(subpath.toString())
+ .withCustomizer(requestCustomizer);
executor.execute(r).assertStatus(200);
return executor;
diff --git a/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
index 529d785..e6551de 100644
--- a/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
+++ b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
@@ -20,6 +20,8 @@ import java.io.ObjectInputStream;
import org.apache.http.HttpEntity;
import org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient;
+import org.apache.sling.testing.tools.http.Request;
+import org.apache.sling.testing.tools.http.RequestCustomizer;
import org.apache.sling.testing.tools.http.RequestExecutor;
import org.junit.rules.MethodRule;
import org.junit.runners.model.FrameworkMethod;
@@ -32,7 +34,7 @@ import org.slf4j.LoggerFactory;
* Used to execute tests from an IDE and have then run
* on a remote Sling instance.
*/
-public class SlingRemoteExecutionRule implements MethodRule {
+public class SlingRemoteExecutionRule implements MethodRule, RequestCustomizer {
private static final Logger log =
LoggerFactory.getLogger(SlingRemoteExecutionRule.class);
@@ -76,6 +78,7 @@ public class SlingRemoteExecutionRule implements MethodRule {
final String methodName = method.getMethod().getName();
final RemoteTestHttpClient testHttpClient = new RemoteTestHttpClient(remoteUrl, false);
+ testHttpClient.setRequestCustomizer(this);
final RequestExecutor executor = testHttpClient.runTests(
testClassesSelector, methodName, "serialized"
);
@@ -98,4 +101,10 @@ public class SlingRemoteExecutionRule implements MethodRule {
}
}
}
+
+ /** @inheritDoc */
+ public void customizeRequest(Request r) {
+ // Do nothing by default, tests that use this rule can
+ // customize this method
+ }
}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index 175b774..3f6e28a 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -23,6 +23,7 @@ import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONObject;
import org.apache.sling.commons.json.JSONTokener;
import org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient;
+import org.apache.sling.testing.tools.http.RequestCustomizer;
import org.apache.sling.testing.tools.http.RequestExecutor;
import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.runners.model.EachTestNotifier;
@@ -73,6 +74,13 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
}
testHttpClient = new RemoteTestHttpClient(testParameters.getJunitServletUrl(), true);
+
+ // Let the parameters class customize the request if desired
+ if(testParameters instanceof RequestCustomizer) {
+ testHttpClient.setRequestCustomizer((RequestCustomizer)testParameters);
+ }
+
+ // Run tests remotely and get response
final RequestExecutor executor = testHttpClient.runTests(
testParameters.getTestClassesSelector(),
testParameters.getTestMethodSelector(),
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 27/45: SLING-2187 -
adding new module to contain our custom notice file;
adding remote-resources plugin configuration to parent pom and removing all
existing appended-resources NOTICE files
Posted by ro...@apache.org.
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 fe915d348016d1142cdd25a1559deecfa2d8eee3
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Aug 31 19:23:49 2011 +0000
SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1163752 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 08ff720..df3fff0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>11</version>
+ <version>12-SNAPSHOT</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 24/45: SLING-2153 -
fixing parent path reference
Posted by ro...@apache.org.
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 e3cea0812f9be32330786d7bb65b9f6aa1dc744c
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Jul 21 22:36:54 2011 +0000
SLING-2153 - fixing parent path reference
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1149394 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pom.xml b/pom.xml
index c66e6cb..4aa3de1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,6 +24,7 @@
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
<version>11-SNAPSHOT</version>
+ <relativePath>../../../parent/pom.xml</relativePath>
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 06/45: SLING-1981 -
support running single tests methods using JUnit servlet paths like
/system/sling/junit/TEST_CLASS_NAME.json/TEST_METHOD_NAME
Posted by ro...@apache.org.
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 1614589e36be2bcf5d3f89bf90672d40b914fcc8
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Feb 24 16:54:59 2011 +0000
SLING-1981 - support running single tests methods using JUnit servlet paths like /system/sling/junit/TEST_CLASS_NAME.json/TEST_METHOD_NAME
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1074212 13f79535-47bb-0310-9956-ffa450edef68
---
.../remote/testrunner/SlingRemoteTestParameters.java | 18 ++++++++++++++++--
.../remote/testrunner/SlingRemoteTestRunner.java | 19 ++++++++++++++-----
2 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
index 84e32af..69d83ea 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
@@ -20,7 +20,21 @@ package org.apache.sling.junit.remote.testrunner;
* run the tests.
*/
public interface SlingRemoteTestParameters {
+ /** Return the URL of the JUnit servlet */
+ String getJunitServletUrl();
+
+ /** Return the optional selector for the test classes to run,
+ * for example "org.apache.sling.testing.samples.sampletests.JUnit4Test"
+ */
+ String getTestClassesSelector();
+
+ /** Return the optional selector for the test methods to run,
+ * for example "someMethodName"
+ */
+ String getTestMethodSelector();
+
+ /** Return the expected number of tests - if zero, no check
+ * is done.
+ */
int getExpectedNumberOfTests();
- String getServerBaseUrl();
- String getJunitServletPath();
}
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index ba3428e..428f090 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -78,13 +78,22 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
// Setup request execution
executor = new RequestExecutor(new DefaultHttpClient());
- if(testParameters.getServerBaseUrl() == null) {
+ if(testParameters.getJunitServletUrl() == null) {
throw new IllegalStateException("Server base URL is null, cannot run tests");
}
- builder = new RequestBuilder(testParameters.getServerBaseUrl());
+ builder = new RequestBuilder(testParameters.getJunitServletUrl());
// POST request executes the tests
- final Request r = builder.buildPostRequest(testParameters.getJunitServletPath() + ".json");
+ final StringBuilder subpath = new StringBuilder();
+ subpath.append("/");
+ subpath.append(testParameters.getTestClassesSelector());
+ subpath.append(".json");
+ final String testMethodSelector = testParameters.getTestMethodSelector();
+ if(testMethodSelector != null && testMethodSelector.length() > 0) {
+ subpath.append("/");
+ subpath.append(testMethodSelector);
+ }
+ final Request r = builder.buildPostRequest(subpath.toString());
executor.execute(r)
.assertStatus(200)
.assertContentType("application/json");
@@ -101,8 +110,8 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
}
}
- log.info("{} server-side tests executed at {}",
- children.size(), testParameters.getJunitServletPath());
+ log.info("Server-side tests executed at {} with path {}",
+ testParameters.getJunitServletUrl(), subpath);
// Check that number of tests is as expected
assertEquals("Expecting " + testParameters.getExpectedNumberOfTests() + " tests",
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 31/45: Update to latest
parent pom
Posted by ro...@apache.org.
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 0d6bc5ff61d24ee50e8727eae9e1c0a82e5e3f65
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 5 09:29:47 2012 +0000
Update to latest parent pom
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1357521 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 1c35ea5..be58987 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>13-SNAPSHOT</version>
+ <version>14-SNAPSHOT</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 21/45: Back to snapshots
until releases are out
Posted by ro...@apache.org.
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 197f696a322290bfb3201314ccc8fea14d891a82
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 12:58:33 2011 +0000
Back to snapshots until releases are out
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092207 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4ca8157..5c78e48 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,7 +76,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.6</version>
+ <version>1.0.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.2</version>
+ <version>1.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 37/45:
[maven-release-plugin] prepare for next development iteration
Posted by ro...@apache.org.
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 deb797d0ad094a9d85da3535722c7ef8faa8bb1e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Feb 15 11:41:25 2013 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1446535 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index 46c2021..43b82e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,16 +28,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>1.0.8</version>
+ <version>1.0.9-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.8</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.junit.remote-1.0.8</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.junit.remote-1.0.8</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 10/45: Export remote.ide
package as well
Posted by ro...@apache.org.
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 53b7072fd6b8951656e0aa6000db54a93f262c7f
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Wed Mar 9 16:00:36 2011 +0000
Export remote.ide package as well
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1079862 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 81102e1..a1f6487 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,7 +51,10 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Export-Package>org.apache.sling.junit.remote.exported.*</Export-Package>
+ <Export-Package>
+ org.apache.sling.junit.remote.exported.*,
+ org.apache.sling.junit.remote.ide.*
+ </Export-Package>
<Import-Package>
org.apache.http.*; resolution:=optional,
org.apache.sling.testing.tools.http; resolution:=optional,
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 32/45: Use released
versions
Posted by ro...@apache.org.
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 51376e0bc0412e5436295535a44763df55f2c0fc
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 10 11:07:18 2012 +0000
Use released versions
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1359601 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index be58987..605aaf2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>14-SNAPSHOT</version>
+ <version>13</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 42/45: Update to latest
parent pom
Posted by ro...@apache.org.
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 91d489280c9cd2174c4705e9be98aec0f9f62c70
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 19 07:04:15 2013 +0000
Update to latest parent pom
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1504788 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ced33c1..e8980e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>16</version>
+ <version>17</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 40/45: Use released
versions of testing modules and jcr classloader.
Posted by ro...@apache.org.
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 8a84b7e2daa5334e3dbd386db7f8ef8ce3b6f82c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Feb 19 07:22:24 2013 +0000
Use released versions of testing modules and jcr classloader.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1447604 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 9a75ee7..c9b41fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,7 +77,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.9-SNAPSHOT</version>
+ <version>1.0.8</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.7-SNAPSHOT</version>
+ <version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 23/45: SLING-2150 :
Update plugins to use the latest available versions
Posted by ro...@apache.org.
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 4f3f655478acb520af9118298d1b869c14b70ecf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Jul 20 12:21:40 2011 +0000
SLING-2150 : Update plugins to use the latest available versions
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1148722 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5c78e48..c66e6cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>10</version>
+ <version>11-SNAPSHOT</version>
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
@@ -81,7 +81,6 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
- <version>1.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 18/45: Use released
versions to release this module
Posted by ro...@apache.org.
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 3a3c1b9e49cde68c97fa3ec97a6f2253dd797afe
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 12:19:06 2011 +0000
Use released versions to release this module
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092161 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 19e4be9..187c8d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,7 +76,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 30/45: SLING-2480 : Add
config for maven-sling-plugin to m2e configuration
Posted by ro...@apache.org.
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 3500a498c367b87dc3716cfbdc43c93b19c4955c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed May 16 07:39:13 2012 +0000
SLING-2480 : Add config for maven-sling-plugin to m2e configuration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1339038 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 2c7cdc2..1c35ea5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>12</version>
+ <version>13-SNAPSHOT</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 39/45: Update to latest
parent pom and use latest releases in launchpad
Posted by ro...@apache.org.
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 5272ac5ddac5ee0710dbc40a32d045ba5b7b89ec
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Feb 18 08:38:52 2013 +0000
Update to latest parent pom and use latest releases in launchpad
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1447147 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 295b9e3..9a75ee7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>14</version>
+ <version>15</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 34/45: SLING-2419 -
support non-default credential in test utilities - patch contributed by
Mark Adamcin, thanks!
Posted by ro...@apache.org.
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 d0be351e71d120c8485a95d0e12cedcdc697598d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Feb 15 11:00:40 2013 +0000
SLING-2419 - support non-default credential in test utilities - patch contributed by Mark Adamcin, thanks!
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1446510 13f79535-47bb-0310-9956-ffa450edef68
---
.../remote/httpclient/RemoteTestHttpClient.java | 24 ++++++++++++++++---
.../junit/remote/ide/SlingRemoteExecutionRule.java | 11 ++++++---
.../remote/testrunner/SlingRemoteTestRunner.java | 27 ++++++++++++++++++----
3 files changed, 52 insertions(+), 10 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 d23c851..2091236 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
@@ -34,18 +34,36 @@ public class RemoteTestHttpClient {
private final Logger log = LoggerFactory.getLogger(getClass());
private final String junitServletUrl;
+ private final String username;
+ private final String password;
private StringBuilder subpath;
private boolean consumeContent;
private RequestCustomizer requestCustomizer;
private static final String SLASH = "/";
private static final String DOT = ".";
-
+
public RemoteTestHttpClient(String junitServletUrl, boolean consumeContent) {
+ this(junitServletUrl, null, null, consumeContent);
+ }
+
+ public RemoteTestHttpClient(String junitServletUrl, String username, String password, boolean consumeContent) {
if(junitServletUrl == null) {
throw new IllegalArgumentException("JUnit servlet URL is null, cannot run tests");
}
this.junitServletUrl = junitServletUrl;
this.consumeContent = consumeContent;
+
+ if (username != null) {
+ this.username = username;
+ } else {
+ this.username = SlingTestBase.ADMIN;
+ }
+
+ if (password != null) {
+ this.password = password;
+ } else {
+ this.password = SlingTestBase.ADMIN;
+ }
}
public void setRequestCustomizer(RequestCustomizer c) {
@@ -87,11 +105,11 @@ public class RemoteTestHttpClient {
}
subpath.append(extension);
- log.info("Executing test remotely, path={} JUnit servlet URL={}",
+ log.info("Executing test remotely, path={} JUnit servlet URL={}",
subpath, junitServletUrl);
final Request r = builder
.buildPostRequest(subpath.toString())
- .withCredentials(SlingTestBase.ADMIN, SlingTestBase.ADMIN)
+ .withCredentials(username, password)
.withCustomizer(requestCustomizer);
executor.execute(r).assertStatus(200);
diff --git a/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
index e6551de..590ebd2 100644
--- a/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
+++ b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
@@ -40,6 +40,8 @@ public class SlingRemoteExecutionRule implements MethodRule, RequestCustomizer {
/** Name of the system property that activates remote test execution */
public static final String SLING_REMOTE_TEST_URL = "sling.remote.test.url";
+ public static final String SLING_REMOTE_TEST_USERNAME = "sling.remote.test.username";
+ public static final String SLING_REMOTE_TEST_PASSWORD = "sling.remote.test.password";
public Statement apply(final Statement base, final FrameworkMethod method, Object target) {
return new Statement() {
@@ -63,21 +65,24 @@ public class SlingRemoteExecutionRule implements MethodRule, RequestCustomizer {
*/
private boolean tryRemoteEvaluation(FrameworkMethod method) throws Throwable {
String remoteUrl = System.getProperty(SLING_REMOTE_TEST_URL);
+ String remoteUsername = System.getProperty(SLING_REMOTE_TEST_USERNAME);
+ String remotePassword = System.getProperty(SLING_REMOTE_TEST_PASSWORD);
+
if(remoteUrl != null) {
remoteUrl = remoteUrl.trim();
if(remoteUrl.length() > 0) {
- invokeRemote(remoteUrl, method);
+ invokeRemote(remoteUrl, remoteUsername, remotePassword, method);
return true;
}
}
return false;
}
- private void invokeRemote(String remoteUrl, FrameworkMethod method) throws Throwable {
+ private void invokeRemote(String remoteUrl, String remoteUsername, String remotePassword, FrameworkMethod method) throws Throwable {
final String testClassesSelector = method.getMethod().getDeclaringClass().getName();
final String methodName = method.getMethod().getName();
- final RemoteTestHttpClient testHttpClient = new RemoteTestHttpClient(remoteUrl, false);
+ final RemoteTestHttpClient testHttpClient = new RemoteTestHttpClient(remoteUrl, remoteUsername, remotePassword, false);
testHttpClient.setRequestCustomizer(this);
final RequestExecutor executor = testHttpClient.runTests(
testClassesSelector, methodName, "serialized"
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index 3f6e28a..a352436 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -25,6 +25,7 @@ import org.apache.sling.commons.json.JSONTokener;
import org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient;
import org.apache.sling.testing.tools.http.RequestCustomizer;
import org.apache.sling.testing.tools.http.RequestExecutor;
+import org.apache.sling.testing.tools.sling.SlingTestBase;
import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.runners.model.EachTestNotifier;
import org.junit.runner.Description;
@@ -45,6 +46,8 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
private static final Logger log = LoggerFactory.getLogger(SlingRemoteTestRunner.class);
private final SlingRemoteTestParameters testParameters;
private RemoteTestHttpClient testHttpClient;
+ private final String username;
+ private final String password;
private final Class<?> testClass;
private final List<SlingRemoteTest> children = new LinkedList<SlingRemoteTest>();
@@ -64,6 +67,22 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
throw new InitializationError(e);
}
+ // Set configured username using "admin" as default credential
+ final String configuredUsername = System.getProperty(SlingTestBase.TEST_SERVER_USERNAME);
+ if (configuredUsername != null && configuredUsername.trim().length() > 0) {
+ username = configuredUsername;
+ } else {
+ username = SlingTestBase.ADMIN;
+ }
+
+ // Set configured password using "admin" as default credential
+ final String configuredPassword = System.getProperty(SlingTestBase.TEST_SERVER_PASSWORD);
+ if (configuredPassword != null && configuredPassword.trim().length() > 0) {
+ password = configuredPassword;
+ } else {
+ password = SlingTestBase.ADMIN;
+ }
+
testParameters = (SlingRemoteTestParameters)o;
}
@@ -73,7 +92,7 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
return;
}
- testHttpClient = new RemoteTestHttpClient(testParameters.getJunitServletUrl(), true);
+ testHttpClient = new RemoteTestHttpClient(testParameters.getJunitServletUrl(), this.username, this.password, true);
// Let the parameters class customize the request if desired
if(testParameters instanceof RequestCustomizer) {
@@ -99,8 +118,8 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
}
}
- log.info("Server-side tests executed at {} with path {}",
- testParameters.getJunitServletUrl(), testHttpClient.getTestExecutionPath());
+ log.info("Server-side tests executed as {} at {} with path {}",
+ new Object[]{this.username, testParameters.getJunitServletUrl(), testHttpClient.getTestExecutionPath()});
// Optionally check that number of tests is as expected
if(testParameters instanceof SlingTestsCountChecker) {
@@ -144,4 +163,4 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
eachNotifier.fireTestFinished();
}
}
-}
\ No newline at end of file
+}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 17/45:
[maven-release-plugin] prepare for next development iteration
Posted by ro...@apache.org.
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 29f2df8dd04856535ea034881ca9cb5ebd2a371c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Apr 14 11:57:44 2011 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1092153 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index 3ae789e..19e4be9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,16 +27,16 @@
</parent>
<artifactId>org.apache.sling.junit.remote</artifactId>
- <version>1.0.4</version>
+ <version>1.0.5-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.4</connection>
- <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.testing.tools-1.0.4</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.testing.tools-1.0.4</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</connection>
+ <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
</scm>
<build>
@@ -76,7 +76,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.4</version>
+ <version>1.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.4</version>
+ <version>1.0.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 28/45: temporarily using
snapshots during release vote
Posted by ro...@apache.org.
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 0776634790edd10eaaf9f1710d2231d8f2959900
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Aug 31 20:10:55 2011 +0000
temporarily using snapshots during release vote
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1163785 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index df3fff0..1c35ea5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>12-SNAPSHOT</version>
+ <version>13-SNAPSHOT</version>
<relativePath>../../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 07/45: SLING-1984 -
support for running individual tests remotely from an IDE. Based on a
contribution by Pooja Kothari, thanks!
Posted by ro...@apache.org.
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 eddf9185599a9406e2d8d0401a474e300964297d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Feb 25 16:59:06 2011 +0000
SLING-1984 - support for running individual tests remotely from an IDE. Based on a contribution by Pooja Kothari, thanks!
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1074632 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 48 ++++++++++-
.../junit/remote/exported/ExampleRemoteTest.java | 49 +++++++++++
.../remote/httpclient/RemoteTestHttpClient.java | 91 ++++++++++++++++++++
.../sling/junit/remote/ide/ExecutionResult.java | 53 ++++++++++++
.../sling/junit/remote/ide/SerializedRenderer.java | 97 ++++++++++++++++++++++
.../junit/remote/ide/SlingRemoteExecutionRule.java | 96 +++++++++++++++++++++
.../remote/testrunner/SlingRemoteTestRunner.java | 41 +++------
7 files changed, 445 insertions(+), 30 deletions(-)
diff --git a/pom.xml b/pom.xml
index 2e06348..81102e1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
<artifactId>org.apache.sling.junit.remote</artifactId>
<version>0.1.1-SNAPSHOT</version>
- <packaging>jar</packaging>
+ <packaging>bundle</packaging>
<name>Apache Sling JUnit Remote Tests Runners</name>
<description>Utilities to run server-side JUnit tests remotely</description>
@@ -39,13 +39,49 @@
<url>http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote</url>
</scm>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>org.apache.sling.junit.remote.exported.*</Export-Package>
+ <Import-Package>
+ org.apache.http.*; resolution:=optional,
+ org.apache.sling.testing.tools.http; resolution:=optional,
+ org.junit.internal.*; resolution:=optional,
+ *
+ </Import-Package>
+ <Sling-Test-Regexp>.*Test</Sling-Test-Regexp>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<dependencies>
<dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
<version>0.1.1-SNAPSHOT</version>
</dependency>
<dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ <version>1.4.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
@@ -57,6 +93,12 @@
<version>1.5.11</version>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
<version>0.1.1-SNAPSHOT</version>
@@ -66,5 +108,9 @@
<artifactId>org.apache.sling.commons.json</artifactId>
<version>2.0.6</version>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java b/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java
new file mode 100644
index 0000000..063a4f4
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/exported/ExampleRemoteTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.remote.exported;
+
+import static org.junit.Assert.fail;
+import org.apache.sling.junit.remote.ide.SlingRemoteExecutionRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+/** Test that can be run remotely on a Sling instance from an IDE, by
+ * setting the {@link SlingRemoteExecutionRule.SLING_REMOTE_TEST_URL}
+ * system property in the IDE setup, to the URL of
+ * the Sling JUnit servlet (like http://localhost:8080/system/sling/junit)
+ */
+public class ExampleRemoteTest {
+
+ @Rule
+ public SlingRemoteExecutionRule execRule = new SlingRemoteExecutionRule();
+
+ @Test
+ public void testAlwaysPasses() {
+ }
+
+ @Test
+ public void testAlwaysFails() {
+ fail("This test always fails");
+ }
+
+ @Test
+ public void testFailsSometimes() {
+ if(Math.random() < 0.5) {
+ fail("This test fails sometimes");
+ }
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..007109a
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/httpclient/RemoteTestHttpClient.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.sling.junit.remote.httpclient;
+
+import java.io.IOException;
+
+import org.apache.http.ParseException;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.sling.testing.tools.http.Request;
+import org.apache.sling.testing.tools.http.RequestBuilder;
+import org.apache.sling.testing.tools.http.RequestExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** HTTP client that executes tests remotely */
+public class RemoteTestHttpClient {
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ private final String junitServletUrl;
+ private StringBuilder subpath;
+ private boolean consumeContent;
+ private static final String SLASH = "/";
+ private static final String DOT = ".";
+
+ public RemoteTestHttpClient(String junitServletUrl, boolean consumeContent) {
+ if(junitServletUrl == null) {
+ throw new IllegalArgumentException("JUnit servlet URL is null, cannot run tests");
+ }
+ this.junitServletUrl = junitServletUrl;
+ this.consumeContent = consumeContent;
+ }
+
+ public RequestExecutor runTests(String testClassesSelector, String testMethodSelector, String extension)
+ throws ClientProtocolException, IOException {
+ final RequestBuilder builder = new RequestBuilder(junitServletUrl);
+
+ // Optionally let the client to consume the response entity
+ final RequestExecutor executor = new RequestExecutor(new DefaultHttpClient()) {
+ @Override
+ protected void consumeEntity() throws ParseException, IOException {
+ if(consumeContent) {
+ super.consumeEntity();
+ }
+ }
+ };
+
+ // POST request executes the tests
+ subpath = new StringBuilder();
+ if(!junitServletUrl.endsWith(SLASH)) {
+ subpath.append(SLASH);
+ }
+ subpath.append(testClassesSelector);
+ if(!extension.startsWith(DOT)) {
+ subpath.append(DOT);
+ }
+ subpath.append(extension);
+ if(testMethodSelector != null && testMethodSelector.length() > 0) {
+ subpath.append("/");
+ subpath.append(testMethodSelector);
+ }
+
+ log.info("Executing test remotely, path={} JUnit servlet URL={}",
+ subpath, junitServletUrl);
+ final Request r = builder.buildPostRequest(subpath.toString());
+ executor.execute(r).assertStatus(200);
+
+ return executor;
+ }
+
+ /** If called after runTests, returns the path used to
+ * run tests on the remote JUnit servlet
+ */
+ public String getTestExecutionPath() {
+ return subpath == null ? null : subpath.toString();
+ }
+}
diff --git a/src/main/java/org/apache/sling/junit/remote/ide/ExecutionResult.java b/src/main/java/org/apache/sling/junit/remote/ide/ExecutionResult.java
new file mode 100644
index 0000000..19cf76d
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/ide/ExecutionResult.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.remote.ide;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.runner.Result;
+import org.junit.runner.notification.Failure;
+
+public class ExecutionResult implements Serializable {
+ private static final long serialVersionUID = 7935484811381524530L;
+ private final Throwable throwable;
+
+ public ExecutionResult(Result result) {
+ if (result.getFailureCount() > 0) {
+ final List<Throwable> failures = new ArrayList<Throwable>(result.getFailureCount());
+ for (Failure f : result.getFailures()) {
+ failures.add(f.getException());
+ }
+
+ // TODO MultipleFailureException is an internal JUnit class -
+ // we don't have it when running server-side in Sling
+ // throwable = new MultipleFailureException(failures);
+ throwable = failures.get(0);
+ } else {
+ throwable = null;
+ }
+ }
+
+ public Throwable getException() {
+ return throwable;
+ }
+
+ public boolean isFailure() {
+ return throwable != null;
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..ddb0dc3
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/ide/SerializedRenderer.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.remote.ide;
+
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.UnsupportedEncodingException;
+import java.util.Collection;
+
+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.junit.runner.Result;
+import org.junit.runner.notification.RunListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Renderer for Sling JUnit server-side testing, which
+ * renders test results in binary form.
+ * Used to send results, and especially Exceptions, as
+ * is to a remote IDE.
+ */
+@Component(immediate=false)
+@Service
+public class SerializedRenderer extends RunListener implements Renderer {
+
+ public static final String EXTENSION = "serialized";
+ private ObjectOutputStream outputStream;
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ /** @inheritDoc */
+ public boolean appliesTo(RequestParser p) {
+ return EXTENSION.equals(p.getExtension());
+ }
+
+ /** @inheritDoc */
+ public void setup(HttpServletResponse response, String pageTitle)
+ throws IOException, UnsupportedEncodingException {
+ response.setContentType("application/x-java-serialized-object");
+ outputStream = new ObjectOutputStream(response.getOutputStream());
+ }
+
+ /** @inheritDoc */
+ public void cleanup() {
+ try {
+ outputStream.flush();
+ outputStream.close();
+ } catch (IOException e) {
+ log.warn("Exception in cleanup()", e);
+ }
+ outputStream = null;
+ }
+
+ /** @inheritDoc */
+ public RunListener getRunListener() {
+ return this;
+ }
+
+ /** @inheritDoc */
+ public void info(String role, String info) {
+ }
+
+ /** @inheritDoc */
+ public void link(String info, String url, String method) {
+ }
+
+ /** @inheritDoc */
+ public void list(String role, Collection<String> data) {
+ }
+
+ /** @inheritDoc */
+ public void title(int level, String title) {
+ }
+
+ @Override
+ public void testRunFinished(Result result) throws IOException {
+ final ExecutionResult er = new ExecutionResult(result);
+ outputStream.writeObject(er);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
new file mode 100644
index 0000000..9590ab8
--- /dev/null
+++ b/src/main/java/org/apache/sling/junit/remote/ide/SlingRemoteExecutionRule.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.junit.remote.ide;
+
+import java.io.ObjectInputStream;
+
+import org.apache.http.HttpEntity;
+import org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient;
+import org.apache.sling.testing.tools.http.RequestExecutor;
+import org.junit.rules.MethodRule;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.Statement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SlingRemoteExecutionRule implements MethodRule {
+ private static final Logger log =
+ LoggerFactory.getLogger(SlingRemoteExecutionRule.class);
+
+ /** Name of the system property that activates remote test execution */
+ public static final String SLING_REMOTE_TEST_URL = "sling.remote.test.url";
+
+ public Statement apply(final Statement base, final FrameworkMethod method, Object target) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ if (tryRemoteEvaluation(method)) {
+ return;
+ }
+ base.evaluate();
+ }
+ };
+ }
+
+ /**
+ * Execute test remotely if the corresponding system property is set
+ *
+ * @return <code>true</code> if the method was executed remotely and passed.
+ * If the test was <b>not</b> executed remotely then
+ * <code>false</code> is returned to indicate that test should be
+ * executed locally
+ */
+ private boolean tryRemoteEvaluation(FrameworkMethod method) throws Throwable {
+ String remoteUrl = System.getProperty(SLING_REMOTE_TEST_URL);
+ if(remoteUrl != null) {
+ remoteUrl = remoteUrl.trim();
+ if(remoteUrl.length() > 0) {
+ invokeRemote(remoteUrl, method);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void invokeRemote(String remoteUrl, FrameworkMethod method) throws Throwable {
+ final String testClassesSelector = method.getMethod().getDeclaringClass().getName();
+ final String methodName = method.getMethod().getName();
+
+ final RemoteTestHttpClient testHttpClient = new RemoteTestHttpClient(remoteUrl, false);
+ final RequestExecutor executor = testHttpClient.runTests(
+ testClassesSelector, methodName, "serialized"
+ );
+ log.debug("Ran test {} method {} at URL {}",
+ new Object[] { testClassesSelector, methodName, remoteUrl });
+
+ final HttpEntity entity = executor.getResponse().getEntity();
+ if (entity != null) {
+ try {
+ final Object o = new ObjectInputStream(entity.getContent()).readObject();
+ if( !(o instanceof ExecutionResult) ) {
+ throw new IllegalStateException("Expected an ExecutionResult, got a " + o.getClass().getName());
+ }
+ final ExecutionResult result = (ExecutionResult)o;
+ if (result.isFailure()) {
+ throw result.getException();
+ }
+ } finally {
+ entity.consumeContent();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index 428f090..d8e9118 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -21,12 +21,10 @@ import static org.junit.Assert.assertEquals;
import java.util.LinkedList;
import java.util.List;
-import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONObject;
import org.apache.sling.commons.json.JSONTokener;
-import org.apache.sling.testing.tools.http.Request;
-import org.apache.sling.testing.tools.http.RequestBuilder;
+import org.apache.sling.junit.remote.httpclient.RemoteTestHttpClient;
import org.apache.sling.testing.tools.http.RequestExecutor;
import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.runners.model.EachTestNotifier;
@@ -47,8 +45,7 @@ import org.slf4j.LoggerFactory;
public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
private static final Logger log = LoggerFactory.getLogger(SlingRemoteTestRunner.class);
private final SlingRemoteTestParameters testParameters;
- private RequestExecutor executor;
- private RequestBuilder builder;
+ private RemoteTestHttpClient testHttpClient;
private final Class<?> testClass;
private final List<SlingRemoteTest> children = new LinkedList<SlingRemoteTest>();
@@ -72,32 +69,18 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
}
private void maybeExecuteTests() throws Exception {
- if(executor != null) {
+ if(testHttpClient != null) {
+ // Tests already ran
return;
}
- // Setup request execution
- executor = new RequestExecutor(new DefaultHttpClient());
- if(testParameters.getJunitServletUrl() == null) {
- throw new IllegalStateException("Server base URL is null, cannot run tests");
- }
- builder = new RequestBuilder(testParameters.getJunitServletUrl());
-
- // POST request executes the tests
- final StringBuilder subpath = new StringBuilder();
- subpath.append("/");
- subpath.append(testParameters.getTestClassesSelector());
- subpath.append(".json");
- final String testMethodSelector = testParameters.getTestMethodSelector();
- if(testMethodSelector != null && testMethodSelector.length() > 0) {
- subpath.append("/");
- subpath.append(testMethodSelector);
- }
- final Request r = builder.buildPostRequest(subpath.toString());
- executor.execute(r)
- .assertStatus(200)
- .assertContentType("application/json");
-
+ testHttpClient = new RemoteTestHttpClient(testParameters.getJunitServletUrl(), true);
+ final RequestExecutor executor = testHttpClient.runTests(
+ testParameters.getTestClassesSelector(),
+ testParameters.getTestMethodSelector(),
+ "json"
+ );
+ executor.assertContentType("application/json");
final JSONArray json = new JSONArray(new JSONTokener((executor.getContent())));
// Response contains an array of objects identified by
@@ -111,7 +94,7 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
}
log.info("Server-side tests executed at {} with path {}",
- testParameters.getJunitServletUrl(), subpath);
+ testParameters.getJunitServletUrl(), testHttpClient.getTestExecutionPath());
// Check that number of tests is as expected
assertEquals("Expecting " + testParameters.getExpectedNumberOfTests() + " tests",
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 35/45: Prepare for
release: use released version
Posted by ro...@apache.org.
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 c7bde6874f558b143926c98085a9020713c4f4aa
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Feb 15 11:36:33 2013 +0000
Prepare for release: use released version
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1446526 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index b35cf7a..a68ba96 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,7 +77,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
- <version>1.0.7-SNAPSHOT</version>
+ <version>1.0.8</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
@@ -104,7 +104,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
- <version>1.0.5-SNAPSHOT</version>
+ <version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 05/45: SLING-1981 - fork
the stanbol helper classes here to avoid depending on SNAPSHOTS - the http
stuff might move to httpclient anyway
Posted by ro...@apache.org.
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 fea96a67048bc9b6fba005e6b574283a82c888c8
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Feb 24 14:14:26 2011 +0000
SLING-1981 - fork the stanbol helper classes here to avoid depending on SNAPSHOTS - the http stuff might move to httpclient anyway
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1074158 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 6 +++---
.../apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/pom.xml b/pom.xml
index d2a6b56..2e06348 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,9 +57,9 @@
<version>1.5.11</version>
</dependency>
<dependency>
- <groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.commons.testing.http</artifactId>
- <version>0.9-SNAPSHOT</version>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.testing.tools</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index f10a2a3..ba3428e 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -25,9 +25,9 @@ import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONObject;
import org.apache.sling.commons.json.JSONTokener;
-import org.apache.stanbol.commons.testing.http.Request;
-import org.apache.stanbol.commons.testing.http.RequestBuilder;
-import org.apache.stanbol.commons.testing.http.RequestExecutor;
+import org.apache.sling.testing.tools.http.Request;
+import org.apache.sling.testing.tools.http.RequestBuilder;
+import org.apache.sling.testing.tools.http.RequestExecutor;
import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.runners.model.EachTestNotifier;
import org.junit.runner.Description;
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-org-apache-sling-junit-healthcheck] 12/45: SLING-2027 -
SlingRemoteTestParameters: make tests count check optional
Posted by ro...@apache.org.
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 9c9239ba61b3a0be1ab65ded040c56ec3659e699
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Mar 11 16:28:09 2011 +0000
SLING-2027 - SlingRemoteTestParameters: make tests count check optional
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/junit/remote@1080639 13f79535-47bb-0310-9956-ffa450edef68
---
.../testrunner/SlingRemoteTestParameters.java | 5 ----
.../remote/testrunner/SlingRemoteTestRunner.java | 10 +++-----
...Parameters.java => SlingTestsCountChecker.java} | 27 ++++++----------------
3 files changed, 10 insertions(+), 32 deletions(-)
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
index 69d83ea..7dd7944 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
@@ -32,9 +32,4 @@ public interface SlingRemoteTestParameters {
* for example "someMethodName"
*/
String getTestMethodSelector();
-
- /** Return the expected number of tests - if zero, no check
- * is done.
- */
- int getExpectedNumberOfTests();
}
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
index 8399d95..175b774 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestRunner.java
@@ -16,8 +16,6 @@
*/
package org.apache.sling.junit.remote.testrunner;
-import static org.junit.Assert.assertEquals;
-
import java.util.LinkedList;
import java.util.List;
@@ -96,11 +94,9 @@ public class SlingRemoteTestRunner extends ParentRunner<SlingRemoteTest> {
log.info("Server-side tests executed at {} with path {}",
testParameters.getJunitServletUrl(), testHttpClient.getTestExecutionPath());
- // Check that number of tests is as expected
- if(testParameters.getExpectedNumberOfTests() >= 0) {
- assertEquals("Expecting " + testParameters.getExpectedNumberOfTests() + " tests",
- testParameters.getExpectedNumberOfTests(),
- children.size());
+ // Optionally check that number of tests is as expected
+ if(testParameters instanceof SlingTestsCountChecker) {
+ ((SlingTestsCountChecker)testParameters).checkNumberOfTests(children.size());
}
}
diff --git a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingTestsCountChecker.java
similarity index 55%
copy from src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
copy to src/main/java/org/apache/sling/junit/remote/testrunner/SlingTestsCountChecker.java
index 69d83ea..31bdb37 100644
--- a/src/main/java/org/apache/sling/junit/remote/testrunner/SlingRemoteTestParameters.java
+++ b/src/main/java/org/apache/sling/junit/remote/testrunner/SlingTestsCountChecker.java
@@ -16,25 +16,12 @@
*/
package org.apache.sling.junit.remote.testrunner;
-/** Test class "proxies" implement this to indicate where to
- * run the tests.
+/** Tests classes can implement this interface to check the
+ * number of tests that are executed remotely. This is useful
+ * when tests are loaded dynamically, to check that all the required
+ * tests have indeed been executed, for example in continuous
+ * integration.
*/
-public interface SlingRemoteTestParameters {
- /** Return the URL of the JUnit servlet */
- String getJunitServletUrl();
-
- /** Return the optional selector for the test classes to run,
- * for example "org.apache.sling.testing.samples.sampletests.JUnit4Test"
- */
- String getTestClassesSelector();
-
- /** Return the optional selector for the test methods to run,
- * for example "someMethodName"
- */
- String getTestMethodSelector();
-
- /** Return the expected number of tests - if zero, no check
- * is done.
- */
- int getExpectedNumberOfTests();
+public interface SlingTestsCountChecker {
+ void checkNumberOfTests(int numberOfTestsExecuted);
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.