incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1073322 - in /sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools: SlingTestBase.java serverside/JSONResponseTest.java
Date Tue, 22 Feb 2011 13:35:47 GMT
Author: bdelacretaz
Date: Tue Feb 22 13:35:47 2011
New Revision: 1073322

URL: http://svn.apache.org/viewvc?rev=1073322&view=rev
Log:
SLING-1981 - server only needs to be started once, and with this change the JSONResponseTest
passes ;-)

Modified:
    sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
    sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/serverside/JSONResponseTest.java

Modified: sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java?rev=1073322&r1=1073321&r2=1073322&view=diff
==============================================================================
--- sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
(original)
+++ sling/trunk/testing/samples/test-tools/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
Tue Feb 22 13:35:47 2011
@@ -51,12 +51,17 @@ public class SlingTestBase {
     protected static DefaultHttpClient httpClient = new DefaultHttpClient();
     protected static RequestExecutor executor = new RequestExecutor(httpClient);
     
+    private static boolean serverStarted;
     private static boolean serverReady;
     private static boolean serverReadyTestFailed;
     private static final Logger log = LoggerFactory.getLogger(SlingTestBase.class);
     
     @BeforeClass
     public static synchronized void startRunnableJar() throws Exception {
+        if(serverStarted) {
+            return;
+        }
+        
         final String configuredUrl = System.getProperty(TEST_SERVER_URL_PROP);
         if(configuredUrl != null) {
             serverBaseUrl = configuredUrl;
@@ -78,6 +83,7 @@ public class SlingTestBase {
             }
         }
         
+        serverStarted = true;
         builder = new RequestBuilder(serverBaseUrl);
     }
     

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=1073322&r1=1073321&r2=1073322&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 13:35:47 2011
@@ -44,11 +44,11 @@ public class JSONResponseTest extends Se
     public static final int TEST_LIST_TIMEOUT_SECONDS = 30;
     
     @Test
-    @Ignore // TODO: fails in mvn build, why??
     public void testWithRetries() {
         // Need a retry loop as the tests might still be registering
         // when this test runs...we'd need to make the readyness detection
         // more extensive to avoid this
+        // TODO we could probably use a JUnit Rule to retry tests.
         final RetryLoop.Condition c = new RetryLoop.Condition() {
 
             public String getDescription() {



Mime
View raw message