incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1076200 - /sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java
Date Wed, 02 Mar 2011 12:51:25 GMT
Author: bdelacretaz
Date: Wed Mar  2 12:51:25 2011
New Revision: 1076200

URL: http://svn.apache.org/viewvc?rev=1076200&view=rev
Log:
SLING-1981 - do not retry JUnit servlet if failed previously

Modified:
    sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java

Modified: sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java?rev=1076200&r1=1076199&r2=1076200&view=diff
==============================================================================
--- sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java
(original)
+++ sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/serverside/ServerSideTestsBase.java
Wed Mar  2 12:51:25 2011
@@ -21,6 +21,7 @@ import org.apache.sling.testing.samples.
 import org.apache.sling.testing.tools.retry.RetryLoop;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import static org.junit.Assert.fail;
 
 /** Base class for tests that require the server-side test bundles
  *  to be active.
@@ -29,6 +30,7 @@ public class ServerSideTestsBase extends
     public static final String JUNIT_SERVLET_PATH = "/system/sling/junit";
     
     private static boolean junitServletOk;
+    private static boolean junitServletCheckFailed;
     private final Logger log = LoggerFactory.getLogger(getClass());
     public static final int JUNIT_SERVLET_TIMEOUT_SECONDS = TimeoutsProvider.getInstance().getTimeout(60);
 
@@ -44,6 +46,9 @@ public class ServerSideTestsBase extends
         if(junitServletOk) {
             return;
         }
+        if(junitServletCheckFailed) {
+            fail("Previous check of JUnit servlet failed, cannot run tests");
+        }
 
         // Retry accessing the junit servlet until it responds or timeout
         // (as we might just have installed the required bundles)
@@ -63,7 +68,14 @@ public class ServerSideTestsBase extends
         };
         
         log.info(c.getDescription());
-        new RetryLoop(c, JUNIT_SERVLET_TIMEOUT_SECONDS, TimeoutsProvider.getInstance().getTimeout(500));

+        new RetryLoop(c, JUNIT_SERVLET_TIMEOUT_SECONDS, TimeoutsProvider.getInstance().getTimeout(500))
{
+            @Override
+            protected void onTimeout() {
+                super.onTimeout();
+                junitServletCheckFailed = true;
+            }
+            
+        };
         junitServletOk = true;
     }
 }



Mime
View raw message