|
@@ -1,52 +0,0 @@
|
1
|
|
-package org.insa.graph.io;
|
2
|
|
-
|
3
|
|
-import static org.junit.Assert.assertEquals;
|
4
|
|
-
|
5
|
|
-import java.io.IOException;
|
6
|
|
-import java.util.List;
|
7
|
|
-
|
8
|
|
-import org.insa.graph.Graph;
|
9
|
|
-import org.insa.graph.Node;
|
10
|
|
-import org.insa.graph.Point;
|
11
|
|
-import org.junit.BeforeClass;
|
12
|
|
-import org.junit.Test;
|
13
|
|
-
|
14
|
|
-public class BinaryGraphReaderTest {
|
15
|
|
-
|
16
|
|
- // Epsilon for latitude and longitude.
|
17
|
|
- private static final double EPS = 1e-5;
|
18
|
|
-
|
19
|
|
- private static Graph midip;
|
20
|
|
-
|
21
|
|
- @BeforeClass
|
22
|
|
- public static void initAll() throws IOException {
|
23
|
|
- // TODO
|
24
|
|
- }
|
25
|
|
-
|
26
|
|
- public void assertPointAt(Point p1, double longitude, double latitude) {
|
27
|
|
- assertEquals(p1.getLongitude(), longitude, EPS);
|
28
|
|
- assertEquals(p1.getLatitude(), latitude, EPS);
|
29
|
|
- }
|
30
|
|
-
|
31
|
|
- @Test
|
32
|
|
- public void testMidipNodes() {
|
33
|
|
- List<Node> nodes = midip.getNodes();
|
34
|
|
-
|
35
|
|
- assertEquals(nodes.size(), 150827);
|
36
|
|
-
|
37
|
|
- // Check the locations of some nodes.
|
38
|
|
- assertPointAt(nodes.get(58411).getPoint(), 1.799864, 43.92864);
|
39
|
|
- assertPointAt(nodes.get(133312).getPoint(), 0.539752, 43.317505);
|
40
|
|
- assertPointAt(nodes.get(113688).getPoint(), 1.682739, 44.799774);
|
41
|
|
- assertPointAt(nodes.get(118141).getPoint(), 0.274857, 43.47475);
|
42
|
|
- assertPointAt(nodes.get(146918).getPoint(), 0.116148, 43.811386);
|
43
|
|
-
|
44
|
|
- }
|
45
|
|
-
|
46
|
|
- @Test
|
47
|
|
- public void testMidipArcs() {
|
48
|
|
- // TODO: Check the number of edges.
|
49
|
|
- // TODO: Check information for some edges.
|
50
|
|
- }
|
51
|
|
-
|
52
|
|
-}
|