SLING-9718 - Relative paths for bundled HTL template files are not correctly handled
* if a servlet resource is found, work directly with its path to find the script class
or bundle entry
* corrected class name / file name when working with identifiers containing
relative path segments
diff --git a/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/two.html b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/two.html
index 63d3480..126d594 100644
--- a/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/two.html
+++ b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/two.html
@@ -21,6 +21,8 @@
<sly data-sly-use.twoTemplates="two-templates.html" data-sly-call="${twoTemplates.two}"></sly>
<div class="inherited" data-sly-use.inheritedTemplates="templates.html"
data-sly-call="${inheritedTemplates.precompiled1Template @ name ='John Doe'}"></div>
+<div class="inherited-relative" data-sly-use.inheritedTemplates="./templates.html"
+ data-sly-call="${inheritedTemplates.precompiled1Template @ name ='John Doe'}"></div>
<div class="absolute-path-1"
data-sly-use.absolutePathTemplates1="/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/templates.html"
data-sly-call="${absolutePathTemplates1.precompiled1Template @ name ='John Doe'}"></div>
diff --git a/it/pom.xml b/it/pom.xml
index 01afbdf..09678fe 100644
--- a/it/pom.xml
+++ b/it/pom.xml
@@ -200,7 +200,7 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.sightly</artifactId>
- <version>1.4.2-1.4.0</version>
+ <version>1.4.3-1.4.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java
index 063339d..22c947d 100644
--- a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java
+++ b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java
@@ -106,6 +106,9 @@
Elements inheritedTemplate = document.select("div.inherited > div.precompiled1Template > p");
assertEquals("Hello, John Doe!", inheritedTemplate.html());
+ Elements inheritedTemplateViaRelativePath = document.select("div.inherited-relative > div.precompiled1Template > p");
+ assertEquals("Hello, John Doe!", inheritedTemplateViaRelativePath.html());
+
Elements absoluteTemplate1 = document.select("div.absolute-path-1 > div.precompiled1Template > p");
assertEquals("Hello, John Doe!", absoluteTemplate1.html());