Author: justin
Date: Fri Aug 20 15:27:51 2010
New Revision: 987545

URL: http://svn.apache.org/viewvc?rev=987545&view=rev
Log:
SLING-1674 - adding mapped path handling of parent path

Added:
    
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/BundleContentTest.java
    sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/
    
sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/
    
sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/sling/
    
sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/sling/from-bundle/
    
sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/sling/from-bundle/foo.txt
Modified:
    
sling/trunk/bundles/extensions/bundleresource/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
    sling/trunk/launchpad/builder/src/main/bundles/list.xml
    sling/trunk/launchpad/test-services/pom.xml

Modified: 
sling/trunk/bundles/extensions/bundleresource/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/bundleresource/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java?rev=987545&r1=987544&r2=987545&view=diff
==============================================================================
--- 
sling/trunk/bundles/extensions/bundleresource/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
 (original)
+++ 
sling/trunk/bundles/extensions/bundleresource/src/main/java/org/apache/sling/bundleresource/impl/BundleResourceIterator.java
 Fri Aug 20 15:27:51 2010
@@ -75,6 +75,9 @@ class BundleResourceIterator implements 
             this.resourceResolver = parent.getResourceResolver();
             this.bundle = parent.getBundle();
             this.mappedPath = parent.getMappedPath();
+            
+            parentPath = mappedPath.getEntryPath(parentPath);
+            
             this.entries = parent.getBundle().getEntryPaths(parentPath);
             this.prefixLength = parentPath.length();
 

Modified: sling/trunk/launchpad/builder/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/builder/src/main/bundles/list.xml?rev=987545&r1=987544&r2=987545&view=diff
==============================================================================
--- sling/trunk/launchpad/builder/src/main/bundles/list.xml (original)
+++ sling/trunk/launchpad/builder/src/main/bundles/list.xml Fri Aug 20 15:27:51 
2010
@@ -116,7 +116,7 @@
         <bundle>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.bundleresource.impl</artifactId>
-            <version>2.0.4-incubator</version>
+            <version>2.0.5-SNAPSHOT</version>
         </bundle>
         <bundle>
             <groupId>org.apache.sling</groupId>

Added: 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/BundleContentTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/BundleContentTest.java?rev=987545&view=auto
==============================================================================
--- 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/BundleContentTest.java
 (added)
+++ 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/BundleContentTest.java
 Fri Aug 20 15:27:51 2010
@@ -0,0 +1,36 @@
+/*
+ * 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.launchpad.webapp.integrationtest;
+
+import java.io.IOException;
+
+import org.apache.sling.commons.testing.integration.HttpTestBase;
+
+public class BundleContentTest extends HttpTestBase {
+
+    public void testBundleContentRetrieval() throws IOException {
+        final String expected = "This is a text file provided by the bundle 
resource provider.";
+        final String content = getContent(HTTP_BASE_URL + 
"/sling-test/sling/from-bundle/foo.txt", CONTENT_TYPE_PLAIN);
+        assertTrue("Content contains " + expected + " (" + content + ")", 
content.contains(expected));
+    }
+
+    public void testBundleContentList() throws IOException {
+        final String expected = "foo.txt";
+        final String content = getContent(HTTP_BASE_URL + 
"/sling-test/sling/from-bundle.2.json", CONTENT_TYPE_JSON);
+        assertTrue("Content contains " + expected + " (" + content + ")", 
content.contains(expected));
+    }
+}

Modified: sling/trunk/launchpad/test-services/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/pom.xml?rev=987545&r1=987544&r2=987545&view=diff
==============================================================================
--- sling/trunk/launchpad/test-services/pom.xml (original)
+++ sling/trunk/launchpad/test-services/pom.xml Fri Aug 20 15:27:51 2010
@@ -64,6 +64,7 @@
                             SLING-INF/nodetypes/test.cnd
                         </Sling-Nodetypes>
                         
<Sling-Initial-Content>SLING-INF/content;path:=/sling-test</Sling-Initial-Content>
+                        
<Sling-Bundle-Resources>/sling-test/sling/from-bundle;path:=/SLING-INF/res/sling-test/sling/from-bundle</Sling-Bundle-Resources>
                     </instructions>
                 </configuration>
             </plugin>

Added: 
sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/sling/from-bundle/foo.txt
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/sling/from-bundle/foo.txt?rev=987545&view=auto
==============================================================================
--- 
sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/sling/from-bundle/foo.txt
 (added)
+++ 
sling/trunk/launchpad/test-services/src/main/resources/SLING-INF/res/sling-test/sling/from-bundle/foo.txt
 Fri Aug 20 15:27:51 2010
@@ -0,0 +1 @@
+This is a text file provided by the bundle resource provider.
\ No newline at end of file


Reply via email to