use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev171207.update.attributes.bgp.prefix.sid.bgp.prefix.sid.tlvs.bgp.prefix.sid.tlv.LuLabelIndexTlvBuilder 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(333L).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