incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r947709 - in /sling/trunk/bundles/servlets/resolver/src: main/java/org/apache/sling/servlets/resolver/internal/ test/java/org/apache/sling/servlets/resolver/internal/ test/java/org/apache/sling/servlets/resolver/internal/helper/
Date Mon, 24 May 2010 16:38:19 GMT
Author: cziegeler
Date: Mon May 24 16:38:19 2010
New Revision: 947709

URL: http://svn.apache.org/viewvc?rev=947709&view=rev
Log:
SLING-1446 : Scripts should be resolved against the current workspace - fix test cases and
invocation of error scripts

Modified:
    sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
    sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestAndDefaultSlingServletResolverTest.java
    sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestNoDefaultSlingServletResolverTest.java
    sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ResourceCollectorGetServletsTest.java
    sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ScriptSelectionTest.java

Modified: sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java?rev=947709&r1=947708&r2=947709&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
(original)
+++ sling/trunk/bundles/servlets/resolver/src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java
Mon May 24 16:38:19 2010
@@ -423,7 +423,7 @@ public class SlingServletResolver implem
         tracker.startTimer(timerName);
 
         try {
-            final String wspName = getWorkspaceName(request);
+            final String wspName = (this.useRequestWorkspace ? getWorkspaceName(request)
: null);
 
             // find the error handler component
             Resource resource = getErrorResource(request);
@@ -477,7 +477,7 @@ public class SlingServletResolver implem
         tracker.startTimer(timerName);
 
         try {
-            final String wspName = getWorkspaceName(request);
+            final String wspName = (this.useRequestWorkspace ? getWorkspaceName(request)
: null);
 
             // find the error handler component
             Servlet servlet = null;

Modified: sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestAndDefaultSlingServletResolverTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestAndDefaultSlingServletResolverTest.java?rev=947709&r1=947708&r2=947709&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestAndDefaultSlingServletResolverTest.java
(original)
+++ sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestAndDefaultSlingServletResolverTest.java
Mon May 24 16:38:19 2010
@@ -35,7 +35,7 @@ public class ResolveFromRequestAndDefaul
     }
 
     protected String getRequestWorkspaceName() {
-        return "default";
+        return null;
     }
 
 }

Modified: sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestNoDefaultSlingServletResolverTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestNoDefaultSlingServletResolverTest.java?rev=947709&r1=947708&r2=947709&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestNoDefaultSlingServletResolverTest.java
(original)
+++ sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/ResolveFromRequestNoDefaultSlingServletResolverTest.java
Mon May 24 16:38:19 2010
@@ -32,5 +32,6 @@ public class ResolveFromRequestNoDefault
     @Override
     protected void configureComponentContext(MockComponentContext mockComponentContext) {
         mockComponentContext.setProperty(SlingServletResolver.PROP_USE_REQUEST_WORKSPACE,
"true");
+        mockComponentContext.setProperty(SlingServletResolver.PROP_USE_DEFAULT_WORKSPACE,
"true");
     }
 }

Modified: sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ResourceCollectorGetServletsTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ResourceCollectorGetServletsTest.java?rev=947709&r1=947708&r2=947709&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ResourceCollectorGetServletsTest.java
(original)
+++ sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ResourceCollectorGetServletsTest.java
Mon May 24 16:38:19 2010
@@ -154,7 +154,7 @@ public class ResourceCollectorGetServlet
             pathMap.put(name, path);
         }
 
-        ResourceCollector lu = ResourceCollector.create(request, "default", null);
+        ResourceCollector lu = ResourceCollector.create(request, null, null);
         Collection<Resource> res = lu.getServlets(request.getResource().getResourceResolver());
         Iterator<Resource> rIter = res.iterator();
 

Modified: sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ScriptSelectionTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ScriptSelectionTest.java?rev=947709&r1=947708&r2=947709&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ScriptSelectionTest.java
(original)
+++ sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ScriptSelectionTest.java
Mon May 24 16:38:19 2010
@@ -67,7 +67,7 @@ public class ScriptSelectionTest extends
 
         // Create mock request and get scripts from ResourceCollector
         final MockSlingHttpServletRequest req = makeRequest(method, selectors, extension);
-        final ResourceCollector u = ResourceCollector.create(req, "default", null);
+        final ResourceCollector u = ResourceCollector.create(req, null, null);
         final Collection<Resource> s = u.getServlets(req.getResource().getResourceResolver());
 
         if(expectedScript == null) {



Mime
View raw message