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
The following commit(s) were added to refs/heads/master by this push:
new 77a6a04 SLING-9255 - Allow servlet resolution based on path
77a6a04 is described below
commit 77a6a0445100516c2716ef478b861088725c56d9
Author: Radu Cotescu <[email protected]>
AuthorDate: Fri Mar 27 12:30:28 2020 +0100
SLING-9255 - Allow servlet resolution based on path
* extended tests for script inclusion and script overlaying / inheritance
* added tests for precompiled JSPs
---
examples/README.md | 3 +-
.../pom.xml | 4 +-
.../scripting/examplebundle-classic}/hello/h.html | 2 +-
.../examplebundle-classic/hello/hello.html} | 3 +-
.../scripting/examplebundle-classic}/hello/w.html | 2 +-
.../{example.xml => examplebundle-classic.xml} | 4 +-
.../pom.xml | 4 +-
.../SLING-INF/content/examplebundle-extend1.xml} | 8 +-
.../1.0.0/extends | 1 +
.../1.0.0/h.html | 2 +-
.../pom.xml | 4 +-
.../SLING-INF/content/examplebundle-extend2.xml} | 16 +--
.../1.0.0/extends | 1 +
.../1.0.0}/h.html | 2 +-
.../1.0.0/extends | 1 +
.../1.0.0}/h.html | 2 +-
.../pom.xml | 48 ++++-----
.../content/examplebundle-precompiled-jsp.xml} | 13 +--
.../h.jsp} | 6 +-
.../hello.jsp} | 10 +-
.../w.jsp} | 6 +-
.../pom.xml | 2 +-
.../{example.xml => examplebundle-precompiled.xml} | 30 +++---
.../1.0.0/h.html | 2 +-
.../1.0.0/hello.html | 4 +-
.../1.0.0/w.html | 2 +-
.../2.0.0/h.html | 2 +-
.../2.0.0/hello.html | 8 +-
.../2.0.0/w.html | 2 +-
.../1.0.0/extends | 1 -
.../1.0.0/extends | 1 -
.../1.0.0/h.html | 19 ----
.../pom.xml | 8 +-
.../content/{example.xml => examplebundle.xml} | 9 ++
.../sling/scripting/examplebundle/hello}/h.html | 2 +-
.../scripting/examplebundle/hello/hello.html} | 3 +-
.../sling/scripting/examplebundle}/hello/w.html | 2 +-
.../1.0.0/h.html | 2 +-
.../1.0.0/hello.html | 4 +-
.../1.0.0/w.html | 2 +-
.../2.0.0/h.html | 2 +-
.../2.0.0/hello.html | 4 +-
.../2.0.0/w.html | 2 +-
it/pom.xml | 33 ++++---
.../junit/teleporter/customizers/ITCustomizer.java | 35 -------
.../tracker/it/AbstractEndpointTestBase.java | 8 +-
.../bundle/tracker/it/BundledScriptTrackerIT.java | 69 -------------
.../scripting/bundle/tracker/it/EndpointIT.java | 108 ---------------------
.../bundle/tracker/it/ExampleBundleClassicIT.java | 47 +++++++++
.../bundle/tracker/it/ExampleBundleExtend1IT.java | 68 +++++++++++++
.../bundle/tracker/it/ExampleBundleExtend2IT.java | 106 ++++++++++++++++++++
.../bundle/tracker/it/ExampleBundleIT.java | 98 +++++++++++++++++++
.../tracker/it/ExampleBundlePrecompiledIT.java | 81 ++++++++++++++++
.../tracker/it/ExampleBundlePrecompiledJSPIT.java | 48 +++++++++
.../scripting/bundle/tracker/it/ScriptMatchIT.java | 36 +++----
it/src/test/provisioning/it-model.txt | 8 +-
pom.xml | 7 +-
57 files changed, 622 insertions(+), 385 deletions(-)
diff --git a/examples/README.md b/examples/README.md
index 7bf0a1f..12d5904 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -4,11 +4,12 @@ Examples
Because some code is worth a thousand words...
The examples provided by the project also serve as integration tests,
therefore they should always work and be relatively up-to-date.
-Two bundles showcase how the
[`org.apache.sling.scripting.bundle.tracker`](https://github.com/apache/sling-org-apache-sling-scripting-bundle-tracker/tree/master/README.md)
works and how you can
+Four bundles showcase how the
[`org.apache.sling.scripting.bundle.tracker`](https://github.com/apache/sling-org-apache-sling-scripting-bundle-tracker/tree/master/README.md)
works and how you can
package your scripts into OSGi bundles:
1.
[`org.apache.sling.scripting.examplebundle`](./org-apache-sling-scripting-examplebundle):
* provides the `org.apache.sling.scripting.examplebundle.hello` resource
type
+ * its scripts are packed as is and compiled on the platform
* the resource type is provided in two versions (`1.0.0` and `2.0.0`)
* it has a main script (`hello.html`) and some selector scripts
* initial content is available at:
diff --git a/examples/org-apache-sling-scripting-examplebundle-classic/pom.xml
b/examples/org-apache-sling-scripting-examplebundle-classic/pom.xml
index c18ddf3..53eef77 100644
--- a/examples/org-apache-sling-scripting-examplebundle-classic/pom.xml
+++ b/examples/org-apache-sling-scripting-examplebundle-classic/pom.xml
@@ -42,8 +42,8 @@
<configuration>
<instructions>
<Sling-Initial-Content>
-
SLING-INF/content;overwrite:=true;path:=/content/srr/examples,
-
SLING-INF/apps/assr;overwrite:=true;path:=/apps/assr,
+
SLING-INF/content;overwrite:=true;path:=/content/bundled-scripts/examplebundle-classic,
+
SLING-INF/apps/sling/scripting/examplebundle-classic;overwrite:=true;path:=/apps/sling/scripting/examplebundle-classic
</Sling-Initial-Content>
</instructions>
</configuration>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/h.html
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/h.html
similarity index 93%
rename from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/h.html
rename to
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/h.html
index cf193e9..839b285 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello2'}"></span>
+<span id="h-classic" data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/hello.html
similarity index 90%
copy from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
copy to
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/hello.html
index 3c6b564..3b17a42 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/hello.html
@@ -16,4 +16,5 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+<h2>${resource.resourceType}</h2>
+<sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/w.html
similarity index 93%
copy from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
copy to
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/w.html
index 3c6b564..5abce6c 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/w.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+<span id="w-classic" data-rt="${resource.resourceType}">World</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/content/example.xml
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/content/examplebundle-classic.xml
similarity index 92%
rename from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/content/example.xml
rename to
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/content/examplebundle-classic.xml
index ced92b6..aa76b01 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/content/example.xml
+++
b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/content/examplebundle-classic.xml
@@ -18,11 +18,11 @@
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<node>
- <name>classic-hello</name>
+ <name>hello</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
- <value>assr/scripts/hello</value>
+ <value>sling/scripting/examplebundle-classic/hello</value>
<type>String</type>
</property>
</node>
diff --git a/examples/org-apache-sling-scripting-examplebundle.hi/pom.xml
b/examples/org-apache-sling-scripting-examplebundle-extend1/pom.xml
similarity index 96%
rename from examples/org-apache-sling-scripting-examplebundle.hi/pom.xml
rename to examples/org-apache-sling-scripting-examplebundle-extend1/pom.xml
index 5a5a429..6526aee 100644
--- a/examples/org-apache-sling-scripting-examplebundle.hi/pom.xml
+++ b/examples/org-apache-sling-scripting-examplebundle-extend1/pom.xml
@@ -29,7 +29,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>org.apache.sling.scripting.examplebundle.hi</artifactId>
+ <artifactId>org.apache.sling.scripting.examplebundle.extend1</artifactId>
<version>0.1.1-SNAPSHOT</version>
<packaging>bundle</packaging>
@@ -65,7 +65,7 @@
${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability}
</Require-Capability>
<Sling-Initial-Content>
-
SLING-INF/content;overwrite:=true;path:=/content/srr/examples
+
SLING-INF/content;overwrite:=true;path:=/content/bundled-scripts/examplebundle-extend1
</Sling-Initial-Content>
</instructions>
</configuration>
diff --git
a/examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/SLING-INF/content/example.xml
b/examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/SLING-INF/content/examplebundle-extend1.xml
similarity index 86%
rename from
examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/SLING-INF/content/example.xml
rename to
examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/SLING-INF/content/examplebundle-extend1.xml
index 98c6cae..be0382a 100644
---
a/examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/SLING-INF/content/example.xml
+++
b/examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/SLING-INF/content/examplebundle-extend1.xml
@@ -18,20 +18,20 @@
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<node>
- <name>hi</name>
+ <name>hello</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
- <value>org.apache.sling.scripting.examplebundle.hi</value>
+ <value>org.apache.sling.scripting.examplebundle.extend1.hello</value>
<type>String</type>
</property>
</node>
<node>
- <name>hi-v1</name>
+ <name>hello-v1</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
- <value>org.apache.sling.scripting.examplebundle.hi/1.0.0</value>
+
<value>org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0</value>
<type>String</type>
</property>
</node>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0/extends
b/examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0/extends
new file mode 100644
index 0000000..e5a2d21
--- /dev/null
+++
b/examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0/extends
@@ -0,0 +1 @@
+org.apache.sling.scripting.examplebundle.precompiled.hello;version=[1.0.0,2.0.0)
diff --git
a/examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hi/1.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0/h.html
similarity index 93%
rename from
examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hi/1.0.0/h.html
rename to
examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0/h.html
index 59a4368..bfdb090 100644
---
a/examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hi/1.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle-extend1/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-Hallo
+<span id="h-extend1" data-rt="${resource.resourceType}">Hello</span>
diff --git a/examples/org-apache-sling-scripting-examplebundle.ohhi/pom.xml
b/examples/org-apache-sling-scripting-examplebundle-extend2/pom.xml
similarity index 96%
rename from examples/org-apache-sling-scripting-examplebundle.ohhi/pom.xml
rename to examples/org-apache-sling-scripting-examplebundle-extend2/pom.xml
index 10ab06a..07312e0 100644
--- a/examples/org-apache-sling-scripting-examplebundle.ohhi/pom.xml
+++ b/examples/org-apache-sling-scripting-examplebundle-extend2/pom.xml
@@ -29,7 +29,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>org.apache.sling.scripting.examplebundle.ohhi</artifactId>
+ <artifactId>org.apache.sling.scripting.examplebundle.extend2</artifactId>
<version>0.1.1-SNAPSHOT</version>
<packaging>bundle</packaging>
@@ -65,7 +65,7 @@
${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability}
</Require-Capability>
<Sling-Initial-Content>
-
SLING-INF/content;overwrite:=true;path:=/content/srr/examples
+
SLING-INF/content;overwrite:=true;path:=/content/bundled-scripts/examplebundle-extend2
</Sling-Initial-Content>
</instructions>
</configuration>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/example.xml
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/SLING-INF/content/examplebundle-extend2.xml
similarity index 80%
copy from
examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/example.xml
copy to
examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/SLING-INF/content/examplebundle-extend2.xml
index 49524b6..8b371cd 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/example.xml
+++
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/SLING-INF/content/examplebundle-extend2.xml
@@ -18,38 +18,38 @@
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<node>
- <name>hello</name>
+ <name>one</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
- <value>org.apache.sling.scripting.examplebundle.hello</value>
+ <value>org.apache.sling.scripting.examplebundle.extend2.one</value>
<type>String</type>
</property>
</node>
<node>
- <name>hello-v1</name>
+ <name>one-v1</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
- <value>org.apache.sling.scripting.examplebundle.hello/1.0.0</value>
+
<value>org.apache.sling.scripting.examplebundle.extend2.one/1.0.0</value>
<type>String</type>
</property>
</node>
<node>
- <name>hello-v2</name>
+ <name>two</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
- <value>org.apache.sling.scripting.examplebundle.hello/2.0.0</value>
+ <value>org.apache.sling.scripting.examplebundle.extend2.two</value>
<type>String</type>
</property>
</node>
<node>
-<name>script-matching</name>
+ <name>two-v1</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
-
<value>org.apache.sling.scripting.examplebundle.scriptmatching/1.0.0</value>
+
<value>org.apache.sling.scripting.examplebundle.extend2.two/1.0.0</value>
<type>String</type>
</property>
</node>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.one/1.0.0/extends
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.one/1.0.0/extends
new file mode 100644
index 0000000..ac885aa
--- /dev/null
+++
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.one/1.0.0/extends
@@ -0,0 +1 @@
+org.apache.sling.scripting.examplebundle.extend1.hello;version=[1.0.0,2.0.0)
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.one/1.0.0/h.html
similarity index 93%
copy from
examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
copy to
examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.one/1.0.0/h.html
index cf193e9..c3a8800 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.one/1.0.0/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello2'}"></span>
+<span id="h-extend2-one" data-rt="${resource.resourceType}">Hello</span>
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/extends
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/extends
new file mode 100644
index 0000000..bdb285a
--- /dev/null
+++
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/extends
@@ -0,0 +1 @@
+org.apache.sling.scripting.examplebundle.extend2.one;version=[1.0.0,2.0.0)
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/h.html
similarity index 93%
copy from
examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
copy to
examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/h.html
index cf193e9..d380823 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello2'}"></span>
+<span id="h-extend2-two" data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/pom.xml
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/pom.xml
similarity index 78%
copy from examples/org-apache-sling-scripting-examplebundle-precompiled/pom.xml
copy to
examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/pom.xml
index a736c60..61f9422 100644
--- a/examples/org-apache-sling-scripting-examplebundle-precompiled/pom.xml
+++ b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/pom.xml
@@ -29,7 +29,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
-
<artifactId>org.apache.sling.scripting.examplebundle.precompiled</artifactId>
+
<artifactId>org.apache.sling.scripting.examplebundle.precompiled.jsp</artifactId>
<version>0.1.1-SNAPSHOT</version>
<packaging>bundle</packaging>
@@ -63,7 +63,7 @@
${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability}
</Require-Capability>
<Sling-Initial-Content>
-
SLING-INF/content;overwrite:=true;path:=/content/srr/examples
+
SLING-INF/content;overwrite:=true;path:=/content/bundled-scripts/examplebundle-precompiled-jsp
</Sling-Initial-Content>
<Sling-ResourceType-Precompiled>true</Sling-ResourceType-Precompiled>
</instructions>
@@ -71,20 +71,21 @@
</plugin>
<plugin>
<groupId>org.apache.sling</groupId>
- <artifactId>htl-maven-plugin</artifactId>
- <version>1.3.5-1.4.0-SNAPSHOT</version>
+ <artifactId>jspc-maven-plugin</artifactId>
+ <version>2.1.1-SNAPSHOT</version>
<executions>
<execution>
- <id>validate-htl-scripts</id>
<goals>
- <goal>validate</goal>
+ <goal>jspc</goal>
</goals>
- <phase>generate-sources</phase>
- <configuration>
- <generateJavaClasses>true</generateJavaClasses>
- </configuration>
</execution>
</executions>
+ <configuration>
+ <jasperMappedFile>true</jasperMappedFile>
+ <jasperKeepGenerated>true</jasperKeepGenerated>
+ <compilerSourceVM>1.8</compilerSourceVM>
+ <compilerTargetVM>1.8</compilerTargetVM>
+ </configuration>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
@@ -100,38 +101,27 @@
<dependencies>
<dependency>
+ <artifactId>org.apache.sling.scripting.jsp-api</artifactId>
+ <version>1.0.2</version>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.api</artifactId>
- <version>2.16.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.models.api</artifactId>
- <version>1.3.6</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-atinject_1.0_spec</artifactId>
- <version>1.0</version>
+ <artifactId>org.apache.sling.scripting.jsp</artifactId>
+ <version>2.5.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.scripting.sightly.runtime</artifactId>
- <version>1.0.0-1.4.0</version>
+ <artifactId>org.apache.sling.scripting.jsp.taglib</artifactId>
+ <version>2.4.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.settings</artifactId>
- <version>1.3.10</version>
+ <artifactId>org.apache.sling.api</artifactId>
+ <version>2.22.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
diff --git
a/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/SLING-INF/content/example.xml
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/resources/SLING-INF/content/examplebundle-precompiled-jsp.xml
similarity index 76%
rename from
examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/SLING-INF/content/example.xml
rename to
examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/resources/SLING-INF/content/examplebundle-precompiled-jsp.xml
index 4cc3b73..66006d3 100644
---
a/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/SLING-INF/content/example.xml
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/resources/SLING-INF/content/examplebundle-precompiled-jsp.xml
@@ -18,20 +18,11 @@
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<node>
- <name>ohhi</name>
+ <name>hello</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
- <value>org.apache.sling.scripting.examplebundle.ohhi</value>
- <type>String</type>
- </property>
-</node>
-<node>
- <name>ohhi-v1</name>
- <primaryNodeType>nt:unstructured</primaryNodeType>
- <property>
- <name>sling:resourceType</name>
- <value>org.apache.sling.scripting.examplebundle.ohhi/1.0.0</value>
+
<value>org.apache.sling.scripting.examplebundle.precompiled.jsp.hello</value>
<type>String</type>
</property>
</node>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/h.jsp
similarity index 83%
copy from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
copy to
examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/h.jsp
index 3c6b564..10664f1 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/h.jsp
@@ -1,4 +1,4 @@
-<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
@@ -15,5 +15,5 @@
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+<span id="h-precompiled-jsp" data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/hello.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp
similarity index 74%
rename from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/hello.html
rename to
examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp
index 7840f51..3bb2653 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/hello.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp
@@ -1,4 +1,4 @@
-<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
@@ -15,6 +15,8 @@
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>We're testing some serious scripting here in Version 2</h2>
-<span data-sly-resource="${ @ selectors='h'}"></span> <span
data-sly-resource="${ @ selectors='w'}"></span>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+<%@page session="false" pageEncoding="utf-8"%>
+<%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.2"%>
+<h2>${resource.resourceType}</h2>
+<sling:call script="h.jsp"/><sling:call script="w.jsp"/>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/w.jsp
similarity index 83%
copy from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
copy to
examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/w.jsp
index 3c6b564..dee3f35 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/w.jsp
@@ -1,4 +1,4 @@
-<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
@@ -15,5 +15,5 @@
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+<span id="w-precompiled-jsp" data-rt="${resource.resourceType}">World</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/pom.xml
b/examples/org-apache-sling-scripting-examplebundle-precompiled/pom.xml
index a736c60..1f88aed 100644
--- a/examples/org-apache-sling-scripting-examplebundle-precompiled/pom.xml
+++ b/examples/org-apache-sling-scripting-examplebundle-precompiled/pom.xml
@@ -63,7 +63,7 @@
${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability}
</Require-Capability>
<Sling-Initial-Content>
-
SLING-INF/content;overwrite:=true;path:=/content/srr/examples
+
SLING-INF/content;overwrite:=true;path:=/content/bundled-scripts/examplebundle-precompiled
</Sling-Initial-Content>
<Sling-ResourceType-Precompiled>true</Sling-ResourceType-Precompiled>
</instructions>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/resources/SLING-INF/content/example.xml
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/resources/SLING-INF/content/examplebundle-precompiled.xml
similarity index 69%
rename from
examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/resources/SLING-INF/content/example.xml
rename to
examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/resources/SLING-INF/content/examplebundle-precompiled.xml
index 0a67aa7..86f1582 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/resources/SLING-INF/content/example.xml
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/resources/SLING-INF/content/examplebundle-precompiled.xml
@@ -18,7 +18,7 @@
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<node>
- <name>precompiled-hello</name>
+ <name>hello</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
<name>sling:resourceType</name>
@@ -27,20 +27,20 @@
</property>
</node>
<node>
-<name>precompiled-hello-v1</name>
-<primaryNodeType>nt:unstructured</primaryNodeType>
-<property>
- <name>sling:resourceType</name>
-
<value>org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0</value>
- <type>String</type>
-</property>
+ <name>hello-v1</name>
+ <primaryNodeType>nt:unstructured</primaryNodeType>
+ <property>
+ <name>sling:resourceType</name>
+
<value>org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0</value>
+ <type>String</type>
+ </property>
</node>
<node>
-<name>precompiled-hello-v2</name>
-<primaryNodeType>nt:unstructured</primaryNodeType>
-<property>
- <name>sling:resourceType</name>
-
<value>org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0</value>
- <type>String</type>
-</property>
+ <name>hello-v2</name>
+ <primaryNodeType>nt:unstructured</primaryNodeType>
+ <property>
+ <name>sling:resourceType</name>
+
<value>org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0</value>
+ <type>String</type>
+ </property>
</node>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/h.html
index 2828056..f862c0c 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello'}"></span>
+<span id="h-precompiled-1" data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html
index 48bd769..3b17a42 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html
@@ -16,5 +16,5 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>We're testing some serious scripting here</h2>
-<span data-sly-resource="${ @ selectors='h'}"></span> <span
data-sly-resource="${ @ selectors='w'}"></span>
+<h2>${resource.resourceType}</h2>
+<sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/w.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/w.html
index 1019aca..5605695 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/w.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World'}"></span>
+<span id="w-precompiled-1" data-rt="${resource.resourceType}">World</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
index cf193e9..90286b0 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello2'}"></span>
+<span id="h-precompiled-2" data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/hello.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/hello.html
index 670e2cd..efc73e3 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/hello.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/hello.html
@@ -16,6 +16,8 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>We're testing some serious scripting here in Version 2</h2>
-<span data-sly-resource="${ @ selectors='h'}"></span> <span
data-sly-resource="${ @ selectors='w'}"></span>
-<div
data-sly-use.slingSettings="org.apache.sling.settings.SlingSettingsService">${slingSettings.slingId}</div>
+<h2>${resource.resourceType}</h2>
+<sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
+<div
data-sly-use.slingSettings="org.apache.sling.settings.SlingSettingsService"
+ data-sly-test.slingId="${slingSettings.slingId}"
+ id="sling-id">${slingId}</div>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/w.html
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/w.html
index 3c6b564..31f67e5 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/w.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+<span id="w-precompiled-2" data-rt="${resource.resourceType}">World</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hi/1.0.0/extends
b/examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hi/1.0.0/extends
deleted file mode 100644
index e643344..0000000
---
a/examples/org-apache-sling-scripting-examplebundle.hi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hi/1.0.0/extends
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.sling.scripting.examplebundle.hello;version=[1.0.0,2.0.0)
diff --git
a/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.ohhi/1.0.0/extends
b/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.ohhi/1.0.0/extends
deleted file mode 100644
index 82d3d77..0000000
---
a/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.ohhi/1.0.0/extends
+++ /dev/null
@@ -1 +0,0 @@
-org.apache.sling.scripting.examplebundle.hi;version=[1.0.0,2.0.0)
diff --git
a/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.ohhi/1.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.ohhi/1.0.0/h.html
deleted file mode 100644
index f449239..0000000
---
a/examples/org-apache-sling-scripting-examplebundle.ohhi/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.ohhi/1.0.0/h.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-Ohhi
diff --git a/examples/org-apache-sling-scripting-examplebundle/pom.xml
b/examples/org-apache-sling-scripting-examplebundle/pom.xml
index 8de70fa..0cbc35f 100644
--- a/examples/org-apache-sling-scripting-examplebundle/pom.xml
+++ b/examples/org-apache-sling-scripting-examplebundle/pom.xml
@@ -65,7 +65,7 @@
${org.apache.sling.scriptingbundle.maven.plugin.Require-Capability}
</Require-Capability>
<Sling-Initial-Content>
-
SLING-INF/content;overwrite:=true;path:=/content/srr/examples
+
SLING-INF/content;overwrite:=true;path:=/content/bundled-scripts/examplebundle
</Sling-Initial-Content>
<_plugin>org.apache.sling.bnd.models.ModelsScannerPlugin</_plugin>
</instructions>
@@ -110,6 +110,12 @@
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-annotation_1.3_spec</artifactId>
+ <version>1.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/example.xml
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/examplebundle.xml
similarity index 89%
rename from
examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/example.xml
rename to
examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/examplebundle.xml
index 49524b6..a8c040a 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/example.xml
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/SLING-INF/content/examplebundle.xml
@@ -45,6 +45,15 @@
</property>
</node>
<node>
+ <name>apps-hello</name>
+ <primaryNodeType>nt:unstructured</primaryNodeType>
+ <property>
+ <name>sling:resourceType</name>
+ <value>sling/scripting/examplebundle/hello</value>
+ <type>String</type>
+ </property>
+</node>
+<node>
<name>script-matching</name>
<primaryNodeType>nt:unstructured</primaryNodeType>
<property>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/h.html
similarity index 92%
copy from
examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
copy to
examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/h.html
index cf193e9..9a931c1 100644
---
a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello2'}"></span>
+<span id="h-examplebundle-hello"
data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/hello.html
similarity index 90%
copy from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
copy to
examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/hello.html
index 3c6b564..3b17a42 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/hello.html
@@ -16,4 +16,5 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+<h2>${resource.resourceType}</h2>
+<sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
diff --git
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/w.html
similarity index 92%
rename from
examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
rename to
examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/w.html
index 3c6b564..1a166d5 100644
---
a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/assr/scripts/hello/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/w.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+<span id="w-examplebundle-hello"
data-rt="${resource.resourceType}">World</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/h.html
index 2828056..33dc1c6 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello'}"></span>
+<span id="h-1" data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/hello.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/hello.html
index 48bd769..3b17a42 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/hello.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/hello.html
@@ -16,5 +16,5 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>We're testing some serious scripting here</h2>
-<span data-sly-resource="${ @ selectors='h'}"></span> <span
data-sly-resource="${ @ selectors='w'}"></span>
+<h2>${resource.resourceType}</h2>
+<sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/w.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/w.html
index 1019aca..f2edc89 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/w.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World'}"></span>
+<span id="w-1" data-rt="${resource.resourceType}">World</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/h.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/h.html
index cf193e9..e4b62b7 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/h.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/h.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'Hello2'}"></span>
+<span id="h-2" data-rt="${resource.resourceType}">Hello</span>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/hello.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/hello.html
index 7840f51..3b17a42 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/hello.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/hello.html
@@ -16,5 +16,5 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>We're testing some serious scripting here in Version 2</h2>
-<span data-sly-resource="${ @ selectors='h'}"></span> <span
data-sly-resource="${ @ selectors='w'}"></span>
+<h2>${resource.resourceType}</h2>
+<sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
diff --git
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/w.html
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/w.html
index 3c6b564..eef60c8 100644
---
a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/w.html
+++
b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/w.html
@@ -16,4 +16,4 @@
~ specific language governing permissions and limitations
~ under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span data-sly-text="${'World2'}"></span>
+<span id="w-2" data-rt="${resource.resourceType}">World</span>
diff --git a/it/pom.xml b/it/pom.xml
index 3809dc4..9ab7e61 100644
--- a/it/pom.xml
+++ b/it/pom.xml
@@ -178,13 +178,19 @@
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.bundle.tracker</artifactId>
<version>0.1.1-SNAPSHOT</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.compiler</artifactId>
<version>2.3.7-SNAPSHOT</version>
- <scope>provided</scope>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.scripting.jsp</artifactId>
+ <version>2.5.0-SNAPSHOT</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
@@ -230,25 +236,31 @@
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
-
<artifactId>org.apache.sling.scripting.examplebundle.precompiled</artifactId>
+
<artifactId>org.apache.sling.scripting.examplebundle.classic</artifactId>
<version>0.1.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
-
<artifactId>org.apache.sling.scripting.examplebundle.classic</artifactId>
+
<artifactId>org.apache.sling.scripting.examplebundle.extend1</artifactId>
+ <version>0.1.1-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+
<artifactId>org.apache.sling.scripting.examplebundle.extend2</artifactId>
<version>0.1.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
-
<artifactId>org.apache.sling.scripting.examplebundle.hi</artifactId>
+
<artifactId>org.apache.sling.scripting.examplebundle.precompiled</artifactId>
<version>0.1.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
-
<artifactId>org.apache.sling.scripting.examplebundle.ohhi</artifactId>
+
<artifactId>org.apache.sling.scripting.examplebundle.precompiled.jsp</artifactId>
<version>0.1.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
@@ -259,14 +271,13 @@
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.junit.teleporter</artifactId>
- <version>1.0.18</version>
+ <artifactId>org.apache.sling.testing.clients</artifactId>
+ <version>1.2.6</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.testing.clients</artifactId>
- <version>1.2.6</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git
a/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java
b/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java
deleted file mode 100644
index c45abe3..0000000
---
a/it/src/test/java/org/apache/sling/junit/teleporter/customizers/ITCustomizer.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.junit.teleporter.customizers;
-
-import org.apache.sling.junit.rules.TeleporterRule;
-import org.apache.sling.testing.teleporter.client.ClientSideTeleporter;
-
-public class ITCustomizer implements TeleporterRule.Customizer {
-
- public static final String BASE_URL_PROP = "launchpad.http.server.url";
-
- @Override
- public void customize(TeleporterRule t, String options) {
- final ClientSideTeleporter cst = (ClientSideTeleporter)t;
- cst.setBaseUrl(System.getProperty(BASE_URL_PROP, BASE_URL_PROP +
"_IS_NOT_SET"));
- cst.setServerCredentials("admin", "admin");
-
cst.includeDependencyPrefix("org.apache.sling.scripting.bundle.tracker.it");
- cst.includeDependencyPrefix("org.apache.sling.testing");
- cst.setTestReadyTimeoutSeconds(20);
- }
-}
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/AbstractEndpointTestBase.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/AbstractEndpointTestBase.java
index 5c45592..1e60174 100644
---
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/AbstractEndpointTestBase.java
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/AbstractEndpointTestBase.java
@@ -38,7 +38,6 @@ import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.methods.HttpTrace;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.utils.URIBuilder;
-import org.apache.sling.junit.teleporter.customizers.ITCustomizer;
import org.apache.sling.testing.clients.SlingHttpResponse;
import org.apache.sling.testing.junit.rules.SlingInstanceRule;
import org.jsoup.Jsoup;
@@ -51,6 +50,8 @@ public abstract class AbstractEndpointTestBase {
protected int contentFindTimeout = 3000;
protected int contentFindRetryDelay = 1000;
+ protected static final String BASE = "/content/bundled-scripts";
+ protected static final String DATA_RT_ATTRIBUTE = "data-rt";
@ClassRule
public static final SlingInstanceRule SLING_INSTANCE_RULE = new
SlingInstanceRule();
@@ -82,8 +83,7 @@ public abstract class AbstractEndpointTestBase {
if (document == null) {
SlingHttpResponse response = getResponse(httpMethod, url);
document = Jsoup.parse(response.getContent(),
- System.getProperty(ITCustomizer.BASE_URL_PROP,
ITCustomizer.BASE_URL_PROP +
- "_IS_NOT_SET"));
+ System.getProperty("launchpad.http.server.url",
"launchpad.http.server.url IS_NOT_SET"));
documentMap.put(httpMethod + ":" + uri.toString(), document);
}
return document;
@@ -104,7 +104,7 @@ public abstract class AbstractEndpointTestBase {
protected HttpUriRequest prepareRequest(String method, String url,
NameValuePair... parameters) throws URISyntaxException {
HttpRequestBase request = null;
URIBuilder uriBuilder =
- new URIBuilder(System.getProperty(ITCustomizer.BASE_URL_PROP,
ITCustomizer.BASE_URL_PROP + "_IS_NOT_SET") + url);
+ new URIBuilder(System.getProperty("launchpad.http.server.url",
"launchpad.http.server.url IS_NOT_SET") + url);
uriBuilder.setParameters(parameters);
switch (method) {
case HttpGet.METHOD_NAME:
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/BundledScriptTrackerIT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/BundledScriptTrackerIT.java
deleted file mode 100644
index 40d5a2e..0000000
---
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/BundledScriptTrackerIT.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.scripting.bundle.tracker.it;
-
-import javax.servlet.Servlet;
-
-import org.apache.sling.junit.rules.TeleporterRule;
-import org.apache.sling.testing.clients.util.poller.Polling;
-import org.junit.ClassRule;
-import org.junit.Rule;
-import org.junit.Test;
-
-public class BundledScriptTrackerIT {
-
- @ClassRule
- public static final LaunchpadReadyRule LAUNCHPAD_READY_RULE = new
LaunchpadReadyRule(Integer.getInteger("launchpad.http.server.port",
- 8080));
-
- @Rule
- public TeleporterRule teleporter = TeleporterRule.forClass(getClass(),
"IT");
-
- @Test
- public void testSlingServletForResourceTypeProvided() throws Exception {
- waitForService(Servlet.class, String.format("(%s=%s)",
"sling.servlet.resourceTypes", "org.apache.sling.scripting" +
- ".examplebundle.hello/1.0.0"), 20000, 1000);
- waitForService(Servlet.class, String.format("(%s=%s)",
"sling.servlet.resourceTypes", "org.apache.sling.scripting" +
- ".examplebundle.hello/2.0.0"), 20000, 1000);
- waitForService(Servlet.class, String.format("(%s=%s)",
"sling.servlet.resourceTypes", "org.apache.sling.scripting" +
- ".examplebundle.hello"), 20000, 1000);
- waitForService(Servlet.class, String.format("(%s=%s)",
"sling.servlet.resourceTypes", "org.apache.sling.scripting" +
- ".examplebundle.hi/1.0.0"), 20000, 1000);
- waitForService(Servlet.class, String.format("(%s=%s)",
"sling.servlet.resourceTypes", "org.apache.sling.scripting" +
- ".examplebundle.hi"), 20000, 1000);
- waitForService(Servlet.class, String.format("(%s=%s)",
"sling.servlet.resourceTypes", "org.apache.sling.scripting" +
- ".examplebundle.scriptmatching/1.0.0"), 20000, 1000);
- waitForService(Servlet.class, String.format("(%s=%s)",
"sling.servlet.resourceTypes", "org.apache.sling.scripting" +
- ".examplebundle.scriptmatching"), 20000, 1000);
- }
-
- private void waitForService(Class serviceClass, String filter, long
waitTime, long retryAfter)
- throws Exception {
- Polling p = new Polling() {
- @Override
- public Boolean call() {
- return teleporter.getService(serviceClass, filter) != null;
- }
-
- @Override
- protected String message() {
- return "Cannot obtain a reference to service " +
serviceClass.getName() + " with filter " + filter + " after %1$d ms";
- }
- };
- p.poll(waitTime, retryAfter);
- }
-}
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/EndpointIT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/EndpointIT.java
deleted file mode 100644
index 002e7a0..0000000
---
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/EndpointIT.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sling.scripting.bundle.tracker.it;
-
-import org.jsoup.nodes.Document;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class EndpointIT extends AbstractEndpointTestBase {
-
- @Test
- public void testHelloEndpoint() throws Exception {
- Document document = getDocument("/content/srr/examples/hello.html");
- Assert.assertEquals("We're testing some serious scripting here in
Version 2", document.select("h2").html());
- Assert.assertTrue(document.body().html().contains("World2"));
- Assert.assertTrue(document.body().html().contains("Hello2"));
- }
-
- @Test
- public void testPrecompiledHelloEndpoint() throws Exception {
- Document document =
getDocument("/content/srr/examples/precompiled-hello.html");
- Assert.assertEquals("We're testing some serious scripting here in
Version 2", document.select("h2").html());
- Assert.assertTrue(document.body().html().contains("World2"));
- Assert.assertTrue(document.body().html().contains("Hello2"));
- }
-
- @Test
- public void testHelloEndpointV1() throws Exception {
- Document document = getDocument("content/srr/examples/hello-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("Hello"));
- }
-
- @Test
- public void testPrecompiledHelloEndpointV1() throws Exception {
- Document document =
getDocument("content/srr/examples/precompiled-hello-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("Hello"));
- }
-
- @Test
- public void testHelloEndpointV2() throws Exception {
- Document document = getDocument("content/srr/examples/hello-v2.html");
- Assert.assertEquals("We're testing some serious scripting here in
Version 2", document.select("h2").html());
- Assert.assertTrue(document.body().html().contains("World2"));
- Assert.assertTrue(document.body().html().contains("Hello2"));
- }
-
- @Test
- public void testPrecompiledHelloEndpointV2() throws Exception {
- Document document =
getDocument("content/srr/examples/precompiled-hello-v2.html");
- Assert.assertEquals("We're testing some serious scripting here in
Version 2", document.select("h2").html());
- Assert.assertTrue(document.body().html().contains("World2"));
- Assert.assertTrue(document.body().html().contains("Hello2"));
- }
-
- @Test
- public void testHiEndpoint() throws Exception {
- Document document = getDocument("content/srr/examples/hi.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("Hallo"));
- Assert.assertFalse(document.body().html().contains("Hello"));
- }
-
- @Test
- public void testHiEndpointV1() throws Exception {
- Document document = getDocument("content/srr/examples/hi-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("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/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleClassicIT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleClassicIT.java
new file mode 100644
index 0000000..ad63268
--- /dev/null
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleClassicIT.java
@@ -0,0 +1,47 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.scripting.bundle.tracker.it;
+
+import org.jsoup.nodes.Document;
+import org.jsoup.select.Elements;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleBundleClassicIT extends AbstractEndpointTestBase {
+
+ private static final String ROOT = BASE + "/examplebundle-classic";
+
+ @Test
+ public void testHello() throws Exception {
+ final String expectedRT =
"sling/scripting/examplebundle-classic/hello";
+ Document document = getDocument(ROOT + "/hello.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-classic");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-classic");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+}
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend1IT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend1IT.java
new file mode 100644
index 0000000..45d9b98
--- /dev/null
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend1IT.java
@@ -0,0 +1,68 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.scripting.bundle.tracker.it;
+
+import org.jsoup.nodes.Document;
+import org.jsoup.select.Elements;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleBundleExtend1IT extends AbstractEndpointTestBase {
+
+ private static final String ROOT = BASE + "/examplebundle-extend1";
+
+ @Test
+ public void testHello() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0";
+
+ Document document = getDocument(ROOT + "/hello.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-extend1");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-1");
+ assertEquals("The w.html script should have been provided by
org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0", 1
+ , w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testHelloV1() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.extend1.hello/1.0.0";
+
+ Document document = getDocument(ROOT + "/hello-v1.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-extend1");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-1");
+ assertEquals("The w.html script should have been provided by
org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0", 1
+ , w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+}
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
new file mode 100644
index 0000000..b747f56
--- /dev/null
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java
@@ -0,0 +1,106 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.scripting.bundle.tracker.it;
+
+import org.jsoup.nodes.Document;
+import org.jsoup.select.Elements;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleBundleExtend2IT extends AbstractEndpointTestBase {
+
+ private static final String ROOT = BASE + "/examplebundle-extend2";
+
+ @Test
+ public void testOne() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.extend2.one/1.0.0";
+
+ Document document = getDocument(ROOT + "/one.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-extend2-one");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-1");
+ assertEquals("The w.html script should have been provided by
org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0", 1
+ , w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testOneV1() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.extend2.one/1.0.0";
+
+ Document document = getDocument(ROOT + "/one-v1.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-extend2-one");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-1");
+ assertEquals("The w.html script should have been provided by
org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0", 1
+ , w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testTwo() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.extend2.two/1.0.0";
+
+ Document document = getDocument(ROOT + "/two.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-extend2-two");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-1");
+ assertEquals("The w.html script should have been provided by
org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0", 1
+ , w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testTwoV1() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.extend2.two/1.0.0";
+
+ Document document = getDocument(ROOT + "/two-v1.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-extend2-two");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-1");
+ assertEquals("The w.html script should have been provided by
org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0", 1
+ , w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+}
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleIT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleIT.java
new file mode 100644
index 0000000..c5edfd0
--- /dev/null
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleIT.java
@@ -0,0 +1,98 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.scripting.bundle.tracker.it;
+
+import org.jsoup.nodes.Document;
+import org.jsoup.select.Elements;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleBundleIT extends AbstractEndpointTestBase {
+
+ private static final String ROOT = BASE + "/examplebundle";
+
+ @Test
+ public void testHello() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.hello/2.0.0";
+ Document document = getDocument(ROOT + "/hello.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-2");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-2");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testHelloV2() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.hello/2.0.0";
+ Document document = getDocument(ROOT + "/hello-v2.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-2");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-2");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testHelloV1() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.hello/1.0.0";
+ Document document = getDocument(ROOT + "/hello-v1.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-1");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-1");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testAppsHello() throws Exception {
+ final String expectedRT = "sling/scripting/examplebundle/hello";
+ Document document = getDocument(ROOT + "/apps-hello.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-examplebundle-hello");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-examplebundle-hello");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+}
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundlePrecompiledIT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundlePrecompiledIT.java
new file mode 100644
index 0000000..c248cf8
--- /dev/null
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundlePrecompiledIT.java
@@ -0,0 +1,81 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.scripting.bundle.tracker.it;
+
+import org.jsoup.nodes.Document;
+import org.jsoup.select.Elements;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleBundlePrecompiledIT extends AbstractEndpointTestBase {
+
+ private static final String ROOT = BASE + "/examplebundle-precompiled";
+
+ @Test
+ public void testHello() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0";
+ Document document = getDocument(ROOT + "/hello.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-precompiled-2");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-2");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testHelloV2() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0";
+ Document document = getDocument(ROOT + "/hello-v2.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-precompiled-2");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-2");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+ @Test
+ public void testHelloV1() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0";
+ Document document = getDocument(ROOT + "/hello-v1.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-precompiled-1");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-1");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+}
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundlePrecompiledJSPIT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundlePrecompiledJSPIT.java
new file mode 100644
index 0000000..be0a1e9
--- /dev/null
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundlePrecompiledJSPIT.java
@@ -0,0 +1,48 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.scripting.bundle.tracker.it;
+
+import org.jsoup.nodes.Document;
+import org.jsoup.select.Elements;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class ExampleBundlePrecompiledJSPIT extends AbstractEndpointTestBase {
+
+ private static final String ROOT = BASE + "/examplebundle-precompiled-jsp";
+
+ @Test
+ public void testHello() throws Exception {
+ final String expectedRT =
"org.apache.sling.scripting.examplebundle.precompiled.jsp.hello";
+ Document document = getDocument(ROOT + "/hello.html");
+ assertEquals(expectedRT, document.select("h2").html());
+
+ Elements h = document.select("#h-precompiled-jsp");
+ assertEquals("Resource based servlet resolution failed.", 1, h.size());
+ assertEquals("Hello", h.html());
+ assertEquals(expectedRT, h.attr(DATA_RT_ATTRIBUTE));
+
+ Elements w = document.select("#w-precompiled-jsp");
+ assertEquals("Resource based servlet resolution failed.", 1, w.size());
+ assertEquals("World", w.html());
+ assertEquals(expectedRT, w.attr(DATA_RT_ATTRIBUTE));
+ }
+
+}
diff --git
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ScriptMatchIT.java
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ScriptMatchIT.java
index 43e9a0a..f3c78a6 100644
---
a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ScriptMatchIT.java
+++
b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ScriptMatchIT.java
@@ -36,20 +36,22 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class ScriptMatchIT extends AbstractEndpointTestBase {
+
+ private static final String SCRIPT_MATCHING_BASE = BASE +
"/examplebundle/script-matching";
@Test
public void testGETMethodMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.html",
HttpGet.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE + ".html",
HttpGet.METHOD_NAME);
}
@Test
public void testGETMethodSelectorMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.selector-1.html",
HttpGet.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE +
".selector-1.html", HttpGet.METHOD_NAME);
}
@Test
public void testHEADMethodMatching() throws Exception {
- HttpResponse response = getResponse(HttpHead.METHOD_NAME,
"/content/srr/examples/script-matching.html");
+ HttpResponse response = getResponse(HttpHead.METHOD_NAME,
SCRIPT_MATCHING_BASE + ".html");
Header[] header = response.getHeaders("X-Script-Name");
assertEquals("Expected to find one X-Script-Name header.", 1,
header.length);
assertEquals("/javax.script/org.apache.sling.scripting.examplebundle.scriptmatching/1.0.0/HEAD.html",
header[0].getValue());
@@ -57,7 +59,7 @@ public class ScriptMatchIT extends AbstractEndpointTestBase {
@Test
public void testHEADMethodSelectorMatching() throws Exception {
- HttpResponse response = getResponse(HttpHead.METHOD_NAME,
"/content/srr/examples/script-matching.selector-1.html");
+ HttpResponse response = getResponse(HttpHead.METHOD_NAME,
SCRIPT_MATCHING_BASE + ".selector-1.html");
Header[] header = response.getHeaders("X-Script-Name");
assertEquals("Expected to find one X-Script-Name header.", 1,
header.length);
assertEquals("/javax.script/org.apache.sling.scripting.examplebundle.scriptmatching/1.0.0/selector-1.HEAD.html",
@@ -66,67 +68,67 @@ public class ScriptMatchIT extends AbstractEndpointTestBase
{
@Test
public void testOPTIONSMethodMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.html",
HttpOptions.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE + ".html",
HttpOptions.METHOD_NAME);
}
@Test
public void testOPTIONSMethodSelectorMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.selector-1.html",
HttpOptions.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE +
".selector-1.html", HttpOptions.METHOD_NAME);
}
@Test
public void testPOSTMethodMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.html",
HttpPost.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE + ".html",
HttpPost.METHOD_NAME);
}
@Test
public void testPOSTMethodSelectorMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.selector-1.html",
HttpPost.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE +
".selector-1.html", HttpPost.METHOD_NAME);
}
@Test
public void testPATCHMethodMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.html",
HttpPatch.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE + ".html",
HttpPatch.METHOD_NAME);
}
@Test
public void testPATCHMethodSelectorMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.selector-1.html",
HttpPatch.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE +
".selector-1.html", HttpPatch.METHOD_NAME);
}
@Test
public void testPUTMethodMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.html",
HttpPut.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE + ".html",
HttpPut.METHOD_NAME);
}
@Test
public void testPUTMethodSelectorMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.selector-1.html",
HttpPut.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE +
".selector-1.html", HttpPut.METHOD_NAME);
}
@Test
public void testDELETEMethodMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.html",
HttpDelete.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE + ".html",
HttpDelete.METHOD_NAME);
}
@Test
public void testDELETEMethodSelectorMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.selector-1.html",
HttpDelete.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE +
".selector-1.html", HttpDelete.METHOD_NAME);
}
@Test
public void testTRACEMethodMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.html",
HttpTrace.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE + ".html",
HttpTrace.METHOD_NAME);
}
@Test
public void testTRACEMethodSelectorMatching() throws Exception {
-
testHttpMethodScriptMatching("/content/srr/examples/script-matching.selector-1.html",
HttpTrace.METHOD_NAME);
+ testHttpMethodScriptMatching(SCRIPT_MATCHING_BASE +
".selector-1.html", HttpTrace.METHOD_NAME);
}
@Test
public void testSelectorMatching() throws Exception {
- Document document =
getDocument("/content/srr/examples/script-matching.selector-2.html");
+ Document document = getDocument(SCRIPT_MATCHING_BASE +
".selector-2.html");
assertTrue(document.select("div").html().contains("/javax.script/org.apache.sling.scripting.examplebundle"
+
".scriptmatching/1.0.0/selector-2.html"));
}
diff --git a/it/src/test/provisioning/it-model.txt
b/it/src/test/provisioning/it-model.txt
index 3c73e84..46d445b 100644
--- a/it/src/test/provisioning/it-model.txt
+++ b/it/src/test/provisioning/it-model.txt
@@ -22,6 +22,7 @@
# Dependencies
[artifacts]
org.apache.sling/org.apache.sling.starter/12-SNAPSHOT/slingstart
+ org.apache.sling/org.apache.sling.scripting.jsp
org.apache.sling/org.apache.sling.scripting.sightly
org.apache.sling/org.apache.sling.scripting.sightly.runtime
org.apache.sling/org.apache.sling.scripting.sightly.compiler
@@ -29,10 +30,11 @@
org.apache.sling/org.apache.sling.commons.compiler
org.apache.sling/org.apache.sling.scripting.bundle.tracker
org.apache.sling/org.apache.sling.scripting.examplebundle
- 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.scripting.examplebundle.extend1
+ org.apache.sling/org.apache.sling.scripting.examplebundle.extend2
+ org.apache.sling/org.apache.sling.scripting.examplebundle.precompiled
+ org.apache.sling/org.apache.sling.scripting.examplebundle.precompiled.jsp
org.apache.sling/org.apache.sling.junit.core/1.0.26
[configurations]
diff --git a/pom.xml b/pom.xml
index b2a8202..5971074 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,10 +34,11 @@
<modules>
<module>examples/org-apache-sling-scripting-examplebundle</module>
-
<module>examples/org-apache-sling-scripting-examplebundle-precompiled</module>
<module>examples/org-apache-sling-scripting-examplebundle-classic</module>
- <module>examples/org-apache-sling-scripting-examplebundle.hi</module>
- <module>examples/org-apache-sling-scripting-examplebundle.ohhi</module>
+
<module>examples/org-apache-sling-scripting-examplebundle-extend1</module>
+
<module>examples/org-apache-sling-scripting-examplebundle-extend2</module>
+
<module>examples/org-apache-sling-scripting-examplebundle-precompiled</module>
+
<module>examples/org-apache-sling-scripting-examplebundle-precompiled-jsp</module>
<module>it</module>
</modules>