diff --git a/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PriorityQueueTest.java b/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PriorityQueueTest.java index 2da689f..27bb14e 100644 --- a/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PriorityQueueTest.java +++ b/be-graphes-algos/src/test/java/org/insa/graphs/algorithm/utils/PriorityQueueTest.java @@ -83,6 +83,8 @@ public abstract class PriorityQueueTest { public final E[] data; public final int[] deleteOrder; + // data contains values + // deleteOrder contains indexes in data[] public TestParameters(E[] data, int[] deleteOrder) { this.data = data; this.deleteOrder = deleteOrder; @@ -309,9 +311,10 @@ public abstract class PriorityQueueTest { Assume.assumeFalse(queue.isEmpty()); int min = Collections.min(Arrays.asList(parameters.data)).get(); for (MutableInteger mi : parameters.data) { + // Update value before removing it. This is what happens when updating a Dijkstra label before updating it. + mi.set(--min); queue.remove(mi); assertEquals(parameters.data.length - 1, queue.size()); - mi.set(--min); queue.insert(mi); assertEquals(parameters.data.length, queue.size()); assertEquals(min, queue.findMin().get()); diff --git a/be-graphes-gui/src/main/java/org/insa/graphs/gui/PathsPanel.java b/be-graphes-gui/src/main/java/org/insa/graphs/gui/PathsPanel.java index 80d628c..d53b04b 100644 --- a/be-graphes-gui/src/main/java/org/insa/graphs/gui/PathsPanel.java +++ b/be-graphes-gui/src/main/java/org/insa/graphs/gui/PathsPanel.java @@ -107,6 +107,7 @@ public class PathsPanel extends JPanel * @param path Path for this bundle, must not be null. * @throws IOException If a resource was not found. */ + @SuppressWarnings("deprecation") public PathPanel(Path path, Color color) throws IOException { super(); setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); diff --git a/be-graphes-gui/src/main/java/org/insa/graphs/gui/ThreadWrapper.java b/be-graphes-gui/src/main/java/org/insa/graphs/gui/ThreadWrapper.java index e5e9cfc..ec9aac7 100644 --- a/be-graphes-gui/src/main/java/org/insa/graphs/gui/ThreadWrapper.java +++ b/be-graphes-gui/src/main/java/org/insa/graphs/gui/ThreadWrapper.java @@ -37,7 +37,7 @@ public class ThreadWrapper implements RunningAction { return thread != null && thread.isAlive(); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") @Override public void interrupt() { thread.stop(); diff --git a/be-graphes-model/src/main/java/org/insa/graphs/model/io/BinaryPathReader.java b/be-graphes-model/src/main/java/org/insa/graphs/model/io/BinaryPathReader.java index 7ebb8f9..dec3978 100644 --- a/be-graphes-model/src/main/java/org/insa/graphs/model/io/BinaryPathReader.java +++ b/be-graphes-model/src/main/java/org/insa/graphs/model/io/BinaryPathReader.java @@ -26,6 +26,7 @@ public class BinaryPathReader extends BinaryReader implements PathReader { super(MAGIC_NUMBER, VERSION, dis); } + @SuppressWarnings("deprecation") @Override public Path readPath(Graph graph) throws IOException { diff --git a/be-graphes-model/src/test/java/org/insa/graphes/model/PathTest.java b/be-graphes-model/src/test/java/org/insa/graphes/model/PathTest.java index e8cf97e..8d10b74 100644 --- a/be-graphes-model/src/test/java/org/insa/graphes/model/PathTest.java +++ b/be-graphes-model/src/test/java/org/insa/graphes/model/PathTest.java @@ -110,6 +110,7 @@ public class PathTest { assertEquals(10, longLoopPath.size()); } + @SuppressWarnings("deprecation") @Test public void testIsValid() { assertTrue(emptyPath.isValid()); @@ -122,6 +123,7 @@ public class PathTest { assertFalse(invalidPath.isValid()); } + @SuppressWarnings("deprecation") @Test public void testGetLength() { assertEquals(0, emptyPath.getLength(), 1e-6); @@ -132,6 +134,7 @@ public class PathTest { assertEquals(120, longLoopPath.getLength(), 1e-6); } + @SuppressWarnings("deprecation") @Test public void testGetTravelTime() { // Note: 18 km/h = 5m/s @@ -151,6 +154,7 @@ public class PathTest { assertEquals(15, longLoopPath.getTravelTime(28.8), 1e-6); } + @SuppressWarnings("deprecation") @Test public void testGetMinimumTravelTime() { assertEquals(0, emptyPath.getMinimumTravelTime(), 1e-4); @@ -161,6 +165,7 @@ public class PathTest { assertEquals(11.25, longLoopPath.getMinimumTravelTime(), 1e-4); } + @SuppressWarnings("deprecation") @Test public void testCreateFastestPathFromNodes() { Path path; @@ -197,6 +202,7 @@ public class PathTest { assertTrue(path.isEmpty()); } + @SuppressWarnings("deprecation") @Test public void testCreateShortestPathFromNodes() { Path path; @@ -233,12 +239,14 @@ public class PathTest { assertTrue(path.isEmpty()); } + @SuppressWarnings("deprecation") @Test(expected = IllegalArgumentException.class) public void testCreateFastestPathFromNodesException() { Path.createFastestPathFromNodes(graph, Arrays.asList(new Node[] { nodes[1], nodes[0] })); } + @SuppressWarnings("deprecation") @Test(expected = IllegalArgumentException.class) public void testCreateShortestPathFromNodesException() { Path.createShortestPathFromNodes(graph,