Search in sources :

Example 1 with Stateful07LspSymbolicNameTlvParser

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

the class PCEPTlvParserTest method testSymbolicNameTlv.

@Test
public void testSymbolicNameTlv() throws PCEPDeserializerException {
    final Stateful07LspSymbolicNameTlvParser parser = new Stateful07LspSymbolicNameTlvParser();
    final SymbolicPathName tlv = new SymbolicPathNameBuilder().setPathName(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.SymbolicPathName("Med test of symbolic nameeee".getBytes())).build();
    assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(symbolicNameBytes, 4))));
    final ByteBuf buff = Unpooled.buffer();
    parser.serializeTlv(tlv, buff);
    assertArrayEquals(symbolicNameBytes, ByteArray.getAllBytes(buff));
}
Also used : SymbolicPathNameBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.symbolic.path.name.tlv.SymbolicPathNameBuilder) SymbolicPathName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.symbolic.path.name.tlv.SymbolicPathName) ByteBuf(io.netty.buffer.ByteBuf) Stateful07LspSymbolicNameTlvParser(org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LspSymbolicNameTlvParser) Test(org.junit.Test)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1 Stateful07LspSymbolicNameTlvParser (org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07LspSymbolicNameTlvParser)1 SymbolicPathName (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.symbolic.path.name.tlv.SymbolicPathName)1 SymbolicPathNameBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.symbolic.path.name.tlv.SymbolicPathNameBuilder)1