Search in sources :

Example 1 with BmpMessageRegistry

use of org.opendaylight.protocol.bmp.spi.registry.BmpMessageRegistry 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

Channel (io.netty.channel.Channel)1 ChannelFuture (io.netty.channel.ChannelFuture)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)1 InetSocketAddress (java.net.InetSocketAddress)1 After (org.junit.After)1 Assert.assertTrue (org.junit.Assert.assertTrue)1 Before (org.junit.Before)1 Test (org.junit.Test)1 Matchers.any (org.mockito.Matchers.any)1 Mock (org.mockito.Mock)1 Mockito.doNothing (org.mockito.Mockito.doNothing)1 Mockito.timeout (org.mockito.Mockito.timeout)1 Mockito.verify (org.mockito.Mockito.verify)1 MockitoAnnotations (org.mockito.MockitoAnnotations)1 BGPActivator (org.opendaylight.protocol.bgp.parser.impl.BGPActivator)1 BGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext)1 SimpleBGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext)1 BmpDispatcher (org.opendaylight.protocol.bmp.api.BmpDispatcher)1 BmpSession (org.opendaylight.protocol.bmp.api.BmpSession)1