Update test codes
Change-Id: I61d5796d929f34154c772ed16fbeff639c38f36b
diff --git a/src/test/java/net/onrc/onos/intent/ConstrainedShortestPathIntentTest.java b/src/test/java/net/onrc/onos/intent/ConstrainedShortestPathIntentTest.java
index e8759b1..aba4c11 100644
--- a/src/test/java/net/onrc/onos/intent/ConstrainedShortestPathIntentTest.java
+++ b/src/test/java/net/onrc/onos/intent/ConstrainedShortestPathIntentTest.java
@@ -1,7 +1,6 @@
package net.onrc.onos.intent;
import static org.junit.Assert.*;
-import net.onrc.onos.ofcontroller.networkgraph.NetworkGraph;
import org.junit.After;
import org.junit.Before;
@@ -15,13 +14,8 @@
* @author Toshio Koide (t-koide@onlab.us)
*/
public class ConstrainedShortestPathIntentTest {
- NetworkGraph g;
-
@Before
public void setUp() throws Exception {
- MockNetworkGraph graph = new MockNetworkGraph();
- graph.createSampleTopology();
- g = graph;
}
@After
diff --git a/src/test/java/net/onrc/onos/intent/PathIntentTest.java b/src/test/java/net/onrc/onos/intent/PathIntentTest.java
index dd34e90..3196493 100644
--- a/src/test/java/net/onrc/onos/intent/PathIntentTest.java
+++ b/src/test/java/net/onrc/onos/intent/PathIntentTest.java
@@ -2,7 +2,6 @@
import static org.junit.Assert.assertEquals;
import net.onrc.onos.ofcontroller.networkgraph.LinkEvent;
-import net.onrc.onos.ofcontroller.networkgraph.NetworkGraph;
import net.onrc.onos.ofcontroller.networkgraph.Path;
import net.onrc.onos.ofcontroller.util.serializers.KryoFactory;
@@ -18,13 +17,8 @@
* @author Toshio Koide (t-koide@onlab.us)
*/
public class PathIntentTest {
- NetworkGraph g;
-
@Before
public void setUp() throws Exception {
- MockNetworkGraph graph = new MockNetworkGraph();
- graph.createSampleTopology();
- g = graph;
}
@After
@@ -53,9 +47,9 @@
new ConstrainedShortestPathIntent("1", 2L, 3L, 4L, 5L, 6L, 7L, 1000.0);
Path path = new Path();
- path.add(new LinkEvent(g.getSwitch(1L).getPort(1L).getOutgoingLink()));
- path.add(new LinkEvent(g.getSwitch(2L).getPort(1L).getOutgoingLink()));
- path.add(new LinkEvent(g.getSwitch(3L).getPort(1L).getOutgoingLink()));
+ path.add(new LinkEvent(1L, 1L, 2L, 2L));
+ path.add(new LinkEvent(2L, 1L, 3L, 2L));
+ path.add(new LinkEvent(3L, 1L, 4L, 2L));
PathIntent pathIntent1 = new PathIntent("11", path, 123.45, cspIntent1);
diff --git a/src/test/java/net/onrc/onos/intent/ShortestPathIntentTest.java b/src/test/java/net/onrc/onos/intent/ShortestPathIntentTest.java
index e118b66..5012ee6 100644
--- a/src/test/java/net/onrc/onos/intent/ShortestPathIntentTest.java
+++ b/src/test/java/net/onrc/onos/intent/ShortestPathIntentTest.java
@@ -1,7 +1,6 @@
package net.onrc.onos.intent;
import static org.junit.Assert.*;
-import net.onrc.onos.ofcontroller.networkgraph.NetworkGraph;
import org.junit.After;
import org.junit.Before;
@@ -15,13 +14,8 @@
* @author Toshio Koide (t-koide@onlab.us)
*/
public class ShortestPathIntentTest {
- NetworkGraph g;
-
@Before
public void setUp() throws Exception {
- MockNetworkGraph graph = new MockNetworkGraph();
- graph.createSampleTopology();
- g = graph;
}
@After