Search in sources :

Example 1 with StatefulLspUpdateErrorTlvParser

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));
}
Also used : StatefulLspUpdateErrorTlvParser(org.opendaylight.protocol.pcep.ietf.stateful.StatefulLspUpdateErrorTlvParser) LspErrorCode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.error.code.tlv.LspErrorCode) LspErrorCodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.error.code.tlv.LspErrorCodeBuilder) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1 StatefulLspUpdateErrorTlvParser (org.opendaylight.protocol.pcep.ietf.stateful.StatefulLspUpdateErrorTlvParser)1 LspErrorCode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.error.code.tlv.LspErrorCode)1 LspErrorCodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp.error.code.tlv.LspErrorCodeBuilder)1