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);
}
use of org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext in project bgpcep by opendaylight.
the class ActivatorTest method testActivator.
@Test
public void testActivator() throws Exception {
final BGPActivator act = new BGPActivator(true, ServiceLoaderRSVPExtensionProviderContext.getSingletonInstance().getRsvpRegistry());
final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
assertNull(context.getAddressFamilyRegistry().classForFamily(16388));
assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(71));
act.start(context);
assertEquals(LinkstateAddressFamily.class, context.getAddressFamilyRegistry().classForFamily(16388));
assertEquals(LinkstateSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(71));
act.close();
}
use of org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext in project bgpcep by opendaylight.
the class BGPTestTool method initializeActivator.
private static BGPDispatcher initializeActivator() {
final BGPActivator activator = new BGPActivator();
final BGPExtensionProviderContext ctx = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance();
activator.start(ctx);
final org.opendaylight.protocol.bgp.inet.BGPActivator inetActivator = new org.opendaylight.protocol.bgp.inet.BGPActivator();
inetActivator.start(ctx);
final org.opendaylight.protocol.bgp.evpn.impl.BGPActivator evpnActivator = new org.opendaylight.protocol.bgp.evpn.impl.BGPActivator();
evpnActivator.start(ctx);
final SimpleFlowspecExtensionProviderContext fsContext = new SimpleFlowspecExtensionProviderContext();
final FlowspecActivator flowspecActivator = new FlowspecActivator(fsContext);
final org.opendaylight.protocol.bgp.flowspec.BGPActivator flowspecBGPActivator = new org.opendaylight.protocol.bgp.flowspec.BGPActivator(flowspecActivator);
flowspecBGPActivator.start(ctx);
final org.opendaylight.protocol.bgp.labeled.unicast.BGPActivator labeledActivator = new org.opendaylight.protocol.bgp.labeled.unicast.BGPActivator();
labeledActivator.start(ctx);
final org.opendaylight.protocol.bgp.l3vpn.ipv4.BgpIpv4Activator bgpIpv4Activator = new org.opendaylight.protocol.bgp.l3vpn.ipv4.BgpIpv4Activator();
bgpIpv4Activator.start(ctx);
final org.opendaylight.protocol.bgp.l3vpn.ipv6.BgpIpv6Activator bgpIpv6Activator = new org.opendaylight.protocol.bgp.l3vpn.ipv6.BgpIpv6Activator();
bgpIpv6Activator.start(ctx);
return new BGPDispatcherImpl(ctx.getMessageRegistry(), new NioEventLoopGroup(), new NioEventLoopGroup(), new StrictBGPPeerRegistry());
}
Aggregations