You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2018/12/10 15:37:59 UTC

[sling-org-apache-sling-scripting-bundle-tracker-it] 06/07: implemented support for n-level inheritance script resolution

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

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-bundle-tracker-it.git

commit a6740111d25fc9e8c3f9f9921d17e174df6e7ee8
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Tue Dec 4 16:43:07 2018 +0100

    implemented support for n-level inheritance script resolution
---
 pom.xml                                                |  6 ++++++
 .../sling/scripting/resolver/internal/EndpointIT.java  | 18 ++++++++++++++++++
 src/test/provisioning/it-model.txt                     |  1 +
 3 files changed, 25 insertions(+)

diff --git a/pom.xml b/pom.xml
index 82d715c..afbadd7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -115,6 +115,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.examplebundle.ohhi</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
diff --git a/src/test/java/org/apache/sling/scripting/resolver/internal/EndpointIT.java b/src/test/java/org/apache/sling/scripting/resolver/internal/EndpointIT.java
index f4f93d0..edcdcb2 100644
--- a/src/test/java/org/apache/sling/scripting/resolver/internal/EndpointIT.java
+++ b/src/test/java/org/apache/sling/scripting/resolver/internal/EndpointIT.java
@@ -87,4 +87,22 @@ public class EndpointIT extends AbstractEndpointIT {
         Assert.assertTrue(document.body().html().contains("Hallo"));
         Assert.assertFalse(document.body().html().contains("Hello"));
     }
+
+    @Test
+    public void testOhHiEndpoint() throws Exception {
+        Document document = getDocument("content/srr/examples/ohhi.html");
+        Assert.assertEquals("We're testing some serious scripting here", document.select("h2").html());
+        Assert.assertTrue(document.body().html().contains("World"));
+        Assert.assertTrue(document.body().html().contains("Ohhi"));
+        Assert.assertFalse(document.body().html().contains("Hello"));
+    }
+
+    @Test
+    public void testOhHiEndpointV1() throws Exception {
+        Document document = getDocument("content/srr/examples/ohhi-v1.html");
+        Assert.assertEquals("We're testing some serious scripting here", document.select("h2").html());
+        Assert.assertTrue(document.body().html().contains("World"));
+        Assert.assertTrue(document.body().html().contains("Ohhi"));
+        Assert.assertFalse(document.body().html().contains("Hello"));
+    }
 }
diff --git a/src/test/provisioning/it-model.txt b/src/test/provisioning/it-model.txt
index e3d843d..987c38d 100644
--- a/src/test/provisioning/it-model.txt
+++ b/src/test/provisioning/it-model.txt
@@ -34,6 +34,7 @@
   org.apache.sling/org.apache.sling.scripting.examplebundle.precompiled
   org.apache.sling/org.apache.sling.scripting.examplebundle.classic
   org.apache.sling/org.apache.sling.scripting.examplebundle.hi
+  org.apache.sling/org.apache.sling.scripting.examplebundle.ohhi
   org.apache.sling/org.apache.sling.junit.core/1.0.26
 
 [configurations]