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 2020/10/02 13:05:53 UTC

[sling-org-apache-sling-starter] 02/02: SLING-9637 - Re-enable Smoke IT, but only keep the repository available check

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-9637
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter.git

commit 01ef45013e826d822fe9cbec5a1ddbae2adf14d2
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Oct 2 15:02:31 2020 +0200

    SLING-9637 - Re-enable Smoke IT, but only keep the repository available check
    
    Naming changes, mostly from launchpad to starter
---
 pom.xml                                                |  6 +++---
 src/test/java/org/apache/sling/launchpad/SmokeIT.java  | 18 +++++++++---------
 .../{LaunchpadReadyRule.java => StarterReadyRule.java} |  6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 56bd885..375f926 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
 
     <properties>
         <sling.java.version>8</sling.java.version>
-        <IT.expected.bundles.count>126</IT.expected.bundles.count>
+        <starter.min.bundles.count>126</starter.min.bundles.count>
 
         <!-- versions to be replaced in the feature files -->
         <jackrabbit.version>2.20.0</jackrabbit.version>
@@ -245,8 +245,8 @@
                </executions>
                <configuration>
                    <systemPropertyVariables>
-                       <launchpad.http.port>${http.port}</launchpad.http.port>
-                       <IT.expected.bundles.count>${IT.expected.bundles.count}</IT.expected.bundles.count>
+                       <starter.http.port>${http.port}</starter.http.port>
+                       <starter.min.bundles.count>${starter.min.bundles.count}</starter.min.bundles.count>
                    </systemPropertyVariables>
                </configuration>
             </plugin>
diff --git a/src/test/java/org/apache/sling/launchpad/SmokeIT.java b/src/test/java/org/apache/sling/launchpad/SmokeIT.java
index 71676dc..26381fc 100644
--- a/src/test/java/org/apache/sling/launchpad/SmokeIT.java
+++ b/src/test/java/org/apache/sling/launchpad/SmokeIT.java
@@ -52,11 +52,11 @@ import org.w3c.dom.Node;
 
 public class SmokeIT {
 
-    private static final int LAUNCHPAD_PORT = Integer.getInteger("launchpad.http.port", 8080);
-    private static final int EXPECTED_BUNDLES_COUNT = Integer.getInteger("IT.expected.bundles.count", Integer.MAX_VALUE);
+    private static final int STARTER_HTTP_PORT = Integer.getInteger("starter.http.port", 8080);
+    private static final int STARTER_MIN_BUNDLES_COUNT = Integer.getInteger("starter.min.bundles.count", Integer.MAX_VALUE);
 
     @ClassRule
-    public static LaunchpadReadyRule LAUNCHPAD = new LaunchpadReadyRule(LAUNCHPAD_PORT);
+    public static StarterReadyRule LAUNCHPAD = new StarterReadyRule(STARTER_HTTP_PORT);
     private HttpClientContext httpClientContext;
 
     @Before
@@ -64,11 +64,11 @@ public class SmokeIT {
 
         CredentialsProvider credsProvider = new BasicCredentialsProvider();
         UsernamePasswordCredentials creds = new UsernamePasswordCredentials("admin", "admin");
-        credsProvider.setCredentials(new AuthScope("localhost", LAUNCHPAD_PORT), creds);
+        credsProvider.setCredentials(new AuthScope("localhost", STARTER_HTTP_PORT), creds);
 
         BasicAuthCache authCache = new BasicAuthCache();
         BasicScheme basicAuth = new BasicScheme();
-        authCache.put(new HttpHost("localhost", LAUNCHPAD_PORT, "http"), basicAuth);
+        authCache.put(new HttpHost("localhost", STARTER_HTTP_PORT, "http"), basicAuth);
 
         httpClientContext = HttpClientContext.create();
         httpClientContext.setCredentialsProvider(credsProvider);
@@ -87,7 +87,7 @@ public class SmokeIT {
 
         try ( CloseableHttpClient client = newClient() ) {
 
-            HttpGet get = new HttpGet("http://localhost:" + LAUNCHPAD_PORT + "/system/console/bundles.json");
+            HttpGet get = new HttpGet("http://localhost:" + STARTER_HTTP_PORT + "/system/console/bundles.json");
 
             // pass the context to ensure preemptive basic auth is used
             // https://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html
@@ -107,8 +107,8 @@ public class SmokeIT {
 
                 @SuppressWarnings("unchecked")
                 List<Object> bundles = (List<Object>) obj.get("data");
-                if(bundles.size() < EXPECTED_BUNDLES_COUNT) {
-                    fail("Expected at least " + EXPECTED_BUNDLES_COUNT + " bundles, got " + bundles.size());
+                if(bundles.size() < STARTER_MIN_BUNDLES_COUNT) {
+                    fail("Expected at least " + STARTER_MIN_BUNDLES_COUNT + " bundles, got " + bundles.size());
                 }
 
                 BundleStatus bs = new BundleStatus(status);
@@ -148,7 +148,7 @@ public class SmokeIT {
     public void ensureRepositoryIsStarted() throws Exception {
         try ( CloseableHttpClient client = newClient() ) {
 
-            HttpGet get = new HttpGet("http://localhost:" + LAUNCHPAD_PORT + "/server/default/jcr:root/content");
+            HttpGet get = new HttpGet("http://localhost:" + STARTER_HTTP_PORT + "/server/default/jcr:root/content");
 
             try ( CloseableHttpResponse response = client.execute(get) ) {
 
diff --git a/src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java b/src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
similarity index 94%
rename from src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java
rename to src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
index d6b6d6f..bffac80 100644
--- a/src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java
+++ b/src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
@@ -29,14 +29,14 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.junit.rules.ExternalResource;
 
-public class LaunchpadReadyRule extends ExternalResource {
+public class StarterReadyRule extends ExternalResource {
 
     private static final int TRIES = 60;
     private static final int WAIT_BETWEEN_TRIES_MILLIS = 1000;
 
     private final List<Check> checks = new ArrayList<>();
 
-    public LaunchpadReadyRule(int launchpadPort) {
+    public StarterReadyRule(int launchpadPort) {
 
         checks.add(new Check("http://localhost:" + launchpadPort + "/server/default/jcr:root/content"));
         checks.add(new Check("http://localhost:" + launchpadPort + "/content/starter.html") {
@@ -93,7 +93,7 @@ public class LaunchpadReadyRule extends ExternalResource {
             Thread.sleep(WAIT_BETWEEN_TRIES_MILLIS);
         }
         
-        throw new RuntimeException(String.format("Launchpad not ready. Failed check for URL %s with message '%s'",
+        throw new RuntimeException(String.format("Starter not ready. Failed check for URL %s with message '%s'",
                 check.getUrl(), lastFailure));
     }