use of org.opendaylight.protocol.bgp.evpn.impl.attributes.PMSITunnelAttributeHandler in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method testPMSITunnelAttributeParser.
@Test
public void testPMSITunnelAttributeParser() {
final PMSITunnelAttributeHandler pmsiHandler = new PMSITunnelAttributeHandler(ServiceLoaderBGPExtensionProviderContext.getSingletonInstance().getAddressFamilyRegistry());
assertEquals(22, pmsiHandler.getType());
final AttributesBuilder builder = new AttributesBuilder();
final ByteBuf emptyBuffer = Unpooled.buffer();
pmsiHandler.parseAttribute(emptyBuffer, builder);
final Attributes emptyAttributes = new AttributesBuilder().build();
assertEquals(emptyAttributes, builder.build());
pmsiHandler.serializeAttribute(emptyAttributes, emptyBuffer);
assertEquals(Unpooled.buffer(), emptyBuffer);
}
use of org.opendaylight.protocol.bgp.evpn.impl.attributes.PMSITunnelAttributeHandler in project bgpcep by opendaylight.
the class BGPActivator method registerAttributesHandler.
private static void registerAttributesHandler(final BGPExtensionProviderContext context, final List<AutoCloseable> regs) {
final PMSITunnelAttributeHandler pmsiParser = new PMSITunnelAttributeHandler(context.getAddressFamilyRegistry());
regs.add(context.registerAttributeParser(pmsiParser.getType(), pmsiParser));
regs.add(context.registerAttributeSerializer(pmsiParser.getClazz(), pmsiParser));
}
Aggregations