use of org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext in project bgpcep by opendaylight.
the class BmpDispatcherImplTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
doNothing().when(this.mockedSession).handlerRemoved(any(ChannelHandlerContext.class));
doNothing().when(this.mockedSession).handlerAdded(any(ChannelHandlerContext.class));
doNothing().when(this.mockedSession).channelRegistered(any(ChannelHandlerContext.class));
doNothing().when(this.mockedSession).channelActive(any(ChannelHandlerContext.class));
doNothing().when(this.mockedSession).channelInactive(any(ChannelHandlerContext.class));
doNothing().when(this.mockedSession).channelUnregistered(any(ChannelHandlerContext.class));
doNothing().when(this.mockedSession).channelReadComplete(any(ChannelHandlerContext.class));
this.bgpActivator = new BGPActivator();
final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
this.bgpActivator.start(context);
final SimpleBmpExtensionProviderContext ctx = new SimpleBmpExtensionProviderContext();
this.bmpActivator = new BmpActivator(context);
this.bmpActivator.start(ctx);
final BmpMessageRegistry messageRegistry = ctx.getBmpMessageRegistry();
this.dispatcher = new BmpDispatcherImpl(new NioEventLoopGroup(), new NioEventLoopGroup(), messageRegistry, (channel, sessionListenerFactory) -> BmpDispatcherImplTest.this.mockedSession);
}
use of org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext in project bgpcep by opendaylight.
the class PMSITunnelAttributeHandlerTest method setUp.
@Before
public void setUp() {
final BGPExtensionProviderContext ctx = new SimpleBGPExtensionProviderContext();
final org.opendaylight.protocol.bgp.parser.impl.BGPActivator inetActivator = new org.opendaylight.protocol.bgp.parser.impl.BGPActivator();
inetActivator.start(ctx);
final BGPActivator bgpActivator = new BGPActivator();
bgpActivator.start(ctx);
this.handler = ctx.getAttributeRegistry();
}
use of org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext in project bgpcep by opendaylight.
the class BgpIpv6ActivatorTest method testActivator.
@Test
public void testActivator() throws Exception {
final BgpIpv6Activator act = new BgpIpv6Activator();
final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
assertFalse(context.getNlriRegistry().getSerializers().iterator().hasNext());
act.start(context);
assertTrue(context.getNlriRegistry().getSerializers().iterator().next() instanceof VpnIpv6NlriParser);
act.close();
}
use of org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext in project bgpcep by opendaylight.
the class LinkstateNlriParserTest method setUp.
private void setUp(final byte[] data) throws BGPParsingException {
final LinkstateNlriParser parser = new LinkstateNlriParser();
final MpReachNlriBuilder builder = new MpReachNlriBuilder();
this.registry = SimpleNlriTypeRegistry.getInstance();
final BGPActivator act = new BGPActivator(true, ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance().getRsvpRegistry());
final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
act.start(context);
parser.parseNlri(Unpooled.copiedBuffer(data), builder);
final DestinationLinkstate ls = ((DestinationLinkstateCase) builder.getAdvertizedRoutes().getDestinationType()).getDestinationLinkstate();
assertEquals(1, ls.getCLinkstateDestination().size());
this.dest = ls.getCLinkstateDestination().get(0);
}
use of org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext in project bgpcep by opendaylight.
the class ActivatorTest method testActivator.
@Test
public void testActivator() throws Exception {
final BGPActivator act = new BGPActivator();
final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(4));
act.start(context);
assertEquals(LabeledUnicastSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(4));
act.close();
}
Aggregations