Search in sources :

Example 1 with StatefulStatefulCapabilityTlvParser

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

the class PCEPTlvParserTest method testStatefulTlv.

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

Aggregations

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