Author: rombert
Date: Wed May 21 12:11:02 2014
New Revision: 1596549

URL: http://svn.apache.org/r1596549
Log:
SLING-3591 - Unable to delete all nodes of a full coverage aggregate

Added failing, ignored test.

Added:
    
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/content-nested-structure-deleted-all-nodes.xml
   (with props)
Modified:
    
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/JcrFullCoverageAggregatesDeploymentTest.java

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=1596549&r1=1596548&r2=1596549&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
 Wed May 21 12:11:02 2014
@@ -29,7 +29,6 @@ import java.util.concurrent.Callable;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.sling.ide.test.impl.helpers.DisableDebugStatusHandlers;
 import org.apache.sling.ide.test.impl.helpers.ExternalSlingLaunchpad;
 import org.apache.sling.ide.test.impl.helpers.LaunchpadConfig;
@@ -43,6 +42,7 @@ import org.eclipse.core.resources.IProje
 import org.eclipse.core.runtime.Path;
 import org.hamcrest.Matcher;
 import org.junit.After;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.RuleChain;
@@ -155,6 +155,58 @@ public class JcrFullCoverageAggregatesDe
     }
 
     @Test
+    @Ignore(value = "SLING-3591")
+    public void deleteAllNodesFromNestedFullCoverageAggreate() throws 
Exception {
+
+        wstServer.waitForServerToStart();
+
+        // create faceted project
+        IProject contentProject = projectRule.getProject();
+
+        ProjectAdapter project = new ProjectAdapter(contentProject);
+        project.addNatures("org.eclipse.wst.common.project.facet.core.nature");
+
+        // create .content.xml structure
+        InputStream contentXml = 
getClass().getResourceAsStream("content-nested-structure.xml");
+        
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
 contentXml);
+
+        // install content facet
+        project.installFacet("sling.content", "1.0");
+
+        ServerAdapter server = new ServerAdapter(wstServer.getServer());
+        server.installModule(contentProject);
+
+        Matcher<Node> postConditions = allOf(hasPath("/content/test-root/en"), 
hasPrimaryType("sling:Folder"),
+                hasMixinTypes("mix:language"), hasChildrenCount(3));
+
+        final RepositoryAccessor repo = new RepositoryAccessor(config);
+        Poller poller = new Poller();
+        poller.pollUntil(new Callable<Node>() {
+            @Override
+            public Node call() throws RepositoryException {
+                return repo.getNode("/content/test-root/en");
+
+            }
+        }, postConditions);
+
+        // update .content.xml structure
+        InputStream updatedContentXml = getClass()
+                
.getResourceAsStream("content-nested-structure-deleted-all-nodes.xml");
+        
project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"),
 updatedContentXml);
+
+        // poll until we only have no child nodes left
+        postConditions = allOf(hasPath("/content/test-root/en"), 
hasPrimaryType("sling:Folder"),
+                hasMixinTypes("mix:language"), hasChildrenCount(0));
+        poller.pollUntil(new Callable<Node>() {
+            @Override
+            public Node call() throws RepositoryException {
+                return repo.getNode("/content/test-root/en");
+
+            }
+        }, postConditions);
+    }
+
+    @Test
     public void reorderNodesFromNestedFullCoverageAggregate() throws Exception 
{
 
         wstServer.waitForServerToStart();

Added: 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/content-nested-structure-deleted-all-nodes.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/content-nested-structure-deleted-all-nodes.xml?rev=1596549&view=auto
==============================================================================
--- 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/content-nested-structure-deleted-all-nodes.xml
 (added)
+++ 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/content-nested-structure-deleted-all-nodes.xml
 Wed May 21 12:11:02 2014
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"; 
xmlns:vlt="http://www.day.com/jcr/vault/1.0"; 
xmlns:jcr="http://www.jcp.org/jcr/1.0";
+    jcr:mixinTypes="[mix:language]"
+    jcr:primaryType="sling:Folder"
+    jcr:language="en">
+</jcr:root>
\ No newline at end of file

Propchange: 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/content-nested-structure-deleted-all-nodes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
sling/trunk/tooling/ide/eclipse-test/src/org/apache/sling/ide/test/impl/content-nested-structure-deleted-all-nodes.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml


Reply via email to