use of org.opendaylight.protocol.pcep.ietf.stateful.StatefulLspUpdateErrorTlvParser in project bgpcep by opendaylight.
the class PCEPTlvParserTest method testLspErrorCodeTlv.
@Test
public void testLspErrorCodeTlv() throws PCEPDeserializerException {
final StatefulLspUpdateErrorTlvParser parser = new StatefulLspUpdateErrorTlvParser();
final LspErrorCode tlv = new LspErrorCodeBuilder().setErrorCode(Uint32.valueOf(627610883)).build();
assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(LSP_UPDATE_ERROR_BYTES, 4))));
final ByteBuf buff = Unpooled.buffer();
parser.serializeTlv(tlv, buff);
assertArrayEquals(LSP_UPDATE_ERROR_BYTES, ByteArray.getAllBytes(buff));
}
Aggregations