From b8d73963a6d196037fa2d5e93ce8ccf9d7e9509f Mon Sep 17 00:00:00 2001 From: Mikael Capelle Date: Thu, 15 Mar 2018 08:25:43 +0100 Subject: [PATCH] Clean tests. --- .../{datastructures => utils}/BinaryHeap.java | 2 +- .../utils}/BinaryHeapTest.java | 3 +- .../insa/graph/io/BinaryGraphReaderTest.java | 52 ------------------- 3 files changed, 2 insertions(+), 55 deletions(-) rename src/main/org/insa/algo/{datastructures => utils}/BinaryHeap.java (99%) rename src/test/org/insa/{utility => algo/utils}/BinaryHeapTest.java (96%) delete mode 100644 src/test/org/insa/graph/io/BinaryGraphReaderTest.java diff --git a/src/main/org/insa/algo/datastructures/BinaryHeap.java b/src/main/org/insa/algo/utils/BinaryHeap.java similarity index 99% rename from src/main/org/insa/algo/datastructures/BinaryHeap.java rename to src/main/org/insa/algo/utils/BinaryHeap.java index 79034f5..09a208f 100644 --- a/src/main/org/insa/algo/datastructures/BinaryHeap.java +++ b/src/main/org/insa/algo/utils/BinaryHeap.java @@ -7,7 +7,7 @@ // ******************ERRORS******************************** // Throws RuntimeException for findMin and deleteMin when empty -package org.insa.algo.datastructures; +package org.insa.algo.utils; import java.util.ArrayList; diff --git a/src/test/org/insa/utility/BinaryHeapTest.java b/src/test/org/insa/algo/utils/BinaryHeapTest.java similarity index 96% rename from src/test/org/insa/utility/BinaryHeapTest.java rename to src/test/org/insa/algo/utils/BinaryHeapTest.java index 7afed4a..47a8345 100644 --- a/src/test/org/insa/utility/BinaryHeapTest.java +++ b/src/test/org/insa/algo/utils/BinaryHeapTest.java @@ -1,4 +1,4 @@ -package org.insa.utility; +package org.insa.algo.utils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -6,7 +6,6 @@ import static org.junit.Assert.assertTrue; import java.util.Arrays; import java.util.stream.IntStream; -import org.insa.algo.datastructures.BinaryHeap; import org.junit.Before; import org.junit.Test; diff --git a/src/test/org/insa/graph/io/BinaryGraphReaderTest.java b/src/test/org/insa/graph/io/BinaryGraphReaderTest.java deleted file mode 100644 index 532003c..0000000 --- a/src/test/org/insa/graph/io/BinaryGraphReaderTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.insa.graph.io; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.util.List; - -import org.insa.graph.Graph; -import org.insa.graph.Node; -import org.insa.graph.Point; -import org.junit.BeforeClass; -import org.junit.Test; - -public class BinaryGraphReaderTest { - - // Epsilon for latitude and longitude. - private static final double EPS = 1e-5; - - private static Graph midip; - - @BeforeClass - public static void initAll() throws IOException { - // TODO - } - - public void assertPointAt(Point p1, double longitude, double latitude) { - assertEquals(p1.getLongitude(), longitude, EPS); - assertEquals(p1.getLatitude(), latitude, EPS); - } - - @Test - public void testMidipNodes() { - List nodes = midip.getNodes(); - - assertEquals(nodes.size(), 150827); - - // Check the locations of some nodes. - assertPointAt(nodes.get(58411).getPoint(), 1.799864, 43.92864); - assertPointAt(nodes.get(133312).getPoint(), 0.539752, 43.317505); - assertPointAt(nodes.get(113688).getPoint(), 1.682739, 44.799774); - assertPointAt(nodes.get(118141).getPoint(), 0.274857, 43.47475); - assertPointAt(nodes.get(146918).getPoint(), 0.116148, 43.811386); - - } - - @Test - public void testMidipArcs() { - // TODO: Check the number of edges. - // TODO: Check information for some edges. - } - -}