use of org.opendaylight.protocol.pcep.parser.tlv.NoPathVectorTlvParser in project bgpcep by opendaylight.
the class PCEPTlvParserTest method testNoPathVectorTlv.
@Test
public void testNoPathVectorTlv() throws PCEPDeserializerException {
final NoPathVectorTlvParser parser = new NoPathVectorTlvParser();
final NoPathVectorTlv tlv = new NoPathVectorBuilder().setFlags(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NoPathVectorTlv.Flags(false, true, false, true, false, true, true, true)).build();
assertEquals(tlv, parser.parseTlv(Unpooled.wrappedBuffer(ByteArray.cutBytes(noPathVectorBytes, 4))));
final ByteBuf buff = Unpooled.buffer();
parser.serializeTlv(tlv, buff);
assertArrayEquals(noPathVectorBytes, ByteArray.getAllBytes(buff));
assertNull(parser.parseTlv(null));
}
use of org.opendaylight.protocol.pcep.parser.tlv.NoPathVectorTlvParser in project bgpcep by opendaylight.
the class BaseParserExtensionActivator method registerTlvParsers.
private static void registerTlvParsers(final List<AutoCloseable> regs, final PCEPExtensionProviderContext context) {
final NoPathVectorTlvParser noPathParser = new NoPathVectorTlvParser();
regs.add(context.registerTlvParser(NoPathVectorTlvParser.TYPE, noPathParser));
regs.add(context.registerTlvSerializer(NoPathVector.class, noPathParser));
final OverloadedDurationTlvParser overloadedDurationParser = new OverloadedDurationTlvParser();
regs.add(context.registerTlvParser(OverloadedDurationTlvParser.TYPE, overloadedDurationParser));
regs.add(context.registerTlvSerializer(OverloadDuration.class, overloadedDurationParser));
final ReqMissingTlvParser reqMissingParser = new ReqMissingTlvParser();
regs.add(context.registerTlvParser(ReqMissingTlvParser.TYPE, reqMissingParser));
regs.add(context.registerTlvSerializer(ReqMissing.class, reqMissingParser));
final OFListTlvParser ofListParser = new OFListTlvParser();
regs.add(context.registerTlvParser(OFListTlvParser.TYPE, ofListParser));
regs.add(context.registerTlvSerializer(OfList.class, ofListParser));
final OrderTlvParser orderParser = new OrderTlvParser();
regs.add(context.registerTlvParser(OrderTlvParser.TYPE, orderParser));
regs.add(context.registerTlvSerializer(Order.class, orderParser));
final PathSetupTypeTlvParser pstParser = new PathSetupTypeTlvParser();
regs.add(context.registerTlvParser(PathSetupTypeTlvParser.TYPE, pstParser));
regs.add(context.registerTlvSerializer(PathSetupType.class, pstParser));
}
Aggregations