Search in sources :

Example 6 with BGPExtensionProviderContext

use of org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext in project bgpcep by opendaylight.

the class BmpMock method initiateMock.

private static BmpMockDispatcher initiateMock(final BmpMockArguments arguments) {
    final BGPExtensionProviderContext bgpCtx = new SimpleBGPExtensionProviderContext();
    final BGPActivator bgpActivator = new BGPActivator();
    bgpActivator.start(bgpCtx);
    final BmpExtensionProviderContext ctx = new SimpleBmpExtensionProviderContext();
    final BmpExtensionProviderActivator bmpActivator = new BmpActivator(bgpCtx);
    bmpActivator.start(ctx);
    return new BmpMockDispatcher(ctx.getBmpMessageRegistry(), new BmpMockSessionFactory(arguments));
}
Also used : BmpExtensionProviderContext(org.opendaylight.protocol.bmp.spi.registry.BmpExtensionProviderContext) SimpleBmpExtensionProviderContext(org.opendaylight.protocol.bmp.spi.registry.SimpleBmpExtensionProviderContext) 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) BmpExtensionProviderActivator(org.opendaylight.protocol.bmp.spi.registry.BmpExtensionProviderActivator) BmpActivator(org.opendaylight.protocol.bmp.parser.BmpActivator)

Example 7 with BGPExtensionProviderContext

use of org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext in project bgpcep by opendaylight.

the class AbstractBmpMessageTest method setUp.

@Before
public final void setUp() {
    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);
    this.messageRegistry = ctx.getBmpMessageRegistry();
}
Also used : 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) BmpActivator(org.opendaylight.protocol.bmp.parser.BmpActivator) Before(org.junit.Before)

Example 8 with BGPExtensionProviderContext

use of org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext in project bgpcep by opendaylight.

the class BgpIpv4ActivatorTest method testActivator.

@Test
public void testActivator() throws Exception {
    final BgpIpv4Activator act = new BgpIpv4Activator();
    final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
    assertFalse(context.getNlriRegistry().getSerializers().iterator().hasNext());
    act.start(context);
    assertTrue(context.getNlriRegistry().getSerializers().iterator().next() instanceof VpnIpv4NlriParser);
    act.close();
}
Also used : 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) Test(org.junit.Test)

Example 9 with BGPExtensionProviderContext

use of org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext in project bgpcep by opendaylight.

the class AbstractBGPDispatcherTest method setUp.

@Before
public void setUp() {
    if (!Epoll.isAvailable()) {
        this.boss = new NioEventLoopGroup();
        this.worker = new NioEventLoopGroup();
    }
    this.registry = new StrictBGPPeerRegistry();
    this.clientListener = new SimpleSessionListener();
    this.serverListener = new SimpleSessionListener();
    final BGPExtensionProviderContext ctx = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance();
    this.serverDispatcher = new BGPDispatcherImpl(ctx.getMessageRegistry(), this.boss, this.worker, this.registry);
    this.clientAddress = InetSocketAddressUtil.getRandomLoopbackInetSocketAddress();
    final IpAddress clientPeerIp = new IpAddress(new Ipv4Address(this.clientAddress.getAddress().getHostAddress()));
    this.registry.addPeer(clientPeerIp, this.clientListener, createPreferences(this.clientAddress));
    this.clientDispatcher = new BGPDispatcherImpl(ctx.getMessageRegistry(), this.boss, this.worker, this.registry);
}
Also used : BGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext) ServiceLoaderBGPExtensionProviderContext(org.opendaylight.protocol.bgp.parser.spi.pojo.ServiceLoaderBGPExtensionProviderContext) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address) Before(org.junit.Before)

Example 10 with BGPExtensionProviderContext

use of org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext in project bgpcep by opendaylight.

the class SrAttributeParserTest method setUp.

@Before
public void setUp() throws Exception {
    final BGPActivator act = new BGPActivator(true, ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance().getRsvpRegistry());
    final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
    act.start(context);
}
Also used : 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.linkstate.impl.BGPActivator) Before(org.junit.Before)

Aggregations

BGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext)20 SimpleBGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext)15 Test (org.junit.Test)10 Before (org.junit.Before)7 ServiceLoaderBGPExtensionProviderContext (org.opendaylight.protocol.bgp.parser.spi.pojo.ServiceLoaderBGPExtensionProviderContext)6 BGPActivator (org.opendaylight.protocol.bgp.parser.impl.BGPActivator)5 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)4 BmpActivator (org.opendaylight.protocol.bmp.parser.BmpActivator)4 SimpleBmpExtensionProviderContext (org.opendaylight.protocol.bmp.spi.registry.SimpleBmpExtensionProviderContext)4 ByteBuf (io.netty.buffer.ByteBuf)3 BGPActivator (org.opendaylight.protocol.bgp.linkstate.impl.BGPActivator)3 Attributes (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.path.attributes.Attributes)3 InetSocketAddress (java.net.InetSocketAddress)2 FlowspecActivator (org.opendaylight.protocol.bgp.flowspec.FlowspecActivator)2 SimpleFlowspecExtensionProviderContext (org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecExtensionProviderContext)2 BmpDispatcherImpl (org.opendaylight.protocol.bmp.impl.BmpDispatcherImpl)2 Channel (io.netty.channel.Channel)1 ChannelFuture (io.netty.channel.ChannelFuture)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 After (org.junit.After)1