Author: fmeschbe
Date: Tue Jan 27 19:57:48 2009
New Revision: 738205

URL: http://svn.apache.org/viewvc?rev=738205&view=rev
Log:
SLING-843 Remove removal of potential context path prefix and adapt integration 
tests

Modified:
    
incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
    
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/ForwardTest.java
    
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java
    
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java
    
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java

Modified: 
incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java?rev=738205&r1=738204&r2=738205&view=diff
==============================================================================
--- 
incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
 (original)
+++ 
incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/request/SlingRequestDispatcher.java
 Tue Jan 27 19:57:48 2009
@@ -140,11 +140,6 @@
 
         if (resource == null) {
 
-            // the absolute path may have the context path, cut it off
-            if (absPath.startsWith(cRequest.getContextPath())) {
-                absPath = 
absPath.substring(cRequest.getContextPath().length());
-            }
-
             // resolve the absolute path in the resource resolver, using
             // only those parts of the path as if it would be request path
             resource = cRequest.getResourceResolver().resolve(absPath);

Modified: 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/ForwardTest.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/ForwardTest.java?rev=738205&r1=738204&r2=738205&view=diff
==============================================================================
--- 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/ForwardTest.java
 (original)
+++ 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/ForwardTest.java
 Tue Jan 27 19:57:48 2009
@@ -55,16 +55,17 @@
         testTextA = "Text A " + System.currentTimeMillis();
         props.put("text", testTextA);
         nodeUrlA = testClient.createNode(url, props);
+        String pathToInclude = nodeUrlA.substring(HTTP_BASE_URL.length());
 
         // Node B stores the path of A, so that the test script can
         // forward A when rendering B
         testTextB = "Text B " + System.currentTimeMillis();
         props.put("text", testTextB);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlB = testClient.createNode(url, props);
 
         // Node E is like B but with an extension on the forward path
-        props.put("pathToInclude", new URL(nodeUrlA).getPath() + ".html");
+        props.put("pathToInclude", pathToInclude + ".html");
         nodeUrlE = testClient.createNode(url, props);
 
         // Node C is used for the infinite loop detection test
@@ -76,7 +77,7 @@
         forcedResourceType = getClass().getSimpleName() + "/" + 
System.currentTimeMillis();
         props.remove("testInfiniteLoop");
         props.put("forceResourceType", forcedResourceType);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlD = testClient.createNode(url, props);
 
         // Script for forced resource type

Modified: 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java?rev=738205&r1=738204&r2=738205&view=diff
==============================================================================
--- 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java
 (original)
+++ 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/IncludeTest.java
 Tue Jan 27 19:57:48 2009
@@ -54,16 +54,17 @@
         testTextA = "Text A " + System.currentTimeMillis();
         props.put("text", testTextA);
         nodeUrlA = testClient.createNode(url, props);
+        String pathToInclude = nodeUrlA.substring(HTTP_BASE_URL.length());
 
         // Node B stores the path of A, so that the test script can
         // include A when rendering B
         testTextB = "Text B " + System.currentTimeMillis();
         props.put("text", testTextB);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlB = testClient.createNode(url, props);
 
         // Node E is like B but with an extension on the include path
-        props.put("pathToInclude", new URL(nodeUrlA).getPath() + ".html");
+        props.put("pathToInclude", pathToInclude + ".html");
         nodeUrlE = testClient.createNode(url, props);
 
         // Node C is used for the infinite loop detection test
@@ -75,7 +76,7 @@
         final String forcedResourceType = getClass().getSimpleName() + "/" + 
System.currentTimeMillis();
         props.remove("testInfiniteLoop");
         props.put("forceResourceType", forcedResourceType);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlD = testClient.createNode(url, props);
 
         // Script for forced resource type

Modified: 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java?rev=738205&r1=738204&r2=738205&view=diff
==============================================================================
--- 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java
 (original)
+++ 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspForwardTest.java
 Tue Jan 27 19:57:48 2009
@@ -55,16 +55,17 @@
         testTextA = "Text A " + System.currentTimeMillis();
         props.put("text", testTextA);
         nodeUrlA = testClient.createNode(url, props);
+        String pathToInclude = nodeUrlA.substring(HTTP_BASE_URL.length());
 
         // Node B stores the path of A, so that the test script can
         // forward A when rendering B
         testTextB = "Text B " + System.currentTimeMillis();
         props.put("text", testTextB);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlB = testClient.createNode(url, props);
 
         // Node E is like B but with an extension on the forward path
-        props.put("pathToInclude", new URL(nodeUrlA).getPath() + ".html");
+        props.put("pathToInclude", pathToInclude + ".html");
         nodeUrlE = testClient.createNode(url, props);
 
         // Node C is used for the infinite loop detection test
@@ -76,7 +77,7 @@
         forcedResourceType = getClass().getSimpleName() + "/" + 
System.currentTimeMillis();
         props.remove("testInfiniteLoop");
         props.put("forceResourceType", forcedResourceType);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlD = testClient.createNode(url, props);
 
         // Script for forced resource type

Modified: 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java?rev=738205&r1=738204&r2=738205&view=diff
==============================================================================
--- 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java
 (original)
+++ 
incubator/sling/trunk/launchpad/testing/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JspIncludeTest.java
 Tue Jan 27 19:57:48 2009
@@ -55,16 +55,17 @@
         testTextA = "Text A " + System.currentTimeMillis();
         props.put("text", testTextA);
         nodeUrlA = testClient.createNode(url, props);
+        String pathToInclude = nodeUrlA.substring(HTTP_BASE_URL.length());
 
         // Node B stores the path of A, so that the test script can
         // include A when rendering B
         testTextB = "Text B " + System.currentTimeMillis();
         props.put("text", testTextB);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlB = testClient.createNode(url, props);
 
         // Node E is like B but with an extension on the include path
-        props.put("pathToInclude", new URL(nodeUrlA).getPath() + ".html");
+        props.put("pathToInclude", pathToInclude + ".html");
         nodeUrlE = testClient.createNode(url, props);
 
         // Node C is used for the infinite loop detection test
@@ -76,7 +77,7 @@
         forcedResourceType = getClass().getSimpleName() + "/" + 
System.currentTimeMillis();
         props.remove("testInfiniteLoop");
         props.put("forceResourceType", forcedResourceType);
-        props.put("pathToInclude", new URL(nodeUrlA).getPath());
+        props.put("pathToInclude", pathToInclude);
         nodeUrlD = testClient.createNode(url, props);
 
         // Script for forced resource type


Reply via email to