incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1073405 - in /sling/trunk/testing/samples/test-tools: ./ src/test/java/org/apache/sling/testing/samples/testtools/serverside/
Date Tue, 22 Feb 2011 16:57:03 GMT
Author: bdelacretaz
Date: Tue Feb 22 16:57:03 2011
New Revision: 1073405

URL: http://svn.apache.org/viewvc?rev=1073405&view=rev
Log:
SLING-1981 - run server-side tests as part of the Maven build, work in progress

Modified:
    sling/trunk/testing/samples/test-tools/pom.xml
    sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/JSONResponseTest.java
    sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTest.java
    sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java

Modified: sling/trunk/testing/samples/test-tools/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/test-tools/pom.xml?rev=1073405&r1=1073404&r2=1073405&view=diff
==============================================================================
--- sling/trunk/testing/samples/test-tools/pom.xml (original)
+++ sling/trunk/testing/samples/test-tools/pom.xml Tue Feb 22 16:57:03 2011
@@ -180,6 +180,11 @@
         
         <!-- actual dependencies -->
         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.junit.remote</artifactId>
+            <version>0.1.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.stanbol</groupId>
             <artifactId>org.apache.stanbol.commons.testing.jarexec</artifactId>
             <version>0.9-SNAPSHOT</version>

Modified: sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/JSONResponseTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/JSONResponseTest.java?rev=1073405&r1=1073404&r2=1073405&view=diff
==============================================================================
--- sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/JSONResponseTest.java
(original)
+++ sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/JSONResponseTest.java
Tue Feb 22 16:57:03 2011
@@ -16,8 +16,8 @@
  */
 package org.apache.sling.testing.samples.testtools.serverside;
 
-import static org.junit.Assert.fail;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.util.Arrays;
 import java.util.List;
@@ -27,7 +27,6 @@ import org.apache.sling.commons.json.JSO
 import org.apache.sling.commons.json.JSONTokener;
 import org.apache.stanbol.commons.testing.http.Request;
 import org.apache.stanbol.commons.testing.http.RetryLoop;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTest.java?rev=1073405&r1=1073404&r2=1073405&view=diff
==============================================================================
--- sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTest.java
(original)
+++ sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTest.java
Tue Feb 22 16:57:03 2011
@@ -16,17 +16,36 @@
  */
 package org.apache.sling.testing.samples.testtools.serverside;
 
+import org.apache.sling.junit.remote.testrunner.SlingRemoteTestParameters;
+import org.apache.sling.junit.remote.testrunner.SlingRemoteTestRunner;
 import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.junit.runner.RunWith;
 
-/** Run all server-side tests */ 
-public class ServerSideTest extends ServerSideTestsBase {
-    private final Logger log = LoggerFactory.getLogger(getClass());
+/** Run all server-side tests */
+@RunWith(SlingRemoteTestRunner.class)
+public class ServerSideTest extends ServerSideTestsBase implements SlingRemoteTestParameters
{
     
+    public int getExpectedNumberOfTests() {
+        return 11;
+    }
+
+    public String getJunitServletPath() {
+        return JUNIT_SERVLET_PATH;
+    }
+
+    public String getServerBaseUrl() {
+        try {
+            // TODO do those really belong here??
+            // Needed to init serverBaseUrl
+            startRunnableJar();
+            checkJunitServletPresent();
+        } catch (Exception e) {
+            throw new IllegalStateException("checkJunitServletPresent failed", e);
+        }
+        return serverBaseUrl;
+    }
+
     @Test
-    public void testNothing() {
-        // TODO run the actual tests via junit servlet
-        log.info("If we get there that means " + JUNIT_SERVLET_PATH + " works");
+    public void dummyTest() {
     }
 }
\ No newline at end of file

Modified: sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java?rev=1073405&r1=1073404&r2=1073405&view=diff
==============================================================================
--- sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java
(original)
+++ sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java
Tue Feb 22 16:57:03 2011
@@ -34,7 +34,7 @@ public class ServerSideTestsBase extends
     // TODO compute those timeouts based on a configured factor
     // to cope with slower testing systems??
     public static final int JUNIT_SERVLET_TIMEOUT_SECONDS = 60;
-    
+
     @Before
     public void checkJunitServletPresent() throws Exception {
         if(junitServletOk) {



Mime
View raw message