Search in sources :

Example 6 with MetadataCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase in project openflowplugin by opendaylight.

the class OxmMetadataDeserializerTest method test.

/**
 * Tests {@link OxmMetadataDeserializer#deserialize(ByteBuf)}.
 */
@Test
public void test() {
    ByteBuf buffer = BufferHelper.buildBuffer("80 00 04 08 00 00 00 00 00 00 00 03");
    // skip XID
    buffer.skipBytes(4);
    OxmMetadataDeserializer deserializer = new OxmMetadataDeserializer();
    MatchEntry entry = deserializer.deserialize(buffer);
    Assert.assertEquals("Wrong entry class", OpenflowBasicClass.class, entry.getOxmClass());
    Assert.assertEquals("Wrong entry field", Metadata.class, entry.getOxmMatchField());
    Assert.assertEquals("Wrong entry hasMask", false, entry.isHasMask());
    Assert.assertArrayEquals("Wrong entry value", ByteBufUtils.hexStringToBytes("00 00 00 00 00 00 00 03"), ((MetadataCase) entry.getMatchEntryValue()).getMetadata().getMetadata());
}
Also used : MatchEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry) MetadataCase(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

MetadataCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.MetadataCase)5 Test (org.junit.Test)4 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)4 BigInteger (java.math.BigInteger)3 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)3 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)3 MetadataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.MetadataBuilder)3 EthDstCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthDstCase)3 EthSrcCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.EthSrcCase)3 TunnelIdCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.TunnelIdCase)3 VlanVidCase (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.VlanVidCase)3 ByteBuf (io.netty.buffer.ByteBuf)2 List (java.util.List)2 VersionConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionConvertorData)2 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)2 Match (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match)2 VlanId (org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId)2 EthernetDestinationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetDestinationBuilder)2 EthernetSourceBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.ethernet.match.fields.EthernetSourceBuilder)2 EthernetMatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.EthernetMatchBuilder)2