use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link in project openflowplugin by opendaylight.
the class SwitchFeaturesUtilTest method setUp.
/**
* Initialization of
* {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
* .GetFeaturesOutputBuilder GetFeaturesOutputBuilder}
* and {@link SwitchFeaturesUtil SwitchFeaturesUtil}.
*/
@Before
public void setUp() throws Exception {
featuresOutputBuilder = new GetFeaturesOutputBuilder();
swUtil = SwitchFeaturesUtil.getInstance();
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link in project openflowplugin by opendaylight.
the class SwitchFeaturesUtilTest method testSwFeaturesCapabilitiesV10.
/**
* Test method for
* {@link SwitchFeaturesUtil#buildSwitchFeatures} for OF 1.0 version
* and switch feature capabilities.
* .
*/
@Test
public void testSwFeaturesCapabilitiesV10() {
CapabilitiesV10 capabilities = new CapabilitiesV10(true, false, true, false, true, false, true, false);
featuresOutputBuilder.setCapabilitiesV10(capabilities).setVersion((short) 1);
Assert.assertNotNull(swUtil.buildSwitchFeatures(featuresOutputBuilder.build()));
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link in project openflowplugin by opendaylight.
the class SwitchFeaturesUtilTest method testSwFeaturesCapabilitiesVersionMismatch.
/**
* Test method for
* {@link SwitchFeaturesUtil#buildSwitchFeatures} for mismatch between
* version and switch feature capabilities
* .
*/
@Test
public void testSwFeaturesCapabilitiesVersionMismatch() {
CapabilitiesV10 capabilities = new CapabilitiesV10(true, false, true, false, true, false, true, false);
featuresOutputBuilder.setCapabilitiesV10(capabilities).setCapabilities(null).setVersion((short) 4);
Assert.assertNull(swUtil.buildSwitchFeatures(featuresOutputBuilder.build()));
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link in project openflowplugin by opendaylight.
the class SwitchFeaturesUtilTest method testSwFeaturesCapabilitiesNonexistingVersion.
/**
* Test method for
* {@link SwitchFeaturesUtil#buildSwitchFeatures} for nonexisting version
* .
*/
@Test
public void testSwFeaturesCapabilitiesNonexistingVersion() {
CapabilitiesV10 capabilities = new CapabilitiesV10(true, false, true, false, true, false, true, false);
featuresOutputBuilder.setCapabilitiesV10(capabilities).setCapabilities(null).setVersion((short) 0);
Assert.assertNull(swUtil.buildSwitchFeatures(featuresOutputBuilder.build()));
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link in project openflowplugin by opendaylight.
the class OpenflowProtocolListenerFullImplTest method testOnPacketInMessage.
/**
* Test method for
* {@link OpenflowProtocolListenerFullImpl#onPacketInMessage(
* org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage)}.
*/
@Test
public void testOnPacketInMessage() {
PacketInMessage packetInMessage = new PacketInMessageBuilder().setVersion(OFConstants.OFP_VERSION_1_3).setXid(xid).build();
ofProtocolListener.onPacketInMessage(packetInMessage);
Mockito.verify(deviceReplyProcessor).processPacketInMessage(Matchers.any(PacketInMessage.class));
}
Aggregations