use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.update.attributes.bgp.prefix.sid.bgp.prefix.sid.tlvs.bgp.prefix.sid.tlv.LuLabelIndexTlv in project bgpcep by opendaylight.
the class BgpPrefixSidTlvsTest method testLabelIndexParser.
@Test
public void testLabelIndexParser() {
final LabelIndexTlvParser parser = new LabelIndexTlvParser();
final LuLabelIndexTlv tlv = new LuLabelIndexTlvBuilder().setLabelIndexTlv(Uint32.valueOf(333)).build();
final ByteBuf serialized = Unpooled.buffer(7);
final byte[] expected = new byte[] { 0, 0, 0, 0, 0, 1, (byte) 0x4d };
parser.serializeBgpPrefixSidTlv(tlv, serialized);
assertArrayEquals(expected, serialized.array());
assertEquals(tlv.getLabelIndexTlv(), parser.parseBgpPrefixSidTlv(serialized).getLabelIndexTlv());
assertEquals(1, parser.getType());
}
Aggregations