use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match in project openflowplugin by opendaylight.
the class MplsBosEntrySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final short mplsBos = (short) 1;
final Match mplsBosMatch = new MatchBuilder().setProtocolMatchFields(new ProtocolMatchFieldsBuilder().setMplsBos(mplsBos).build()).build();
// TODO: Why are we using short in models instead of boolean?
assertMatch(mplsBosMatch, false, (out) -> assertEquals(out.readBoolean(), mplsBos != 0));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match in project openflowplugin by opendaylight.
the class SctpDestinationPortEntrySerializerTest method testSerialize.
@Test
public void testSerialize() throws Exception {
final int sctp = 10;
final Match sctpMatch = new MatchBuilder().setLayer4Match(new SctpMatchBuilder().setSctpDestinationPort(new PortNumber(sctp)).build()).build();
assertMatch(sctpMatch, false, (out) -> assertEquals(out.readUnsignedShort(), sctp));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match in project openflowplugin by opendaylight.
the class Ipv6ExtHeaderEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int extHeader = 10;
final int extHeaderMask = 8;
writeHeader(in, false);
in.writeShort(extHeader);
Ipv6Match match = Ipv6Match.class.cast(deserialize(in).getLayer3Match());
assertEquals(extHeader, match.getIpv6ExtHeader().getIpv6Exthdr().intValue());
assertEquals(0, in.readableBytes());
writeHeader(in, true);
in.writeShort(extHeader);
in.writeShort(extHeaderMask);
match = Ipv6Match.class.cast(deserialize(in).getLayer3Match());
assertEquals(extHeader, match.getIpv6ExtHeader().getIpv6Exthdr().intValue());
assertEquals(extHeaderMask, match.getIpv6ExtHeader().getIpv6ExthdrMask().intValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match in project openflowplugin by opendaylight.
the class Ipv6NdSllEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final MacAddress address = new MacAddress("00:01:02:03:04:05");
writeHeader(in, false);
in.writeBytes(IetfYangUtil.INSTANCE.bytesFor(address));
Ipv6Match match = Ipv6Match.class.cast(deserialize(in).getLayer3Match());
assertEquals(address.getValue(), match.getIpv6NdSll().getValue());
assertEquals(0, in.readableBytes());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.Match in project openflowplugin by opendaylight.
the class MplsLabelEntryDeserializerTest method deserializeEntry.
@Test
public void deserializeEntry() throws Exception {
final ByteBuf in = UnpooledByteBufAllocator.DEFAULT.buffer();
final int mplsLabel = 10;
writeHeader(in, false);
in.writeInt(mplsLabel);
ProtocolMatchFields match = deserialize(in).getProtocolMatchFields();
assertEquals(mplsLabel, match.getMplsLabel().intValue());
assertEquals(0, in.readableBytes());
}
Aggregations