assertThat(graph.getChildren().of("/node3/node2[2]/node3"), hasChildren(segment("node1"),
segment("node2"),
segment("node3")));
assertThat(graph.getChildren().of("/node3/node2[2]/node1/node1"), hasChildren());
Subgraph subgraph = graph.getSubgraphOfDepth(4).at("/node3");
assertThat(subgraph, is(notNullValue()));
assertThat(subgraph.getNode(".").getChildren(), hasChildren(segment("node2"), segment("node3")));
assertThat(subgraph.getNode("."), hasProperty("property1", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("."), hasProperty("property2", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("."), hasProperty("property3", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[1]").getChildren(), hasChildren(segment("node1"), segment("node2"), segment("node3")));
assertThat(subgraph.getNode("node2[1]"), hasProperty("property1", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[1]"), hasProperty("property2", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[1]"), hasProperty("property3", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node3").getChildren(), isEmpty());
assertThat(subgraph.getNode("node3"), hasProperty("property1", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node3"), hasProperty("property2", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node3"), hasProperty("property3", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]").getChildren(), hasChildren(segment("node1"), segment("node2"), segment("node3")));
assertThat(subgraph.getNode("node2[2]"), hasProperty("property1", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]"), hasProperty("property2", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]"), hasProperty("property3", "The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1").getChildren(), hasChildren(segment("node1"),
segment("node2"),
segment("node3")));
assertThat(subgraph.getNode("node2[2]/node1"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node1").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node1/node1"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node1"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node1"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node2").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node1/node2"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node2"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node2"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node3").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node1/node3"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node3"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node1/node3"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
if (source.getCapabilities().supportsReferences()) {
assertThat(subgraph.getNode("node2[2]/node2").getChildren(), hasChildren(segment("node1"),
segment("node2"),
segment("node3")));
}
assertThat(subgraph.getNode("node2[2]/node2"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node1").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node2/node1"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node1"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node1"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node2").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node2/node2"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node2"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node2"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node3").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node2/node3"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node3"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node2/node3"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
if (source.getCapabilities().supportsReferences()) {
assertThat(subgraph.getNode("node2[2]/node3").getChildren(), hasChildren(segment("node1"),
segment("node2"),
segment("node3")));
}
assertThat(subgraph.getNode("node2[2]/node3"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node1").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node3/node1"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node1"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node1"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node2").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node3/node2"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node2"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node2"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node3").getChildren(), isEmpty());
assertThat(subgraph.getNode("node2[2]/node3/node3"), hasProperty("property1",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node3"), hasProperty("property2",
"The quick brown fox jumped over the moon. What? "));
assertThat(subgraph.getNode("node2[2]/node3/node3"), hasProperty("property3",
"The quick brown fox jumped over the moon. What? "));
}