Search in sources :

Example 1 with OFFactoryVer12

use of org.projectfloodlight.openflow.protocol.ver12.OFFactoryVer12 in project open-kilda by telstra.

the class PingRequestCommandAbstractTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    moduleContext.addService(IOFSwitchService.class, switchService);
    final DatapathId dpIdAlpha = DatapathId.of(0x0000fffe00000001L);
    final DatapathId dpIdBeta = DatapathId.of(0x0000fffe00000002L);
    final DatapathId dpIdGamma = DatapathId.of(0x0000fffe00000003L);
    final DatapathId dpIdDelta = DatapathId.of(0x0000fffe00000004L);
    OFFactory ofFactory = new OFFactoryVer13();
    expect(switchAlpha.getId()).andReturn(dpIdAlpha).anyTimes();
    expect(switchBeta.getId()).andReturn(dpIdBeta).anyTimes();
    expect(switchMissing.getId()).andReturn(dpIdGamma).anyTimes();
    expect(switchNotCapable.getId()).andReturn(dpIdDelta).anyTimes();
    expect(switchAlpha.getOFFactory()).andReturn(ofFactory).anyTimes();
    expect(switchBeta.getOFFactory()).andReturn(ofFactory).anyTimes();
    expect(switchNotCapable.getOFFactory()).andReturn(new OFFactoryVer12()).anyTimes();
    expect(switchService.getActiveSwitch(dpIdAlpha)).andReturn(switchAlpha).anyTimes();
    expect(switchService.getActiveSwitch(dpIdBeta)).andReturn(switchBeta).anyTimes();
    expect(switchService.getActiveSwitch(dpIdGamma)).andReturn(null).anyTimes();
    expect(switchService.getActiveSwitch(dpIdDelta)).andReturn(switchNotCapable).anyTimes();
}
Also used : OFFactoryVer13(org.projectfloodlight.openflow.protocol.ver13.OFFactoryVer13) OFFactoryVer12(org.projectfloodlight.openflow.protocol.ver12.OFFactoryVer12) OFFactory(org.projectfloodlight.openflow.protocol.OFFactory) DatapathId(org.projectfloodlight.openflow.types.DatapathId) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 OFFactory (org.projectfloodlight.openflow.protocol.OFFactory)1 OFFactoryVer12 (org.projectfloodlight.openflow.protocol.ver12.OFFactoryVer12)1 OFFactoryVer13 (org.projectfloodlight.openflow.protocol.ver13.OFFactoryVer13)1 DatapathId (org.projectfloodlight.openflow.types.DatapathId)1