@Test public void testBounds() { graph = createGraph(); BBox b = graph.getBounds(); assertEquals(BBox.INVERSE.maxLat, b.maxLat, 1e-6); NodeAccess na = graph.getNodeAccess(); na.setNode(0, 10, 20); assertEquals(10, b.maxLat, 1e-6); assertEquals(20, b.maxLon, 1e-6); na.setNode(0, 15, -15); assertEquals(15, b.maxLat, 1e-6); assertEquals(20, b.maxLon, 1e-6); assertEquals(10, b.minLat, 1e-6); assertEquals(-15, b.minLon, 1e-6); }
@Test public void testClone() { graph = createGraph(); graph.edge(1, 2, 10, true); NodeAccess na = graph.getNodeAccess(); na.setNode(0, 12, 23); na.setNode(1, 8, 13); na.setNode(2, 2, 10); na.setNode(3, 5, 9); graph.edge(1, 3, 10, true); Graph clone = graph.copyTo(createGraph(locationParent + "/clone", false)); assertEquals(graph.getNodes(), clone.getNodes()); assertEquals( count(carOutExplorer.setBaseNode(1)), count(clone.createEdgeExplorer(carOutFilter).setBaseNode(1))); clone.edge(1, 4, 10, true); assertEquals(3, count(clone.createEdgeExplorer(carOutFilter).setBaseNode(1))); assertEquals(graph.getBounds(), clone.getBounds()); Helper.close((Closeable) clone); }