Renamed class routing.TopoRouteService to topology.TopologyManager
diff --git a/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java b/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java
index 4516ece..80a5a35 100644
--- a/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java
+++ b/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java
@@ -73,7 +73,7 @@
import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
import net.onrc.onos.ofcontroller.flowmanager.FlowManager;
import net.onrc.onos.ofcontroller.flowmanager.IFlowService;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.registry.controller.IControllerRegistryService;
import net.onrc.onos.registry.controller.StandaloneRegistry;
@@ -139,7 +139,7 @@
// Following added by ONOS
// TODO replace with mock if further testing is needed.
fmc.addService(IFlowService.class, new FlowManager() );
- fmc.addService(ITopoRouteService.class, new TopoRouteService() );
+ fmc.addService(ITopoRouteService.class, new TopologyManager() );
StandaloneRegistry sr = new StandaloneRegistry();
fmc.addService(IControllerRegistryService.class, sr );
diff --git a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
index 83a5fab..68e31ba 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
@@ -19,7 +19,7 @@
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
import net.onrc.onos.ofcontroller.flowmanager.web.FlowWebRoutable;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.ofcontroller.util.*;
import org.easymock.EasyMock;
@@ -43,7 +43,7 @@
public class FlowManagerTest {
private static FloodlightModuleContext context;
private static IFloodlightProviderService floodlightProvider;
- private static TopoRouteService topoRouteService;
+ private static TopologyManager topologyManager;
private static IRestApiService restApi;
private static GraphDBOperation op;
@@ -68,7 +68,7 @@
// create mock objects
context = createMock(FloodlightModuleContext.class);
floodlightProvider = createMock(IFloodlightProviderService.class);
- topoRouteService = createMock(TopoRouteService.class);
+ topologyManager = createMock(TopologyManager.class);
restApi = createMock(IRestApiService.class);
op = createMock(GraphDBOperation.class);
@@ -76,7 +76,7 @@
expect(context.getServiceImpl(IFloodlightProviderService.class)).andReturn(floodlightProvider);
expect(context.getServiceImpl(IRestApiService.class)).andReturn(restApi);
expectNew(GraphDBOperation.class, new Class<?>[] {String.class}, EasyMock.isA(String.class)).andReturn(op);
- expectNew(TopoRouteService.class, new Class<?>[] {String.class}, EasyMock.isA(String.class)).andReturn(topoRouteService);
+ expectNew(TopologyManager.class, new Class<?>[] {String.class}, EasyMock.isA(String.class)).andReturn(topologyManager);
}
private IFlowPath createIFlowPathMock(long flowId, String installerID,
diff --git a/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java b/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
index 7929eb1..67c7ec3 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
@@ -20,7 +20,7 @@
import net.onrc.onos.graph.GraphDBConnection;
import net.onrc.onos.graph.GraphDBOperation;
import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.ofcontroller.util.DataPath;
import net.onrc.onos.ofcontroller.util.Dpid;
import net.onrc.onos.ofcontroller.util.FlowPathFlags;
@@ -28,17 +28,17 @@
import net.onrc.onos.ofcontroller.util.SwitchPort;
/**
- * A class for testing the TopoRouteService class.
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService
+ * A class for testing the TopologyManager class.
+ * @see net.onrc.onos.ofcontroller.topology.TopologyManager
*/
@RunWith(PowerMockRunner.class)
-@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, TopoRouteService.class})
+@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, TopologyManager.class})
public class TopoRouteServiceTest {
String conf;
private GraphDBConnection conn = null;
private GraphDBOperation oper = null;
private TitanGraph titanGraph = null;
- private TopoRouteService topoRouteService = null;
+ private TopologyManager topologyManager = null;
/**
* Setup the tests.
@@ -63,9 +63,9 @@
// Populate the database
TestDatabaseManager.populateTestData(titanGraph);
- // Prepare the TopoRouteService instance
- topoRouteService = new TopoRouteService();
- topoRouteService.setDbOperationHandler(oper);
+ // Prepare the TopologyManager instance
+ topologyManager = new TopologyManager();
+ topologyManager.setDbOperationHandler(oper);
}
/**
@@ -78,9 +78,9 @@
}
/**
- * Test method TopoRouteService.getTopoShortestPath()
+ * Test method TopologyManager.getTopoShortestPath()
*
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService#getTopoShortestPath
+ * @see net.onrc.onos.ofcontroller.topology.TopologyManager#getTopoShortestPath
*/
@Test
public void test_getTopoShortestPath() {
@@ -104,10 +104,10 @@
// Test a valid Shortest-Path computation
//
Map<Long, ?> shortestPathTopo =
- topoRouteService.prepareShortestPathTopo();
- dataPath = topoRouteService.getTopoShortestPath(shortestPathTopo,
- srcSwitchPort,
- dstSwitchPort);
+ topologyManager.prepareShortestPathTopo();
+ dataPath = topologyManager.getTopoShortestPath(shortestPathTopo,
+ srcSwitchPort,
+ dstSwitchPort);
assertTrue(dataPath != null);
String dataPathSummaryStr = dataPath.dataPathSummary();
// System.out.println(dataPathSummaryStr);
@@ -134,18 +134,18 @@
String noSuchDpidStr = "ff:ff:00:00:00:00:0a:06";
Dpid noSuchDstDpid = new Dpid(noSuchDpidStr);
SwitchPort noSuchDstSwitchPort = new SwitchPort(noSuchDstDpid, dstPort);
- dataPath = topoRouteService.getTopoShortestPath(shortestPathTopo,
- srcSwitchPort,
- noSuchDstSwitchPort);
+ dataPath = topologyManager.getTopoShortestPath(shortestPathTopo,
+ srcSwitchPort,
+ noSuchDstSwitchPort);
assertTrue(dataPath == null);
- topoRouteService.dropShortestPathTopo(shortestPathTopo);
+ topologyManager.dropShortestPathTopo(shortestPathTopo);
}
/**
- * Test method TopoRouteService.getShortestPath()
+ * Test method TopologyManager.getShortestPath()
*
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService#getShortestPath
+ * @see net.onrc.onos.ofcontroller.routing.TopologyManager#getShortestPath
*/
@Test
public void test_getShortestPath() {
@@ -168,8 +168,8 @@
//
// Test a valid Shortest-Path computation
//
- dataPath = topoRouteService.getShortestPath(srcSwitchPort,
- dstSwitchPort);
+ dataPath = topologyManager.getShortestPath(srcSwitchPort,
+ dstSwitchPort);
assertTrue(dataPath != null);
String dataPathSummaryStr = dataPath.dataPathSummary();
// System.out.println(dataPathSummaryStr);
@@ -197,15 +197,15 @@
Dpid noSuchDstDpid = new Dpid(noSuchDpidStr);
SwitchPort noSuchDstSwitchPort = new SwitchPort(noSuchDstDpid, dstPort);
- dataPath = topoRouteService.getShortestPath(srcSwitchPort,
- noSuchDstSwitchPort);
+ dataPath = topologyManager.getShortestPath(srcSwitchPort,
+ noSuchDstSwitchPort);
assertTrue(dataPath == null);
}
/**
- * Test method TopoRouteService.routeExists()
+ * Test method TopologyManager.routeExists()
*
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService#routeExists
+ * @see net.onrc.onos.ofcontroller.routing.TopologyManager#routeExists
*/
@Test
public void test_routeExists() {
@@ -228,7 +228,7 @@
//
// Test a valid route
//
- result = topoRouteService.routeExists(srcSwitchPort, dstSwitchPort);
+ result = topologyManager.routeExists(srcSwitchPort, dstSwitchPort);
assertTrue(result == true);
//
@@ -237,8 +237,8 @@
String noSuchDpidStr = "ff:ff:00:00:00:00:0a:06";
Dpid noSuchDstDpid = new Dpid(noSuchDpidStr);
SwitchPort noSuchDstSwitchPort = new SwitchPort(noSuchDstDpid, dstPort);
- result = topoRouteService.routeExists(srcSwitchPort,
- noSuchDstSwitchPort);
+ result = topologyManager.routeExists(srcSwitchPort,
+ noSuchDstSwitchPort);
assertTrue(result != true);
}
}