From f736bf3005016e3082a85b7f45605bdc62d2f18e Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sat, 24 Feb 2018 21:23:24 +0100 Subject: [PATCH] Add implementation of methods for Path (for testing purpose... ). --- src/test/org/insa/graph/PathTest.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/test/org/insa/graph/PathTest.java b/src/test/org/insa/graph/PathTest.java index 53f6df5..a8adace 100644 --- a/src/test/org/insa/graph/PathTest.java +++ b/src/test/org/insa/graph/PathTest.java @@ -11,6 +11,9 @@ public class PathTest { // Small graph use for tests private static Graph graph; + // List of arcs in the graph. + private static Arc[] arcs; + @BeforeAll static void initAll() throws IOException { @@ -24,16 +27,12 @@ public class PathTest { } // Add arcs... - new Arc(nodes[0], nodes[1], 10, speed10, null); - new Arc(nodes[0], nodes[3], 15, speed10, null); - new Arc(nodes[0], nodes[4], 15, speed20, null); - new Arc(nodes[1], nodes[2], 10, speed10, null); - new Arc(nodes[2], nodes[3], 20, speed10, null); - new Arc(nodes[2], nodes[3], 10, speed10, null); - new Arc(nodes[2], nodes[3], 15, speed20, null); - new Arc(nodes[3], nodes[0], 15, speed10, null); - new Arc(nodes[3], nodes[4], 20, speed20, null); - new Arc(nodes[0], nodes[1], 10, speed10, null); + arcs = new Arc[] { new Arc(nodes[0], nodes[1], 10, speed10, null), + new Arc(nodes[0], nodes[3], 15, speed10, null), new Arc(nodes[0], nodes[4], 15, speed20, null), + new Arc(nodes[1], nodes[2], 10, speed10, null), new Arc(nodes[2], nodes[3], 20, speed10, null), + new Arc(nodes[2], nodes[3], 10, speed10, null), new Arc(nodes[2], nodes[3], 15, speed20, null), + new Arc(nodes[3], nodes[0], 15, speed10, null), new Arc(nodes[3], nodes[4], 20, speed20, null), + new Arc(nodes[0], nodes[1], 10, speed10, null) }; graph = new Graph(0, Arrays.asList(nodes)); }