use of nl.knaw.huygens.timbuctoo.database.tinkerpop.TinkerpopSaver.RAW_ITEM_EDGE_NAME in project timbuctoo by HuygensING.
the class TinkerPopOperationsTest method deleteVreRemovesAllTheVresRawCollectionsFromDatabase.
@Test
public void deleteVreRemovesAllTheVresRawCollectionsFromDatabase() {
TinkerPopGraphManager graphManager = newGraph().withVertex("vreName", v -> v.withLabel("VRE").withProperty(Vre.VRE_NAME_PROPERTY_NAME, "vreName").withOutgoingRelation(RAW_COLLECTION_EDGE_NAME, "rawCollection")).withVertex("rawCollection", v -> v.withProperty(RAW_COLLECTION_NAME_PROPERTY_NAME, "rawCollection").withOutgoingRelation(RAW_ITEM_EDGE_NAME, "rawItem").withOutgoingRelation(RAW_PROPERTY_EDGE_NAME, "rawProperty")).withVertex("rawProperty", v -> v.withProperty("tim_id", "a")).withVertex("rawItem", v -> v.withProperty("tim_id", "b")).withVertex("someThingFromDifferentVre", v -> v.withProperty("other", true)).wrap();
TinkerPopOperations instance = forGraphWrapper(graphManager);
instance.deleteVre("vreName");
Graph graph = graphManager.getGraph();
assertThat(graph.traversal().V().has(Vre.VRE_NAME_PROPERTY_NAME, "vreName").hasNext(), equalTo(false));
assertThat(graph.traversal().V().has(RAW_COLLECTION_NAME_PROPERTY_NAME, "rawCollection").hasNext(), equalTo(false));
assertThat(graph.traversal().V().has("tim_id").hasNext(), equalTo(false));
assertThat(graph.traversal().V().has("other").hasNext(), equalTo(true));
}
Aggregations