Author: rombert
Date: Mon May 26 11:41:31 2014
New Revision: 1597565

URL: http://svn.apache.org/r1597565
Log:
SLING-3586 - Publishing content fails if intermediate nodes are not
present in the repository

Added ProjectAdapter.createVltFilterWithRoots

Removed:
    
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/filter-only-content-test-root-en.xml
Modified:
    
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
    
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
    
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ProjectUtilTest.java
    
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/ProjectAdapter.java

Modified: 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java?rev=1597565&r1=1597564&r2=1597565&view=diff
==============================================================================
--- 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
 (original)
+++ 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ContentImportTest.java
 Mon May 26 11:41:31 2014
@@ -75,12 +75,10 @@ public class ContentImportTest {
         ServerAdapter server = new ServerAdapter(wstServer.getServer());
         server.installModule(contentProject);
 
+        project.createVltFilterWithRoots("/content/test-root/en");
         
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
                 new ByteArrayInputStream("hello, world".getBytes()));
 
-        
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
 getClass()
-                .getResourceAsStream("filter-only-content-test-root-en.xml"));
-
         // create server-side content
         RepositoryAccessor repo = new RepositoryAccessor(config);
         repo.createNode("/content/test-root/en", "nt:folder");
@@ -111,12 +109,10 @@ public class ContentImportTest {
         ServerAdapter server = new ServerAdapter(wstServer.getServer());
         server.installModule(contentProject);
 
+        project.createVltFilterWithRoots("/content/test-root/en");
         
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en/hello.txt"),
                 new ByteArrayInputStream("hello, world".getBytes()));
 
-        
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
 getClass()
-                .getResourceAsStream("filter-only-content-test-root-en.xml"));
-
         // create server-side content
         RepositoryAccessor repo = new RepositoryAccessor(config);
         repo.createNode("/content/test-root/de", "nt:folder");
@@ -146,9 +142,7 @@ public class ContentImportTest {
         ServerAdapter server = new ServerAdapter(wstServer.getServer());
         server.installModule(contentProject);
 
-        
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
 getClass()
-                .getResourceAsStream("filter-only-content-test-root-en.xml"));
-
+        project.createVltFilterWithRoots("/content/test-root/en");
         
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/.vltignore"),
                 new ByteArrayInputStream("en\n".getBytes()));
 
@@ -181,12 +175,10 @@ public class ContentImportTest {
         ServerAdapter server = new ServerAdapter(wstServer.getServer());
         server.installModule(contentProject);
 
+        project.createVltFilterWithRoots("/content/test-root/en");
         
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/hello.txt"),
 new ByteArrayInputStream(
                 "hello, world".getBytes()));
 
-        
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
 getClass()
-                .getResourceAsStream("filter-only-content-test-root-en.xml"));
-
         
project.createOrUpdateFile(Path.fromPortableString("jcr_root/.vltignore"), new 
ByteArrayInputStream(
                 "content/test-root/en\n".getBytes()));
 

Modified: 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java?rev=1597565&r1=1597564&r2=1597565&view=diff
==============================================================================
--- 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
 (original)
+++ 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java
 Mon May 26 11:41:31 2014
@@ -280,9 +280,7 @@ public class JcrFullCoverageAggregatesDe
         repo.createNode("/content", "sling:Folder");
         repo.createNode("/content/test-root", "sling:Folder");
 
-        // create filter.xml
-        InputStream filterXml = 
getClass().getResourceAsStream("filter-only-content-test-root-en.xml");
-        
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
 filterXml);
+        project.createVltFilterWithRoots("/content/test-root/en");
 
         // create .content.xml structure
         InputStream contentXml = 
getClass().getResourceAsStream("content-nested-structure.xml");

Modified: 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ProjectUtilTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ProjectUtilTest.java?rev=1597565&r1=1597564&r2=1597565&view=diff
==============================================================================
--- 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ProjectUtilTest.java
 (original)
+++ 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/ProjectUtilTest.java
 Mon May 26 11:41:31 2014
@@ -48,11 +48,10 @@ public class ProjectUtilTest {
         // install bundle facet
         project.installFacet("sling.content", "1.0");
 
+        project.createVltFilterWithRoots();
         
project.createOrUpdateFile(Path.fromPortableString("jcr_root/test/hello.txt"), 
new ByteArrayInputStream(
                 "goodbye, world".getBytes()));
 
-        
project.createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"),
 new ByteArrayInputStream(
-                "<workspaceFilter version=\"1.0\"/>".getBytes()));
 
         IPath filterPath = ProjectUtil.findFilterPath(contentProject);
         assertThat("filterPath.absolute", filterPath.isAbsolute(), 
equalTo(true));

Modified: 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/ProjectAdapter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/ProjectAdapter.java?rev=1597565&r1=1597564&r2=1597565&view=diff
==============================================================================
--- 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/ProjectAdapter.java
 (original)
+++ 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/helpers/ProjectAdapter.java
 Mon May 26 11:41:31 2014
@@ -160,6 +160,19 @@ public class ProjectAdapter {
 
     }
 
+    public void createVltFilterWithRoots(String... roots) throws CoreException 
{
+
+        StringBuilder builder = new StringBuilder();
+        builder.append("<workspaceFilter vesion=\"1.0\">\n");
+        for (String root : roots) {
+            builder.append("  <filter root=\"").append(root).append("\"/>\n");
+        }
+        builder.append("</workspaceFilter>\n");
+
+        
createOrUpdateFile(Path.fromPortableString("META-INF/vault/filter.xml"), new 
ByteArrayInputStream(builder
+                .toString().getBytes()));
+    }
+
     public void createOsgiBundleManifest(OsgiBundleManifest osgiManifest) 
throws CoreException, IOException {
 
         Manifest m = new Manifest();


Reply via email to