use of org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext 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.pojo.SimpleBGPExtensionProviderContext in project bgpcep by opendaylight.
the class AbstractAddPathTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
this.ribActivator = new RIBActivator();
this.ribExtension = new SimpleRIBExtensionProviderContext();
this.ribActivator.startRIBExtensionProvider(this.ribExtension);
this.bgpActivator = new BGPActivator();
this.inetActivator = new org.opendaylight.protocol.bgp.inet.BGPActivator();
this.context = new SimpleBGPExtensionProviderContext();
this.bgpActivator.start(this.context);
this.inetActivator.start(this.context);
this.mappingService = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(), new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()))));
final ModuleInfoBackedContext moduleInfoBackedContext = ModuleInfoBackedContext.create();
moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(BgpParameters.class));
moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(MultiprotocolCapability.class));
moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(DestinationIpv4Case.class));
moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(AdvertizedRoutes.class));
moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(BgpRib.class));
moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(Attributes1.class));
moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(MpReachNlri.class));
this.mappingService.onGlobalContextUpdated(moduleInfoBackedContext.tryToCreateSchemaContext().get());
this.schemaContext = moduleInfoBackedContext.getSchemaContext();
if (!Epoll.isAvailable()) {
this.worker = new NioEventLoopGroup();
this.boss = new NioEventLoopGroup();
}
this.serverRegistry = new StrictBGPPeerRegistry();
this.serverDispatcher = new BGPDispatcherImpl(this.context.getMessageRegistry(), this.boss, this.worker, this.serverRegistry);
doReturn(Mockito.mock(ClusterSingletonServiceRegistration.class)).when(this.clusterSingletonServiceProvider).registerClusterSingletonService(any(ClusterSingletonService.class));
this.codecsRegistry = CodecsRegistryImpl.create(this.mappingService.getCodecFactory(), this.ribExtension.getClassLoadingStrategy());
}
use of org.opendaylight.protocol.bgp.parser.spi.pojo.SimpleBGPExtensionProviderContext 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.pojo.SimpleBGPExtensionProviderContext 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.pojo.SimpleBGPExtensionProviderContext in project bgpcep by opendaylight.
the class BGPActivatorTest method testActivator.
@Test
public void testActivator() throws Exception {
final BGPActivator act = new BGPActivator();
final BGPExtensionProviderContext context = new SimpleBGPExtensionProviderContext();
assertNull(context.getAddressFamilyRegistry().classForFamily(L2VPN_AFI));
assertNull(context.getSubsequentAddressFamilyRegistry().classForFamily(EVPN_SAFI));
act.start(context);
assertEquals(L2vpnAddressFamily.class, context.getAddressFamilyRegistry().classForFamily(L2VPN_AFI));
assertEquals(EvpnSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(EVPN_SAFI));
act.close();
}
Aggregations