use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method reference_has_been_moved_push_reference_not_parents_even_if_modified.
/*
- S1 (E)
- A1 (E)
- A2 (E)
- A2_1 - Ref:B2_1 (M)
- A2_1_1
- S2 (E)
- B1 (E)
- B2 (E)
- B2_1 (M)
Resolve: A2_1
*/
@Test
public void reference_has_been_moved_push_reference_not_parents_even_if_modified() throws Exception {
createS1S2Tree();
pushAllNodesInS1S2Tree();
updateNode("a2_1");
updateNode("b2");
updateNode("b2_1");
refresh();
final ResolveSyncWorkResult result = resolveSyncWorkResult("a2_1");
assertNodes(result, ExpectedNodes.create().implicit("a2_1").referred("b2_1"));
assertEquals(2, result.getSize());
}
use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method deleted_child_dont_include_parent_deletion.
/**
* Tries to resolve one of the nodes in the middle of tree of deleted nodes.
*
* @throws Exception
*/
@Test
public void deleted_child_dont_include_parent_deletion() throws Exception {
final Node node1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1")).parent(NodePath.ROOT).name("node1").build());
final Node node1_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1_1")).parent(node1.path()).name("node1_1").build());
final Node node1_1_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1_1_1")).parent(node1_1.path()).name("node1_1_1").build());
final Node node1_1_1_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1_1_1_1")).parent(node1_1_1.path()).name("node1_1_1_1").build());
pushNodes(WS_OTHER, node1.id(), node1_1.id(), node1_1_1.id(), node1_1_1_1.id());
refresh();
markAsDelete(node1.id());
markAsDelete(node1_1.id());
markAsDelete(node1_1_1.id());
markAsDelete(node1_1_1_1.id());
refresh();
final ResolveSyncWorkResult result = ResolveSyncWorkCommand.create().nodeId(node1_1.id()).includeChildren(true).target(WS_OTHER).indexServiceInternal(this.indexServiceInternal).storageService(this.storageService).searchService(this.searchService).build().execute();
assertEquals(3, result.getSize());
}
use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method do_not_publish_dependencies_of_modified_parent.
@Test
public void do_not_publish_dependencies_of_modified_parent() throws Exception {
createS1S2Tree();
pushAllNodesInS1S2Tree();
updateNode("a2_1_1");
updateNode("a2_1");
updateNode("b2_1");
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 reference_to_another_branch_with_back_reference.
@Test
public void reference_to_another_branch_with_back_reference() throws Exception {
final Node node1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1")).parent(NodePath.ROOT).name("node1").build());
final PropertyTree node1_1_data = new PropertyTree();
node1_1_data.addReference("myRef", Reference.from("node2_1_1"));
final Node node1_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node1_1")).parent(node1.path()).name("node1_1").data(node1_1_data).build());
final PropertyTree node2_data = new PropertyTree();
node2_data.addReference("myRef", Reference.from("node1_1"));
final Node node2 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node2")).parent(NodePath.ROOT).name("node2").data(node2_data).build());
final Node node2_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node2_1")).parent(node2.path()).name("node2_1").build());
final Node node2_1_1 = createNode(CreateNodeParams.create().setNodeId(NodeId.from("node2_1_1")).parent(node2_1.path()).name("node2_1_1").build());
createNode(CreateNodeParams.create().setNodeId(NodeId.from("node3")).parent(NodePath.ROOT).name("node3").build());
final ResolveSyncWorkResult result = ResolveSyncWorkCommand.create().includeChildren(true).nodeId(node1.id()).target(WS_OTHER).indexServiceInternal(this.indexServiceInternal).storageService(this.storageService).searchService(this.searchService).build().execute();
assertEquals(5, result.getSize());
}
use of com.enonic.xp.node.ResolveSyncWorkResult in project xp by enonic.
the class ResolveSyncWorkCommandTest method make_sure_referred_nodes_includes_parents_if_missing.
/*
- S1 (New)
- A1 (New)
- A2 (New)
- A2_1 - Ref:B2_1 (New)
- A2_1_1
- S2 (New)
- B1 (New)
- B2 (New)
- B2_1 (New)
*/
@Test
public void make_sure_referred_nodes_includes_parents_if_missing() {
createS1S2Tree();
final ResolveSyncWorkResult result = resolveSyncWorkResult(NodeId.from("a2_1"), true);
assertNodes(result, ExpectedNodes.create().implicit("a2_1").child("a2_1_1").parent("a2", "s1").referred("b2_1").parent("b2", "s2"));
}
Aggregations