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));
}
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();
}
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();
}
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);
}
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);
}
Aggregations