use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method do_not_publish_dependencies_of_equal_parent.
/*
- S1 (New)
- A1 (New)
- A2 (New)
- A2_1 - Ref:B2_1 (New)
- A2_1_1
- S2 (New)
- B1 (New)
- B2 (New)
- B2_1 (New)
- B2_2 (New)
Resolve: A2_1
*/
@Test
public void do_not_publish_dependencies_of_equal_parent() throws Exception {
createS1S2Tree();
pushAllNodesInS1S2Tree();
updateNode("a2_1_1");
moveNode("b2_1", NodePath.create("/s2/b2").build(), "b2_1_renamed");
final ResolveSyncWorkResult result = resolveSyncWorkResult("a2_1_1");
assertNodes(result, ExpectedNodes.create().implicit("a2_1_1"));
}
use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method modified_parent_should_not_be_pushed.
@Test
public void modified_parent_should_not_be_pushed() throws Exception {
createS1S2Tree();
pushAllNodesInS1S2Tree();
updateNode("a2");
updateNode("a2_1");
refresh();
final ResolveSyncWorkResult result = resolveSyncWorkResult("a2_1");
assertNodes(result, ExpectedNodes.create().implicit("a2_1"));
assertEquals(1, result.getSize());
}
use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method change_child_order_manual_yields_children_changed.
@Test
public void change_child_order_manual_yields_children_changed() {
final Node node1 = createNode(NodePath.ROOT, "node1");
createNode(node1.path(), "node1_1");
createNode(node1.path(), "node1_2");
createNode(node1.path(), "node1_3");
createNode(node1.path(), "node1_4");
pushNodes(NodeIds.from(ROOT_UUID.toString(), "node1", "node1_1", "node1_2", "node1_3", "node1_4"), WS_OTHER);
SetNodeChildOrderCommand.create().nodeId(node1.id()).childOrder(ChildOrder.manualOrder()).indexServiceInternal(this.indexServiceInternal).searchService(this.searchService).storageService(this.storageService).build().execute();
final ResolveSyncWorkResult result = resolveSyncWorkResult(node1.id(), NodeIds.empty(), true, false);
assertNodes(result, ExpectedNodes.create().implicit(node1.id()).child("node1_1", "node1_2", "node1_3", "node1_4"));
}
use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method reference_and_parents_has_been_moved_must_push_reference_and_parents.
/*
- S1 (E)
- A1 (E)
- A2 (E)
- A2_1 - Ref:B2_1 (M)
- A2_1_1
- S2 (Moved)
- B1 (M)
- B2 (M)
- B2_1 (M)
Resolve: a2_1
*/
@Test
public void reference_and_parents_has_been_moved_must_push_reference_and_parents() throws Exception {
createS1S2Tree();
pushAllNodesInS1S2Tree();
updateNode("a2_1");
moveNode("s2", NodePath.ROOT, "s2edit");
final ResolveSyncWorkResult result = resolveSyncWorkResult("a2_1");
assertNodes(result, ExpectedNodes.create().implicit("a2_1").referred("b2_1").parent("b2", "s2"));
}
use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method duplicate_node_with_reference_then_resolve.
@Test
public void duplicate_node_with_reference_then_resolve() throws Exception {
final Node node1 = createNode(CreateNodeParams.create().parent(NodePath.ROOT).name("node1").data(createDataWithReferences(Reference.from("node1_1-id"), Reference.from("node1_1_1-id"))).build());
final Node node1_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1_1-id")).parent(node1.path()).name("node1_1").data(createDataWithReferences(Reference.from("node1_1_1-id"))).build());
final Node node_1_1_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1_1_1-id")).parent(node1_1.path()).name("node1_1_1").build());
refresh();
final Node node1Duplicate = duplicateNode(node1);
refresh();
final ResolveSyncWorkResult result = ResolveSyncWorkCommand.create().includeChildren(true).nodeId(node1Duplicate.id()).target(WS_OTHER).indexServiceInternal(this.indexServiceInternal).storageService(this.storageService).searchService(this.searchService).build().execute();
assertEquals(3, result.getSize());
}
Aggregations