SLING-9406 - Add bundled script support to the servlets resolver

* Update to the latest servlets resolver and adapt the tests to it.
diff --git a/it/pom.xml b/it/pom.xml
index 7635080..2b14190 100644
--- a/it/pom.xml
+++ b/it/pom.xml
@@ -182,8 +182,8 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.scripting.bundle.tracker</artifactId>
-            <version>0.1.1-SNAPSHOT</version>
+            <artifactId>org.apache.sling.servlets.resolver</artifactId>
+            <version>2.6.5-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
         <dependency>
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 350d52a..e593b01 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
@@ -36,7 +36,7 @@
         Document document = getDocument(ROOT + "/hello.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";
+        final String expectedScriptDriver = "org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend1");
@@ -58,7 +58,7 @@
         Document document = getDocument(ROOT + "/hello-v1.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";
+        final String expectedScriptDriver = "org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend1");
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 b808c70..02bffcf 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
@@ -36,7 +36,7 @@
         Document document = getDocument(ROOT + "/one.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";
+        final String expectedScriptDriver = "org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend2-one");
@@ -61,7 +61,7 @@
         Document document = getDocument(ROOT + "/one-v1.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";
+        final String expectedScriptDriver = "org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-extend2-one");
@@ -86,7 +86,7 @@
         Document document = getDocument(ROOT + "/two.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";
+        final String expectedScriptDriver = "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-one");
@@ -126,7 +126,7 @@
         Document document = getDocument(ROOT + "/two-v1.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";
+        final String expectedScriptDriver = "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-one");
@@ -151,7 +151,7 @@
         Document document = getDocument(ROOT + "/three.html");
         Elements h2 = document.select("h2");
         assertEquals(expectedRT, h2.html());
-        final String expectedScriptDriver = "/javax.script/apps/sling/scripting/examplebundle/hello/hello.html";
+        final String expectedScriptDriver = "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");
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 330081c..48f0eef 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
@@ -35,7 +35,7 @@
         Document document = getDocument(ROOT + "/hello.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";
+        final String expectedScriptDriver = "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");
@@ -55,7 +55,7 @@
         Document document = getDocument(ROOT + "/hello-v2.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";
+        final String expectedScriptDriver = "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");
@@ -75,7 +75,7 @@
         Document document = getDocument(ROOT + "/hello-v1.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";
+        final String expectedScriptDriver = "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");
@@ -95,7 +95,7 @@
         Document document = getDocument(ROOT + "/apps-hello.html");
         Elements h2 = document.select("h2");
         assertEquals(expectedRT, h2.html());
-        final String expectedScriptDriver = "/javax.script/apps/sling/scripting/examplebundle/hello/hello.html";
+        final String expectedScriptDriver = "/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");
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 23e3e0c..bd77f9d 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
@@ -35,7 +35,7 @@
         Document document = getDocument(ROOT + "/hello.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";
+        final String expectedScriptDriver = "org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/hello.html";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-2");
@@ -55,7 +55,7 @@
         Document document = getDocument(ROOT + "/hello-v2.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";
+        final String expectedScriptDriver = "org.apache.sling.scripting.examplebundle.precompiled.hello/2.0.0/hello.html";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-2");
@@ -76,7 +76,7 @@
         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";
+                "org.apache.sling.scripting.examplebundle.precompiled.hello/1.0.0/hello.html";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-1");
@@ -96,13 +96,13 @@
     @Test
     public void testPathBasedServlet() throws Exception {
         final String expectedRT = "org.apache.sling.scripting.examplebundle.precompiled.pathcaller";
-        final String callee = ("apps.org__002e__apache__002e__sling__002e__scripting__002e__examplebundle__002e__precompiled__002e__path" +
-                ".path__002d__script__002e__html");
+        final String callee = ("/apps/org.apache.sling.scripting.examplebundle.precompiled.path/" +
+                "path-script.html");
         Document document = getDocument(ROOT + "/path-based-servlet.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";
+                "org.apache.sling.scripting.examplebundle.precompiled.pathcaller/pathcaller.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 00dfc00..f56f5df 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
@@ -35,7 +35,7 @@
         Document document = getDocument(ROOT + "/hello.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";
+        final String expectedScriptDriver = "org.apache.sling.scripting.examplebundle.precompiled.jsp.hello/hello.jsp";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
 
         Elements h = document.select("#h-precompiled-jsp");
@@ -56,7 +56,7 @@
         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__base.html__002e__jsp";
+                "org.apache.sling.scripting.examplebundle.precompiled.jsp.base/html.jsp";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
         Elements selector = document.select("#base-selector");
         assertEquals("Resource based servlet resolution failed.", 1, selector.size());
@@ -71,7 +71,7 @@
         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__base.html__002e__jsp";
+                "org.apache.sling.scripting.examplebundle.precompiled.jsp.base/html.jsp";
         assertTrue(h2.hasAttr(DATA_SCRIPT) && expectedScriptDriver.equals(h2.attr(DATA_SCRIPT)));
         Elements selector = document.select("#extends-selector");
         assertEquals("Resource based servlet resolution failed.", 1, selector.size());
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 f3c78a6..88ee053 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
@@ -54,7 +54,7 @@
         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());
+        assertEquals("org.apache.sling.scripting.examplebundle.scriptmatching/1.0.0/HEAD.html", header[0].getValue());
     }
 
     @Test
@@ -62,7 +62,7 @@
         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",
+        assertEquals("org.apache.sling.scripting.examplebundle.scriptmatching/1.0.0/selector-1.HEAD.html",
                 header[0].getValue());
     }
 
@@ -129,7 +129,7 @@
     @Test
     public void testSelectorMatching() throws Exception {
         Document document = getDocument(SCRIPT_MATCHING_BASE + ".selector-2.html");
-        assertTrue(document.select("div").html().contains("/javax.script/org.apache.sling.scripting.examplebundle" +
+        assertTrue(document.select("div").html().contains("org.apache.sling.scripting.examplebundle" +
                 ".scriptmatching/1.0.0/selector-2.html"));
     }
 
@@ -147,7 +147,7 @@
         } else {
             throw new IllegalArgumentException("The following URL doesn't seem to be correctly handled: " + url);
         }
-        String expectedScriptName = "/javax.script/org.apache.sling.scripting.examplebundle.scriptmatching/1.0.0/" +
+        String expectedScriptName = "org.apache.sling.scripting.examplebundle.scriptmatching/1.0.0/" +
                 (StringUtils.isNotEmpty(selectorString) ? selectorString + "." : "") + httpMethod + "." + extension;
         assertTrue(document.select("div").html().contains(expectedScriptName));
     }
diff --git a/it/src/test/provisioning/it-model.txt b/it/src/test/provisioning/it-model.txt
index 4201a4d..66d2d35 100644
--- a/it/src/test/provisioning/it-model.txt
+++ b/it/src/test/provisioning/it-model.txt
@@ -30,7 +30,7 @@
   org.apache.sling/org.apache.sling.scripting.sightly.compiler.java
   org.apache.sling/org.apache.sling.scripting.sightly.js.provider
   org.apache.sling/org.apache.sling.commons.compiler
-  org.apache.sling/org.apache.sling.scripting.bundle.tracker
+  org.apache.sling/org.apache.sling.servlets.resolver
   org.apache.sling/org.apache.sling.scripting.examplebundle
   org.apache.sling/org.apache.sling.scripting.examplebundle.classic
   org.apache.sling/org.apache.sling.scripting.examplebundle.extend1