You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2021/11/05 11:07:19 UTC

[jackrabbit-filevault] branch bugfix/JCRVLT-557-tests created (now 9e47ce0)

This is an automated email from the ASF dual-hosted git repository.

reschke pushed a change to branch bugfix/JCRVLT-557-tests
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git.


      at 9e47ce0  JCRVLT-557: improve test coverage (from https://github.com/apache/jackrabbit-filevault/pull/164)

This branch includes the following new commits:

     new 9e47ce0  JCRVLT-557: improve test coverage (from https://github.com/apache/jackrabbit-filevault/pull/164)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[jackrabbit-filevault] 01/01: JCRVLT-557: improve test coverage (from https://github.com/apache/jackrabbit-filevault/pull/164)

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch bugfix/JCRVLT-557-tests
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit 9e47ce07f5e6de27fd60235396000ea91a8ff1cd
Author: Julian Reschke <ju...@gmx.de>
AuthorDate: Fri Nov 5 12:03:52 2021 +0100

    JCRVLT-557: improve test coverage (from https://github.com/apache/jackrabbit-filevault/pull/164)
---
 .../vault/packaging/integration/ImportIT.java          | 18 ++++++++++++++++++
 .../META-INF/vault/filter.xml                          |  4 ++++
 .../META-INF/vault/properties.xml                      | 18 ++++++++++++++++++
 .../jcr_root/testroot/myfolder/mychild/.content.xml    |  4 ++++
 4 files changed, 44 insertions(+)

diff --git a/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java b/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java
index 285c418..5c6cd54 100644
--- a/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java
+++ b/vault-core/src/test/java/org/apache/jackrabbit/vault/packaging/integration/ImportIT.java
@@ -382,4 +382,22 @@ public class ImportIT extends IntegrationTestBase {
         }
     }
 
+    @Test
+    public void testImplicitNodeType() throws IOException, RepositoryException, ConfigurationException {
+        Node rootNode = admin.getRootNode();
+        rootNode.addNode("testroot", "nt:unstructured");
+        admin.save();
+        try (Archive archive = getFileArchive("/test-packages/test_implicit_definition.zip")) {
+            ImportOptions opts = getDefaultOptions();
+            opts.setOverwritePrimaryTypesOfFolders(false);
+            Importer importer = new Importer(opts);
+            archive.open(true);
+            importer.run(archive, rootNode);
+        }
+        admin.save();
+        // Checking for inheritance/nodetype detection
+        // Behavior in 3.4.0: myfolder coming from package without any definition would be created as nt:unstructured
+        assertNodeHasPrimaryType("/testroot/myfolder", "nt:unstructured");
+        assertNodeHasPrimaryType("/testroot/myfolder/mychild", "nt:unstructured");
+    }
 }
\ No newline at end of file
diff --git a/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/META-INF/vault/filter.xml b/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/META-INF/vault/filter.xml
new file mode 100644
index 0000000..c94973e
--- /dev/null
+++ b/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/META-INF/vault/filter.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workspaceFilter version="1.0">
+    <filter root="/testroot/myfolder"/>
+</workspaceFilter>
\ No newline at end of file
diff --git a/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/META-INF/vault/properties.xml b/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/META-INF/vault/properties.xml
new file mode 100644
index 0000000..b5979b6
--- /dev/null
+++ b/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/META-INF/vault/properties.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties>
+<comment>FileVault Test Implicit Definitions</comment>
+<entry key="createdBy">admin</entry>
+<entry key="name">implicit-definition-test</entry>
+<entry key="lastModified">2011-11-15T09:45:14.664+01:00</entry>
+<entry key="lastModifiedBy">admin</entry>
+<entry key="created">2011-11-15T09:45:14.685+01:00</entry>
+<entry key="buildCount">1</entry>
+<entry key="version"/>
+<entry key="dependencies"/>
+<entry key="packageFormatVersion">2</entry>
+<entry key="description"/>
+<entry key="lastWrapped">2011-11-15T09:45:14.664+01:00</entry>
+<entry key="group"/>
+<entry key="lastWrappedBy">admin</entry>
+</properties>
diff --git a/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/jcr_root/testroot/myfolder/mychild/.content.xml b/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/jcr_root/testroot/myfolder/mychild/.content.xml
new file mode 100644
index 0000000..d1ff898
--- /dev/null
+++ b/vault-core/src/test/resources/test-packages/test_implicit_definition.zip/jcr_root/testroot/myfolder/mychild/.content.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" xmlns:my="http://jackrabbit.apache.org/filevault/testing"
+    jcr:primaryType="nt:unstructured">
+</jcr:root>