Index: engine/src/test/resources/merge/new-node-empty-dev/out/exportSecond/hcm-config/export-second/parent/node1.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/out/exportSecond/hcm-config/export-second/parent/node1.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/out/exportSecond/hcm-config/export-second/parent/node1.yaml (revision ) @@ -0,0 +1,4 @@ +definitions: + config: + /export-second/parent/node1: + jcr:primaryType: nt:unstructured Index: engine/src/test/resources/merge/new-node/out/exportSecond/hcm-config/exportSecond.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node/out/exportSecond/hcm-config/exportSecond.yaml (revision 1d26cf68d858c172ec855996e32764b7f38c204c) +++ engine/src/test/resources/merge/new-node/out/exportSecond/hcm-config/exportSecond.yaml (revision ) @@ -8,3 +8,7 @@ /newAsChild2: .meta:residual-child-node-category: content jcr:primaryType: nt:unstructured + /export-second: + jcr:primaryType: nt:unstructured + /parent: + jcr:primaryType: nt:unstructured Index: engine/src/test/resources/merge/new-node-empty-dev/in/exportSecond/hcm-module.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/exportSecond/hcm-module.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/exportSecond/hcm-module.yaml (revision ) @@ -0,0 +1,6 @@ +# This file is used by ClasspathConfigurationModelReaderTest and needs to be at the root of test-classes during test +group: test-group +project: test-project +module: + name: exportSecond + after: [topmost,upstream,exportFirst] \ No newline at end of file Index: engine/src/test/resources/merge/new-node/in/exportSecond/hcm-config/exportSecond.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node/in/exportSecond/hcm-config/exportSecond.yaml (revision 1d26cf68d858c172ec855996e32764b7f38c204c) +++ engine/src/test/resources/merge/new-node/in/exportSecond/hcm-config/exportSecond.yaml (revision ) @@ -2,3 +2,7 @@ config: /topmost/upstream/exportSecond: jcr:primaryType: nt:unstructured + /export-second: + jcr:primaryType: nt:unstructured + /parent: + jcr:primaryType: nt:unstructured \ No newline at end of file Index: engine/src/test/resources/merge/new-node/out/exportSecond/hcm-config/export-second/parent/node1.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node/out/exportSecond/hcm-config/export-second/parent/node1.yaml (revision ) +++ engine/src/test/resources/merge/new-node/out/exportSecond/hcm-config/export-second/parent/node1.yaml (revision ) @@ -0,0 +1,4 @@ +definitions: + config: + /export-second/parent/node1: + jcr:primaryType: nt:unstructured Index: engine/src/test/resources/merge/new-node-empty-dev/in/diff/hcm-config/diff.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/diff/hcm-config/diff.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/diff/hcm-config/diff.yaml (revision ) @@ -0,0 +1,4 @@ +definitions: + config: + /export-second/parent/node1: + jcr:primaryType: nt:unstructured \ No newline at end of file Index: engine/src/test/resources/merge/new-node-empty-dev/in/upstream/hcm-config/upstream.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/upstream/hcm-config/upstream.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/upstream/hcm-config/upstream.yaml (revision ) @@ -0,0 +1,4 @@ +definitions: + config: + /topmost/upstream: + jcr:primaryType: nt:unstructured Index: engine/src/test/resources/merge/new-node-empty-dev/in/topmost/hcm-config/topmost.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/topmost/hcm-config/topmost.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/topmost/hcm-config/topmost.yaml (revision ) @@ -0,0 +1,4 @@ +definitions: + config: + /topmost: + jcr:primaryType: nt:unstructured Index: engine/src/test/resources/merge/new-node-empty-dev/in/exportFirst/hcm-module.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/exportFirst/hcm-module.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/exportFirst/hcm-module.yaml (revision ) @@ -0,0 +1,6 @@ +# This file is used by ClasspathConfigurationModelReaderTest and needs to be at the root of test-classes during test +group: test-group +project: test-project +module: + name: exportFirst + after: [topmost,upstream] \ No newline at end of file Index: engine/src/test/resources/merge/new-node-empty-dev/in/upstream/hcm-module.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/upstream/hcm-module.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/upstream/hcm-module.yaml (revision ) @@ -0,0 +1,6 @@ +# This file is used by ClasspathConfigurationModelReaderTest and needs to be at the root of test-classes during test +group: test-group +project: test-project +module: + name: upstream + after: [topmost] \ No newline at end of file Index: engine/src/test/resources/merge/new-node-empty-dev/out/exportSecond/hcm-config/exportSecond.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/out/exportSecond/hcm-config/exportSecond.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/out/exportSecond/hcm-config/exportSecond.yaml (revision ) @@ -0,0 +1,8 @@ +definitions: + config: + /topmost/upstream/exportSecond: + jcr:primaryType: nt:unstructured + /export-second: + jcr:primaryType: nt:unstructured + /parent: + jcr:primaryType: nt:unstructured Index: engine/src/test/java/org/onehippo/cm/engine/autoexport/DefinitionMergeTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/java/org/onehippo/cm/engine/autoexport/DefinitionMergeTest.java (revision 1d26cf68d858c172ec855996e32764b7f38c204c) +++ engine/src/test/java/org/onehippo/cm/engine/autoexport/DefinitionMergeTest.java (revision ) @@ -19,7 +19,9 @@ import java.nio.file.Path; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.jcr.Node; @@ -40,7 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static java.util.Collections.singletonList; import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.replay; @@ -68,6 +69,11 @@ new MergeFixture("new-node").test(); } + @Test + public void new_node_empty_dev() throws Exception { + new MergeFixture("new-node-empty-dev", "/", "").test(); + } + @Test public void delete_node() throws Exception { new MergeFixture("delete-node").test(); @@ -101,14 +107,25 @@ AutoExportConfig autoExportConfig; public MergeFixture(final String testName) { + this(testName, "/topmost,/exportFirstExistingRoot,/hippo:namespaces", "/"); + } + + public MergeFixture(final String testName, final String firstModulePaths, final String secondModulePaths) { this.testName = testName; Map> modules = new HashMap<>(); - modules.put("exportFirst", Arrays.asList("/topmost", "/exportFirstExistingRoot", "/hippo:namespaces")); - modules.put("exportSecond", singletonList("/")); + modules.put("exportFirst", parsePathString(firstModulePaths)); + modules.put("exportSecond", parsePathString(secondModulePaths)); autoExportConfig = new AutoExportConfig(true, modules, null, null); } + private List parsePathString(final String string) { + if (string == null || string.equals("")) { + return Collections.emptyList(); + } + return Arrays.asList(string.split(",")); + } + public MergeFixture base(final String... base) { this.base = base; return this; Index: engine/src/test/resources/merge/new-node-empty-dev/in/exportFirst/hcm-config/exportFirst.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/exportFirst/hcm-config/exportFirst.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/exportFirst/hcm-config/exportFirst.yaml (revision ) @@ -0,0 +1,10 @@ +definitions: + config: + /topmost: + /upstream: + /exportFirst: + jcr:primaryType: nt:unstructured + /existingChild: + jcr:primaryType: nt:unstructured + /exportFirstExistingRoot: + jcr:primaryType: nt:unstructured Index: engine/src/test/resources/merge/new-node-empty-dev/out/exportFirst/hcm-config/exportFirst.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/out/exportFirst/hcm-config/exportFirst.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/out/exportFirst/hcm-config/exportFirst.yaml (revision ) @@ -0,0 +1,10 @@ +definitions: + config: + /topmost: + /upstream: + /exportFirst: + jcr:primaryType: nt:unstructured + /existingChild: + jcr:primaryType: nt:unstructured + /exportFirstExistingRoot: + jcr:primaryType: nt:unstructured Index: engine/src/test/resources/merge/new-node-empty-dev/in/diff/hcm-module.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/diff/hcm-module.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/diff/hcm-module.yaml (revision ) @@ -0,0 +1,3 @@ +group: runtime-group +project: runtime-project +module: runtime-module \ No newline at end of file Index: engine/src/test/resources/merge/new-node-empty-dev/in/topmost/hcm-module.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/topmost/hcm-module.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/topmost/hcm-module.yaml (revision ) @@ -0,0 +1,4 @@ +# This file is used by ClasspathConfigurationModelReaderTest and needs to be at the root of test-classes during test +group: test-group +project: test-project +module: topmost \ No newline at end of file Index: engine/src/test/resources/merge/new-node-empty-dev/in/exportSecond/hcm-config/exportSecond.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node-empty-dev/in/exportSecond/hcm-config/exportSecond.yaml (revision ) +++ engine/src/test/resources/merge/new-node-empty-dev/in/exportSecond/hcm-config/exportSecond.yaml (revision ) @@ -0,0 +1,8 @@ +definitions: + config: + /topmost/upstream/exportSecond: + jcr:primaryType: nt:unstructured + /export-second: + jcr:primaryType: nt:unstructured + /parent: + jcr:primaryType: nt:unstructured \ No newline at end of file Index: engine/src/test/resources/merge/new-node/in/diff/hcm-config/diff.yaml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- engine/src/test/resources/merge/new-node/in/diff/hcm-config/diff.yaml (revision 1d26cf68d858c172ec855996e32764b7f38c204c) +++ engine/src/test/resources/merge/new-node/in/diff/hcm-config/diff.yaml (revision ) @@ -27,4 +27,6 @@ jcr:primaryType: nt:unstructured /newAsChild2: jcr:primaryType: nt:unstructured - .meta:residual-child-node-category: content \ No newline at end of file + .meta:residual-child-node-category: content + /export-second/parent/node1: + jcr:primaryType: nt:unstructured \ No newline at end of file