use of org.opendaylight.protocol.pcep.ietf.stateful.StatefulStatefulCapabilityTlvParser in project bgpcep by opendaylight.
the class PCEPTlvParserTest method testStatefulTlv.
@Test
public void testStatefulTlv() throws PCEPDeserializerException {
final StatefulStatefulCapabilityTlvParser parser = new StatefulStatefulCapabilityTlvParser();
final Stateful tlv = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).build();
assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(STATEFUL_BYTES, 4))));
final ByteBuf buff = Unpooled.buffer();
parser.serializeTlv(tlv, buff);
assertArrayEquals(STATEFUL_BYTES, ByteArray.getAllBytes(buff));
}
Aggregations