Search in sources :

Example 6 with BGPActivator

use of org.opendaylight.protocol.bgp.parser.impl.BGPActivator 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);
}
Also used : CheckUtil.checkEquals(org.opendaylight.protocol.util.CheckUtil.checkEquals) SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) Mock(org.mockito.Mock) BmpMessageRegistry(org.opendaylight.protocol.bmp.spi.registry.BmpMessageRegistry) BGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext) Mockito.timeout(org.mockito.Mockito.timeout) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) MockitoAnnotations(org.mockito.MockitoAnnotations) BmpSessionListenerFactory(org.opendaylight.protocol.bmp.api.BmpSessionListenerFactory) After(org.junit.After) BmpActivator(org.opendaylight.protocol.bmp.parser.BmpActivator) Before(org.junit.Before) BmpSession(org.opendaylight.protocol.bmp.api.BmpSession) SimpleBmpExtensionProviderContext(org.opendaylight.protocol.bmp.spi.registry.SimpleBmpExtensionProviderContext) KeyMapping(org.opendaylight.protocol.concepts.KeyMapping) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.doNothing(org.mockito.Mockito.doNothing) InetSocketAddress(java.net.InetSocketAddress) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) BGPActivator(org.opendaylight.protocol.bgp.parser.impl.BGPActivator) Mockito.verify(org.mockito.Mockito.verify) CheckUtil.waitFutureSuccess(org.opendaylight.protocol.util.CheckUtil.waitFutureSuccess) ChannelFuture(io.netty.channel.ChannelFuture) Matchers.any(org.mockito.Matchers.any) Channel(io.netty.channel.Channel) BmpDispatcher(org.opendaylight.protocol.bmp.api.BmpDispatcher) BmpDispatcherImpl(org.opendaylight.protocol.bmp.impl.BmpDispatcherImpl) BmpDispatcherImpl(org.opendaylight.protocol.bmp.impl.BmpDispatcherImpl) SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) SimpleBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext) BGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext) BGPActivator(org.opendaylight.protocol.bgp.parser.impl.BGPActivator) SimpleBmpExtensionProviderContext(org.opendaylight.protocol.bmp.spi.registry.SimpleBmpExtensionProviderContext) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) BmpMessageRegistry(org.opendaylight.protocol.bmp.spi.registry.BmpMessageRegistry) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) BmpActivator(org.opendaylight.protocol.bmp.parser.BmpActivator) Before(org.junit.Before)

Aggregations

BGPActivator (org.opendaylight.protocol.bgp.parser.impl.BGPActivator)6 BGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext)5 SimpleBGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext)5 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)4 Before (org.junit.Before)4 BmpActivator (org.opendaylight.protocol.bmp.parser.BmpActivator)4 SimpleBmpExtensionProviderContext (org.opendaylight.protocol.bmp.spi.registry.SimpleBmpExtensionProviderContext)4 InetSocketAddress (java.net.InetSocketAddress)2 BindingToNormalizedNodeCodec (org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec)2 BindingNormalizedNodeCodecRegistry (org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry)2 ModuleInfoBackedContext (org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext)2 ClusterSingletonService (org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService)2 RIBActivator (org.opendaylight.protocol.bgp.inet.RIBActivator)2 SimpleRIBExtensionProviderContext (org.opendaylight.protocol.bgp.rib.spi.SimpleRIBExtensionProviderContext)2 BmpDispatcherImpl (org.opendaylight.protocol.bmp.impl.BmpDispatcherImpl)2 DestinationIpv4Case (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.update.attributes.mp.reach.nlri.advertized.routes.destination.type.DestinationIpv4Case)2 BgpParameters (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters)2 Channel (io.netty.channel.Channel)1 ChannelFuture (io.netty.channel.ChannelFuture)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1