public void checkSelfReferenceThroughRole() { NodeData node = get(Uri.parse("http://misc.test:666/ORGANIZATION/ID/")); assertNotNull(node); OrganizationData organization = (OrganizationData)node; List<RoleInfo> contributors = (List<RoleInfo>)organization.getContributors(); assertNotNull("list of contributors must not be null", contributors); assertEquals("list of contributors has wrong length", 1, contributors.size()); assertEquals("self-reference is not equal", node, contributors.get(0).getContributor()); assertTrue("self-reference does refer another instance", node == contributors.get(0).getContributor()); }
public void checkSelfReferenceThroughNodes() { Storage.openStage(nodeRepository, nodeService, config, (NodeData n) -> {}, null, null); TypeInfo type = Storage.getStage().getConfig().getType("TYPE"); Storage.closeStage(); assertNotNull("could not find type TYPE", type); NodeData node = get(Uri.parse("http://misc.test:666/EVENT/ID/")); assertNotNull(node); EventData event = (EventData)node; Map<TypeInfo, NodesInfo> nodes = (Map<TypeInfo, NodesInfo>)event.getNodes(); assertNotNull("map of nodes must not be null", nodes); assertNotNull("nodes of type TYPE must not be null", nodes.get(type)); assertNotNull("list of nodes of type TYPE must not be null", nodes.get(type).getNodes()); assertEquals("list of nodes of type TYPE has wrong length", 1, nodes.get(type).getNodes().size()); assertEquals("self-reference is not equal", node, nodes.get(type).getNodes().get(0)); assertTrue("self-reference does refer another instance", node == nodes.get(type).getNodes().get(0)); }
public void checkSelfReferenceThroughParentLocation() { NodeData node = get(Uri.parse("http://misc.test:666/PLACE/ID/")); assertNotNull(node); PlaceData place = (PlaceData)node; assertNotNull("parent-location must not be null", place.getLocation()); assertEquals("self-reference is not equal", node, place.getLocation()); assertTrue("self-reference does refer another instance", node == place.getLocation()); }
public void checkSelfReferenceThroughState() { NodeData node = get(Uri.parse("http://misc.test:666/DATE/ID/")); assertNotNull(node); DateData date = (DateData)node; assertNotNull("node-state must not be null", date.getNodeState()); assertEquals("self-reference is not equal", node, date.getNodeState().getNode()); assertTrue("self-reference does refer another instance", node == date.getNodeState().getNode()); }