You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by en...@apache.org on 2021/06/07 22:38:09 UTC

[sling-org-apache-sling-starter] branch master updated: SLING-10459 Update starter to use Oak 1.40.0 (#26)

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

enorman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter.git


The following commit(s) were added to refs/heads/master by this push:
     new d101914  SLING-10459 Update starter to use Oak 1.40.0 (#26)
d101914 is described below

commit d10191493c0c5f3ed9b4f7d7d4a02bb520ed371c
Author: Eric Norman <er...@gmail.com>
AuthorDate: Mon Jun 7 15:38:01 2021 -0700

    SLING-10459 Update starter to use Oak 1.40.0 (#26)
    
    Also a list of readable URLs is now configurable in the pom via starter.readable.N system properties.   Those urls are checked in the SmokeIT to guard against regressions
---
 pom.xml                                            |  7 ++++--
 .../oak/persistence/oak_persistence_mongods.json   |  3 +--
 .../java/org/apache/sling/launchpad/SmokeIT.java   | 27 ++++++++++++++++++++--
 3 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9965715..f17fe36 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,7 +43,7 @@
         <!-- versions to be replaced in the feature files -->
         <asm.version>9.1</asm.version>
         <jackrabbit.version>2.20.2</jackrabbit.version>
-        <oak.version>1.38.0</oak.version>
+        <oak.version>1.40.0</oak.version>
         <slf4j.version>1.7.30</slf4j.version>
         <composum.nodes.version>2.6.1</composum.nodes.version>
         <jackson.version>2.12.1</jackson.version>
@@ -318,7 +318,7 @@
                         </goals>
                     </execution>
                 </executions>
-            </plugin>                
+            </plugin>
             <!-- run the ITs -->
             <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
@@ -334,6 +334,9 @@
                    <systemPropertyVariables>
                        <starter.http.test.ports>false:${http.port},${docker.skip}:${http.port.mongo}</starter.http.test.ports>
                        <starter.min.bundles.count>${starter.min.bundles.count}</starter.min.bundles.count>
+                       <!-- Specify any number of starter.readable.N props for relative paths to check for a successful get request. -->
+                       <!-- Check the affected path for SLING-10402 regression checking -->
+                       <starter.readable.1>/slingshot/users/slingshot1/travel/home/images/home.jpg</starter.readable.1>
                    </systemPropertyVariables>
                </configuration>
             </plugin>
diff --git a/src/main/features/oak/persistence/oak_persistence_mongods.json b/src/main/features/oak/persistence/oak_persistence_mongods.json
index 11c17ce..54a1036 100644
--- a/src/main/features/oak/persistence/oak_persistence_mongods.json
+++ b/src/main/features/oak/persistence/oak_persistence_mongods.json
@@ -8,8 +8,7 @@
              "start-order":"15"
         },
         {
-             // Do NOT blindly update this, see SLING-10402
-             "id":"org.mongodb:mongo-java-driver:3.8.2",
+             "id":"org.mongodb:mongo-java-driver:3.12.8",
              "start-order":"15"
          }
     ],
diff --git a/src/test/java/org/apache/sling/launchpad/SmokeIT.java b/src/test/java/org/apache/sling/launchpad/SmokeIT.java
index ec672d1..29372fb 100644
--- a/src/test/java/org/apache/sling/launchpad/SmokeIT.java
+++ b/src/test/java/org/apache/sling/launchpad/SmokeIT.java
@@ -18,7 +18,7 @@ package org.apache.sling.launchpad;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
@@ -57,6 +57,8 @@ import org.w3c.dom.Node;
 
 @RunWith(Parameterized.class)
 public class SmokeIT {
+    private static final String READABLE_PROP_PREFIX = "starter.readable.";
+    private static final int MAX_READABLE_INDEX = 50;
 
     private final int slingHttpPort;
     private static final int STARTER_MIN_BUNDLES_COUNT = Integer.getInteger("starter.min.bundles.count", Integer.MAX_VALUE);
@@ -65,7 +67,7 @@ public class SmokeIT {
     public final StarterReadyRule launchpadRule;
     private HttpClientContext httpClientContext;
 
-    @Parameterized.Parameters(name = "{0}")
+    @Parameterized.Parameters(name = "Port: {0,number,#}")
     public static Collection<Object[]> data() {
         // This is a string of Sling instance port numbers to test, like
         //     false:80,true:1234
@@ -201,6 +203,27 @@ public class SmokeIT {
         }
     }
 
+    /**
+     * For testing the SLING-10402 scenario
+     */
+    @Test
+    public void verifyReadableUrls() throws Exception {
+        try ( CloseableHttpClient client = newClient() ) {
+            for (int i = 0; i <= MAX_READABLE_INDEX ; i++) {
+                final String propName = READABLE_PROP_PREFIX + i;
+                final String readable = System.getProperty(propName, "");
+                if (!readable.isEmpty()) {
+                    HttpGet get = new HttpGet(String.format("http://localhost:%d%s", slingHttpPort, readable));
+                    try (CloseableHttpResponse response = client.execute(get, httpClientContext)) {
+                        if ( response.getStatusLine().getStatusCode() != 200 ) {
+                            fail(String.format("Unexpected status line \"%s\" for %s", response.getStatusLine(), readable));
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     static class BundleStatus {
 
         long totalBundles;