Search in sources :

Example 61 with Link

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();
}
Also used : GetFeaturesOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder) Before(org.junit.Before)

Example 62 with Link

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()));
}
Also used : CapabilitiesV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.CapabilitiesV10) Test(org.junit.Test)

Example 63 with Link

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()));
}
Also used : CapabilitiesV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.CapabilitiesV10) Test(org.junit.Test)

Example 64 with Link

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()));
}
Also used : CapabilitiesV10(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.CapabilitiesV10) Test(org.junit.Test)

Example 65 with Link

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));
}
Also used : PacketInMessageBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder) PacketInMessage(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)454 ByteBuf (io.netty.buffer.ByteBuf)138 ArrayList (java.util.ArrayList)71 BigInteger (java.math.BigInteger)58 Eid (org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid)54 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)51 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)45 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)38 Ipv6Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address)37 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)35 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)35 InetAddress (java.net.InetAddress)33 SimpleAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.SimpleAddress)33 MappingData (org.opendaylight.lispflowmapping.lisp.type.MappingData)32 MultipartReplyMessage (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReplyMessage)28 Inet4Address (java.net.Inet4Address)27 Inet6Address (java.net.Inet6Address)27 NoAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.address.NoAddress)27 LispAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.LispAddress)26 Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp.address.Address)26