Skip to content
Snippets Groups Projects
Commit b18b8e6f authored by Kanzhe Jiang's avatar Kanzhe Jiang
Browse files

Fix unit test with flowReconcileService interface

parent a0eb40b6
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ net.floodlightcontroller.devicemanager.internal.DeviceManagerImpl
net.floodlightcontroller.linkdiscovery.internal.LinkDiscoveryManager
net.floodlightcontroller.topology.TopologyManager
net.floodlightcontroller.forwarding.Forwarding
net.floodlightcontroller.flowcache.FlowReconcileManager
net.floodlightcontroller.core.OFMessageFilterManager
net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher
net.floodlightcontroller.perfmon.PktInProcessingTime
......
......@@ -48,6 +48,8 @@ import net.floodlightcontroller.devicemanager.IDevice;
import net.floodlightcontroller.devicemanager.IEntityClass;
import net.floodlightcontroller.devicemanager.SwitchPort;
import net.floodlightcontroller.devicemanager.IDeviceService;
import net.floodlightcontroller.flowcache.FlowReconcileManager;
import net.floodlightcontroller.flowcache.IFlowReconcileService;
import net.floodlightcontroller.packet.ARP;
import net.floodlightcontroller.packet.Ethernet;
import net.floodlightcontroller.packet.IPacket;
......@@ -81,6 +83,7 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
MockFloodlightProvider mockFloodlightProvider;
DeviceManagerImpl deviceManager;
MemoryStorageSource storageSource;
FlowReconcileManager flowReconcileMgr;
private IOFSwitch makeSwitchMock(long id) {
IOFSwitch mockSwitch = createMock(IOFSwitch.class);
......@@ -104,17 +107,21 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
fmc.addService(IThreadPoolService.class, tp);
mockFloodlightProvider = getMockFloodlightProvider();
deviceManager = new DeviceManagerImpl();
flowReconcileMgr = new FlowReconcileManager();
fmc.addService(IDeviceService.class, deviceManager);
storageSource = new MemoryStorageSource();
fmc.addService(IStorageSourceService.class, storageSource);
fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
fmc.addService(IRestApiService.class, restApi);
fmc.addService(IFlowReconcileService.class, flowReconcileMgr);
tp.init(fmc);
restApi.init(fmc);
storageSource.init(fmc);
deviceManager.init(fmc);
flowReconcileMgr.init(fmc);
storageSource.startUp(fmc);
deviceManager.startUp(fmc);
flowReconcileMgr.startUp(fmc);
tp.startUp(fmc);
IOFSwitch mockSwitch1 = makeSwitchMock(1L);
......
......@@ -54,6 +54,8 @@ import net.floodlightcontroller.routing.Route;
import net.floodlightcontroller.test.FloodlightTestCase;
import net.floodlightcontroller.threadpool.IThreadPoolService;
import net.floodlightcontroller.topology.ITopologyService;
import net.floodlightcontroller.flowcache.FlowReconcileManager;
import net.floodlightcontroller.flowcache.IFlowReconcileService;
import net.floodlightcontroller.forwarding.Forwarding;
import org.easymock.Capture;
......@@ -76,6 +78,7 @@ public class ForwardingTest extends FloodlightTestCase {
protected MockDeviceManager deviceManager;
protected IRoutingService routingEngine;
protected Forwarding forwarding;
protected FlowReconcileManager flowReconcileMgr;
protected ITopologyService topology;
protected MockThreadPoolService threadPool;
protected IOFSwitch sw1, sw2;
......@@ -97,8 +100,10 @@ public class ForwardingTest extends FloodlightTestCase {
forwarding = getForwarding();
threadPool = new MockThreadPoolService();
deviceManager = new MockDeviceManager();
flowReconcileMgr = new FlowReconcileManager();
routingEngine = createMock(IRoutingService.class);
topology = createMock(ITopologyService.class);
FloodlightModuleContext fmc = new FloodlightModuleContext();
fmc.addService(IFloodlightProviderService.class,
......@@ -108,13 +113,16 @@ public class ForwardingTest extends FloodlightTestCase {
fmc.addService(IRoutingService.class, routingEngine);
fmc.addService(ICounterStoreService.class, new CounterStore());
fmc.addService(IDeviceService.class, deviceManager);
fmc.addService(IFlowReconcileService.class, flowReconcileMgr);
threadPool.init(fmc);
forwarding.init(fmc);
deviceManager.init(fmc);
flowReconcileMgr.init(fmc);
threadPool.startUp(fmc);
deviceManager.startUp(fmc);
forwarding.startUp(fmc);
flowReconcileMgr.startUp(fmc);
// Mock switches
sw1 = EasyMock.createNiceMock(IOFSwitch.class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment