jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r1583832 - in /jackrabbit/commons/filevault/trunk/vault-core/src: main/java/org/apache/jackrabbit/vault/fs/impl/io/ main/java/org/apache/jackrabbit/vault/fs/io/ test/java/org/apache/jackrabbit/vault/packaging/integration/ test/resources/org...
Date Tue, 01 Apr 2014 23:44:24 GMT
Author: tripod
Date: Tue Apr  1 23:44:24 2014
New Revision: 1583832

URL: http://svn.apache.org/r1583832
Log:
JCRVLT-44 Regression: child node order to respected for mixed aggregate parents

Added:
    jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_childnodeorder2.zip
Modified:
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java
    jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java
    jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestPackageInstall.java

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java?rev=1583832&r1=1583831&r2=1583832&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/impl/io/DocViewSAXImporter.java
Tue Apr  1 23:44:24 2014
@@ -1116,12 +1116,7 @@ public class DocViewSAXImporter extends 
                 }
             }
             stack = stack.pop();
-//            if (stack.isRoot()) {
-//                // record child names of root node
-//                importInfo.setNameList(childNames);
-//                importInfo.setNode(node);
-//            }
-            if (node != null && numChildren == 0 && !childNames.isEmpty())
{
+            if (node != null && (numChildren == 0 && !childNames.isEmpty()
|| stack.isRoot())) {
                 importInfo.addNameList(node.getPath(), childNames);
             }
         } catch (RepositoryException e) {

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java?rev=1583832&r1=1583831&r2=1583832&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/main/java/org/apache/jackrabbit/vault/fs/io/Importer.java
Tue Apr  1 23:44:24 2014
@@ -1130,6 +1130,9 @@ public class Importer {
         }
 
         public Node getNode(Session s) throws RepositoryException {
+            if (path.length() == 0) {
+                return s.getRootNode();
+            }
             return s.nodeExists(path)
                     ? s.getNode(path)
                     : null;

Modified: jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestPackageInstall.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestPackageInstall.java?rev=1583832&r1=1583831&r2=1583832&view=diff
==============================================================================
--- jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestPackageInstall.java
(original)
+++ jackrabbit/commons/filevault/trunk/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/TestPackageInstall.java
Tue Apr  1 23:44:24 2014
@@ -20,7 +20,6 @@ package org.apache.jackrabbit.vault.pack
 import java.io.File;
 import java.io.IOException;
 
-import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 
@@ -272,6 +271,25 @@ public class TestPackageInstall extends 
         assertEquals("child order", "a,d,b,c,", names.toString());
     }
 
+    /**
+     * installs a package that contains a node with childnode ordering and full-coverage
sub nodes.
+     * see JCRVLT-44
+     */
+    @Test
+    public void testChildNodeOrder2() throws IOException, RepositoryException, PackageException
{
+        JcrPackage pack = packMgr.upload(getStream("testpackages/test_childnodeorder2.zip"),
false);
+        assertNotNull(pack);
+        pack.install(getDefaultOptions());
+
+        assertNodeExists("/tmp/test/en");
+        NodeIterator iter = admin.getNode("/tmp/test/en").getNodes();
+        StringBuilder names = new StringBuilder();
+        while (iter.hasNext()) {
+            names.append(iter.nextNode().getName()).append(",");
+        }
+        assertEquals("child order", "jcr:content,toolbar,products,services,company,events,support,community,blog,",
names.toString());
+    }
+
     // todo: upload with version
     // todo: install / uninstall
     // todo: sub packages

Added: jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_childnodeorder2.zip
URL: http://svn.apache.org/viewvc/jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_childnodeorder2.zip?rev=1583832&view=auto
==============================================================================
Files jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_childnodeorder2.zip
(added) and jackrabbit/commons/filevault/trunk/vault-core/src/test/resources/org/apache/jackrabbit/vault/packaging/integration/testpackages/test_childnodeorder2.zip
Tue Apr  1 23:44:24 2014 differ



Mime
View raw message