Search in sources :

Example 1 with StatefulLspSymbolicNameTlvParser

use of org.opendaylight.protocol.pcep.ietf.stateful.StatefulLspSymbolicNameTlvParser in project bgpcep by opendaylight.

the class PCEPTlvParserTest method testSymbolicNameTlv.

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

Aggregations

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