Search in sources :

Example 6 with FloodlightModuleContext

use of net.floodlightcontroller.core.module.FloodlightModuleContext in project open-kilda by telstra.

the class PathVerificationFlowTest method setUp.

@Before
public void setUp() throws Exception {
    logger = LoggerFactory.getLogger(PathVerificationFlowTest.class);
    cntx = new FloodlightContext();
    FloodlightModuleContext fmc = new FloodlightModuleContext();
    fmc.addService(IFloodlightProviderService.class, mockFloodlightProvider);
    swDescription = factory.buildDescStatsReply().build();
    swFeatures = factory.buildFeaturesReply().setNBuffers(1000).build();
    sw = EasyMock.createMock(IOFSwitch.class);
    expect(sw.getId()).andReturn(swDpid).anyTimes();
    expect(sw.getOFFactory()).andReturn(factory).anyTimes();
    expect(sw.getBuffers()).andReturn(swFeatures.getNBuffers()).anyTimes();
    expect(sw.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_TABLE)).andReturn(true).anyTimes();
    expect(sw.getSwitchDescription()).andReturn(new SwitchDescription(swDescription)).anyTimes();
    expect(sw.isActive()).andReturn(true).anyTimes();
    expect(sw.getLatency()).andReturn(U64.of(10L)).anyTimes();
    replay(sw);
    pvs = new PathVerificationService();
}
Also used : IOFSwitch(net.floodlightcontroller.core.IOFSwitch) FloodlightModuleContext(net.floodlightcontroller.core.module.FloodlightModuleContext) SwitchDescription(net.floodlightcontroller.core.SwitchDescription) FloodlightContext(net.floodlightcontroller.core.FloodlightContext) Before(org.junit.Before)

Aggregations

FloodlightModuleContext (net.floodlightcontroller.core.module.FloodlightModuleContext)6 FloodlightContext (net.floodlightcontroller.core.FloodlightContext)4 Before (org.junit.Before)4 OFPortDesc (org.projectfloodlight.openflow.protocol.OFPortDesc)3 InetSocketAddress (java.net.InetSocketAddress)2 IOFSwitch (net.floodlightcontroller.core.IOFSwitch)2 SwitchDescription (net.floodlightcontroller.core.SwitchDescription)2 OFPacketIn (org.projectfloodlight.openflow.protocol.OFPacketIn)2 FutureCallback (com.google.common.util.concurrent.FutureCallback)1 Futures (com.google.common.util.concurrent.Futures)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 TimeUnit (java.util.concurrent.TimeUnit)1 Function (java.util.function.Function)1 Collectors.toList (java.util.stream.Collectors.toList)1 IFloodlightProviderService (net.floodlightcontroller.core.IFloodlightProviderService)1 IOFSwitchService (net.floodlightcontroller.core.internal.IOFSwitchService)1