SLING-9335 - Capabilities based on the extends file should be merged with capabilities based on resource label scripts

* added a main script for org.apache.sling.scripting.examplebundle.extend2.two,
which also extends org.apache.sling.scripting.examplebundle.extend2.one
* adapted tests
diff --git a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/hello.html b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/hello.html
index 3b17a42..ca61c06 100644
--- a/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/hello.html
+++ b/examples/org-apache-sling-scripting-examplebundle-classic/src/main/resources/SLING-INF/apps/sling/scripting/examplebundle-classic/hello/hello.html
@@ -16,5 +16,5 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${resource.resourceType}</h2>
 <sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
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/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/two.html
similarity index 87%
rename from examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/h.html
rename to examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/two.html
index d380823..ca61c06 100644
--- a/examples/org-apache-sling-scripting-examplebundle-extend2/src/main/resources/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.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/two.html
@@ -16,4 +16,5 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<span id="h-extend2-two" data-rt="${resource.resourceType}">Hello</span>
+<h2 data-script="${javax_script_filename}">${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-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp
index 3bb2653..6c5a969 100644
--- a/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp
+++ b/examples/org-apache-sling-scripting-examplebundle-precompiled-jsp/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp
@@ -18,5 +18,5 @@
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
 <%@page session="false" pageEncoding="utf-8"%>
 <%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.2"%>
-<h2>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${resource.resourceType}</h2>
 <sling:call script="h.jsp"/><sling:call script="w.jsp"/>
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 3b17a42..ca61c06 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>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${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/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 efc73e3..cd588dc 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,7 +16,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${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}"
diff --git a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.pathcaller/pathcaller.html b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.pathcaller/pathcaller.html
index 5216d5f..7b1cfeb 100644
--- a/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.pathcaller/pathcaller.html
+++ b/examples/org-apache-sling-scripting-examplebundle-precompiled/src/main/scripts/org.apache.sling.scripting.examplebundle.precompiled.pathcaller/pathcaller.html
@@ -16,5 +16,5 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${resource.resourceType}</h2>
 <div class="caller" data-sly-include="/apps/org.apache.sling.scripting.examplebundle.precompiled.path/path-script.html"></div>
diff --git a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/hello.html b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/hello.html
index 3b17a42..ca61c06 100644
--- a/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/hello.html
+++ b/examples/org-apache-sling-scripting-examplebundle/src/main/resources/javax.script/apps/sling/scripting/examplebundle/hello/hello.html
@@ -16,5 +16,5 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/-->
-<h2>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${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/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 3b17a42..ca61c06 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>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${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/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 3b17a42..ca61c06 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>${resource.resourceType}</h2>
+<h2 data-script="${javax_script_filename}">${resource.resourceType}</h2>
 <sly data-sly-include="h.html"/> <sly data-sly-include="w.html"/>
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 1e60174..c8bef6b 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
@@ -52,6 +52,7 @@
     protected int contentFindRetryDelay = 1000;
     protected static final String BASE = "/content/bundled-scripts";
     protected static final String DATA_RT_ATTRIBUTE = "data-rt";
+    protected static final String DATA_SCRIPT = "data-script";
 
     @ClassRule
     public static final SlingInstanceRule SLING_INSTANCE_RULE = new SlingInstanceRule();
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
index 45d9b98..350d52a 100644
--- 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
@@ -23,6 +23,7 @@
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class ExampleBundleExtend1IT extends AbstractEndpointTestBase {
 
@@ -33,7 +34,10 @@
         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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__hello.__0031____002e__0__002e__0.hello__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend1");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -52,7 +56,10 @@
         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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__hello.__0031____002e__0__002e__0.hello__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend1");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
diff --git a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java
index 4df7fe5..41f8c96 100644
--- a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java
+++ b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2IT.java
@@ -23,6 +23,7 @@
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class ExampleBundleExtend2IT extends AbstractEndpointTestBase {
 
@@ -33,7 +34,10 @@
         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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__hello.__0031____002e__0__002e__0.hello__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend2-one");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -52,7 +56,10 @@
         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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__hello.__0031____002e__0__002e__0.hello__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend2-one");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -71,9 +78,12 @@
         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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/two.html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
-        Elements h = document.select("#h-extend2-two");
+        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));
@@ -90,9 +100,12 @@
         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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "/javax.script/org.apache.sling.scripting.examplebundle.extend2.two/1.0.0/two.html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
-        Elements h = document.select("#h-extend2-two");
+        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));
@@ -109,7 +122,10 @@
         final String expectedRT = "org.apache.sling.scripting.examplebundle.extend2.three";
 
         Document document = getDocument(ROOT + "/three.html");
-        assertEquals(expectedRT, document.select("h2").html());
+        Elements h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "/javax.script/apps/sling/scripting/examplebundle/hello/hello.html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend2-three");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
diff --git a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2TeleportedIT.java b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2TeleportedIT.java
index 1feccbc..e71d5d2 100644
--- a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2TeleportedIT.java
+++ b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ExampleBundleExtend2TeleportedIT.java
@@ -69,9 +69,9 @@
 
             Set<String> expectedChildren = getChildrenForServletResource(
                     "/apps/" + expectedRT,
-                    "h.html",
-                    "h.html.servlet",
-                    "html.servlet"
+                    "html.servlet",
+                    "two.html",
+                    "two.html.servlet"
             );
             assertEquals(expectedChildren, children.keySet());
 
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
index c5edfd0..330081c 100644
--- 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
@@ -23,6 +23,7 @@
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class ExampleBundleIT extends AbstractEndpointTestBase {
 
@@ -32,7 +33,10 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/hello.html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-2");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -49,7 +53,10 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "/javax.script/org.apache.sling.scripting.examplebundle.hello/2.0.0/hello.html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-2");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -66,7 +73,10 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "/javax.script/org.apache.sling.scripting.examplebundle.hello/1.0.0/hello.html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-1");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -83,7 +93,10 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "/javax.script/apps/sling/scripting/examplebundle/hello/hello.html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-examplebundle-hello");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
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
index 1b8e900..9332566 100644
--- 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
@@ -23,6 +23,7 @@
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class ExampleBundlePrecompiledIT extends AbstractEndpointTestBase {
 
@@ -32,7 +33,10 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__hello.__0032____002e__0__002e__0.hello__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-2");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -49,7 +53,10 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__hello.__0032____002e__0__002e__0.hello__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-2");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -66,7 +73,11 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver =
+                "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__hello.__0031____002e__0__002e__0.hello__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-1");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
@@ -85,7 +96,11 @@
         final String callee = ("apps.org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__path" +
                 ".path__002d__script__002e__html");
         Document document = getDocument(ROOT + "/path-based-servlet.html");
-        assertEquals(expectedRT, document.select("h2").html());
+        Elements h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver =
+                "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__pathcaller.pathcaller__002e__html";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
         assertEquals("Cannot detect callee script which is supposed to be a path based servlet.", callee,
                 document.select("div.caller > span.script").html());
     }
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
index be0a1e9..484d7f0 100644
--- 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
@@ -23,6 +23,7 @@
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 public class ExampleBundlePrecompiledJSPIT extends AbstractEndpointTestBase {
 
@@ -32,7 +33,10 @@
     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 h2 = document.select("h2");
+        assertEquals(expectedRT, h2.html());
+        final String expectedScriptDriver = "org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__jsp__002e__hello.hello__002e__jsp";
+        assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-jsp");
         assertEquals("Resource based servlet resolution failed.", 1, h.size());
diff --git a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ITCustomizer.java b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ITCustomizer.java
index 7b788f8..5e37a35 100644
--- a/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ITCustomizer.java
+++ b/it/src/test/java/org/apache/sling/scripting/bundle/tracker/it/ITCustomizer.java
@@ -34,7 +34,5 @@
         cst.includeDependencyPrefix("org.ops4j.pax.tinybundles");
         cst.includeDependencyPrefix("org.apache.sling.scripting.bundle.tracker.it");
         cst.setTestReadyTimeoutSeconds(20);
-        cst.setPreventToUninstallBundle(true);
-        cst.setEnableLogging(true);
     }
 }