Search in sources :

Example 1 with Stateful07LspUpdateErrorTlvParser

use of org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LspUpdateErrorTlvParser in project bgpcep by opendaylight.

the class PCEPTlvParserTest method testLspErrorCodeTlv.

@Test
public void testLspErrorCodeTlv() throws PCEPDeserializerException {
    final Stateful07LspUpdateErrorTlvParser parser = new Stateful07LspUpdateErrorTlvParser();
    final LspErrorCode tlv = new LspErrorCodeBuilder().setErrorCode(627610883L).build();
    assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(lspUpdateErrorBytes, 4))));
    final ByteBuf buff = Unpooled.buffer();
    parser.serializeTlv(tlv, buff);
    assertArrayEquals(lspUpdateErrorBytes, ByteArray.getAllBytes(buff));
}
Also used : LspErrorCode(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.error.code.tlv.LspErrorCode) Stateful07LspUpdateErrorTlvParser(org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LspUpdateErrorTlvParser) LspErrorCodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.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 Stateful07LspUpdateErrorTlvParser (org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LspUpdateErrorTlvParser)1 LspErrorCode (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.error.code.tlv.LspErrorCode)1 LspErrorCodeBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.lsp.error.code.tlv.LspErrorCodeBuilder)1