Search in sources :

Example 1 with Stateful07StatefulCapabilityTlvParser

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

the class PCEPTlvParserTest method testStatefulTlv.

@Test
public void testStatefulTlv() throws PCEPDeserializerException {
    final Stateful07StatefulCapabilityTlvParser parser = new Stateful07StatefulCapabilityTlvParser();
    final Stateful tlv = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).build();
    assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(statefulBytes, 4))));
    final ByteBuf buff = Unpooled.buffer();
    parser.serializeTlv(tlv, buff);
    assertArrayEquals(statefulBytes, ByteArray.getAllBytes(buff));
}
Also used : Stateful(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.Stateful) Stateful07StatefulCapabilityTlvParser(org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07StatefulCapabilityTlvParser) StatefulBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.StatefulBuilder) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1 Stateful07StatefulCapabilityTlvParser (org.opendaylight.protocol.pcep.ietf.stateful07.Stateful07StatefulCapabilityTlvParser)1 Stateful (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.Stateful)1 StatefulBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.stateful.capability.tlv.StatefulBuilder)1