Package net.floodlightcontroller.core.module

Examples of net.floodlightcontroller.core.module.FloodlightModuleContext


    public void doSetUp(Role initialRole) throws Exception {
        super.setUp();

        this.syncService = new MockSyncService();

        FloodlightModuleContext fmc = new FloodlightModuleContext();
        RestApiServer restApi = new RestApiServer();
        MockThreadPoolService tp = new MockThreadPoolService();
        ITopologyService topology = createMock(ITopologyService.class);
        fmc.addService(IThreadPoolService.class, tp);
        mockFloodlightProvider = getMockFloodlightProvider();
        mockFloodlightProvider.setRole(initialRole, "");

        deviceManager = new DeviceManagerImpl();
        flowReconcileMgr = new FlowReconcileManager();
        DefaultEntityClassifier entityClassifier = new DefaultEntityClassifier();
        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);
        fmc.addService(IEntityClassifierService.class, entityClassifier);
        fmc.addService(ITopologyService.class, topology);
        fmc.addService(ISyncService.class, syncService);
        tp.init(fmc);
        restApi.init(fmc);
        storageSource.init(fmc);
        deviceManager.init(fmc);
        flowReconcileMgr.init(fmc);
View Full Code Here


    @Before
    public void setUp() throws Exception {
        storageSource = new MemoryStorageSource();
        restApi = new RestApiServer();
        FloodlightModuleContext fmc = new FloodlightModuleContext();
        fmc.addService(IRestApiService.class, restApi);
        restApi.init(fmc);
        storageSource.init(fmc);
        restApi.startUp(fmc);
        storageSource.startUp(fmc);
        super.setUp();
View Full Code Here

        topology = createMock(ITopologyService.class);
        mockSyncService = new MockSyncService();
        DefaultEntityClassifier entityClassifier = new DefaultEntityClassifier();


        FloodlightModuleContext fmc = new FloodlightModuleContext();
        fmc.addService(IFloodlightProviderService.class,
                       mockFloodlightProvider);
        fmc.addService(IThreadPoolService.class, threadPool);
        fmc.addService(ITopologyService.class, topology);
        fmc.addService(IRoutingService.class, routingEngine);
        fmc.addService(ICounterStoreService.class, new CounterStore());
        fmc.addService(IDeviceService.class, deviceManager);
        fmc.addService(IFlowReconcileService.class, flowReconcileMgr);
        fmc.addService(IEntityClassifierService.class, entityClassifier);
        fmc.addService(ISyncService.class, mockSyncService);

        topology.addListener(anyObject(ITopologyListener.class));
        expectLastCall().anyTimes();
        replay(topology);
View Full Code Here

    @Before
    public void setUp() throws Exception {
        super.setUp();

        log = LoggerFactory.getLogger(PortDownReconciliation.class);
        fmc = new FloodlightModuleContext();
        mockFloodlightProvider = getMockFloodlightProvider();
        pdr = new PortDownReconciliation();
        lds = createMock(ILinkDiscoveryService.class);
        entityClassifier = new DefaultEntityClassifier();
        tps = new MockThreadPoolService();
View Full Code Here

        expectLastCall().anyTimes();
        mockSwitch.flush();
        expectLastCall().anyTimes();


        FloodlightModuleContext fmc = new FloodlightModuleContext();
        fmc.addService(IStorageSourceService.class, storage);

        MockFloodlightProvider mockFloodlightProvider = getMockFloodlightProvider();
        Map<Long, IOFSwitch> switchMap = new HashMap<Long, IOFSwitch>();
        switchMap.put(dpid, mockSwitch);
        // NO ! expect(mockFloodlightProvider.getSwitches()).andReturn(switchMap).anyTimes();
        mockFloodlightProvider.setSwitches(switchMap);
        fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
        RestApiServer restApi = new RestApiServer();
        fmc.addService(IRestApiService.class, restApi);
        restApi.init(fmc);
        staticFlowEntryPusher.init(fmc);
        staticFlowEntryPusher.startUp(fmc);    // again, to hack unittest
    }
View Full Code Here

    protected int MULTIHOP_LINK = 2;
    protected int TUNNEL_LINK = 3;

    @Before
    public void SetUp() throws Exception {
        fmc = new FloodlightModuleContext();
        linkDiscovery = EasyMock.createMock(ILinkDiscoveryService.class);
        mockFloodlightProvider = new MockFloodlightProvider();
        fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
        fmc.addService(ILinkDiscoveryService.class, linkDiscovery);
        MockThreadPoolService tp = new MockThreadPoolService();
View Full Code Here

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        fmc = new FloodlightModuleContext();
        fmc.addService(IFloodlightProviderService.class, getMockFloodlightProvider());
        MockThreadPoolService tp = new MockThreadPoolService();
        fmc.addService(IThreadPoolService.class, tp);
        tm  = new TopologyManager();
        tp.init(fmc);
View Full Code Here

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        FloodlightModuleContext cntx = new FloodlightModuleContext();
        ldm = new TestLinkDiscoveryManager();
        TopologyManager routingEngine = new TopologyManager();
        ldm.linkDiscoveryAware = new ArrayList<ILinkDiscoveryListener>();
        MockThreadPoolService tp = new MockThreadPoolService();
        RestApiServer restApi = new RestApiServer();
        cntx.addService(IRestApiService.class, restApi);
        cntx.addService(IThreadPoolService.class, tp);
        cntx.addService(IRoutingService.class, routingEngine);
        cntx.addService(ILinkDiscoveryService.class, ldm);
        cntx.addService(ITopologyService.class, ldm);
        cntx.addService(IStorageSourceService.class, new MemoryStorageSource());
        cntx.addService(IFloodlightProviderService.class, getMockFloodlightProvider());
        restApi.init(cntx);
        tp.init(cntx);
        routingEngine.init(cntx);
        ldm.init(cntx);
        restApi.startUp(cntx);
View Full Code Here

        super.setUp();

        lb = new LoadBalancer();

        cntx = new FloodlightContext();
        fmc = new FloodlightModuleContext();
        entityClassifier = new DefaultEntityClassifier(); // dependency for device manager
        frm = new FlowReconcileManager(); //dependency for device manager
        tps = new MockThreadPoolService(); //dependency for device manager
        deviceManager = new MockDeviceManager();
        topology = createMock(ITopologyService.class);
View Full Code Here

    }


    public void doSetUp(Role role) throws Exception {
        super.setUp();
        FloodlightModuleContext fmc = new FloodlightModuleContext();

        FloodlightProvider cm = new FloodlightProvider();
        fmc.addConfigParam(cm, "role", role.toString());
        controller = (Controller)cm.getServiceImpls().get(IFloodlightProviderService.class);
        fmc.addService(IFloodlightProviderService.class, controller);

        MemoryStorageSource memstorage = new MemoryStorageSource();
        fmc.addService(IStorageSourceService.class, memstorage);

        RestApiServer restApi = new RestApiServer();
        fmc.addService(IRestApiService.class, restApi);

        CounterStore cs = new CounterStore();
        fmc.addService(ICounterStoreService.class, cs);

        PktInProcessingTime ppt = new PktInProcessingTime();
        fmc.addService(IPktInProcessingTimeService.class, ppt);

        // TODO: should mock IDebugCounterService and make sure
        // the expected counters are updated.
        DebugCounter debugCounterService = new DebugCounter();
        fmc.addService(IDebugCounterService.class, debugCounterService);

        DebugEvent debugEventService = new DebugEvent();
        fmc.addService(IDebugEventService.class, debugEventService);

        tp = new MockThreadPoolService();
        fmc.addService(IThreadPoolService.class, tp);

        syncService = new MockSyncService();
        fmc.addService(ISyncService.class, syncService);



        ppt.init(fmc);
        restApi.init(fmc);
View Full Code Here

TOP

Related Classes of net.floodlightcontroller.core.module.FloodlightModuleContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.