use of org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext in project bgpcep by opendaylight.
the class AbstractRIBTestSetup method mockRib.
public void mockRib() throws Exception {
final RIBExtensionProviderContext context = new SimpleRIBExtensionProviderContext();
final ModuleInfoBackedContext strategy = createClassLoadingStrategy();
final SchemaContext schemaContext = strategy.tryToCreateSchemaContext().get();
this.codecFactory = createCodecFactory(strategy, schemaContext);
final List<BgpTableType> localTables = new ArrayList<>();
localTables.add(new BgpTableTypeImpl(AFI, SAFI));
this.a1 = new RIBActivator();
this.a1.startRIBExtensionProvider(context);
final CodecsRegistryImpl codecsRegistry = CodecsRegistryImpl.create(this.codecFactory, GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy());
mockedMethods();
doReturn(mock(ClusterSingletonServiceRegistration.class)).when(this.clusterSingletonServiceProvider).registerClusterSingletonService(any(ClusterSingletonService.class));
this.rib = new RIBImpl(new RibId("test"), new AsNumber(5L), RIB_ID, context, this.dispatcher, codecsRegistry, this.dom, getDataBroker(), this.policies, this.peerTracker, localTables, Collections.singletonMap(new TablesKey(AFI, SAFI), BasePathSelectionModeFactory.createBestPathSelectionStrategy(this.peerTracker)));
this.rib.onGlobalContextUpdated(schemaContext);
this.ribSupport = getRib().getRibSupportContext().getRIBSupport(KEY);
}
use of org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext in project bgpcep by opendaylight.
the class RIBActivatorTest method testRIBActivator.
@Test
public void testRIBActivator() {
final RIBActivator ribAct = new RIBActivator();
final RIBExtensionProviderContext context = new SimpleRIBExtensionProviderContext();
assertNull(context.getRIBSupport(L2vpnAddressFamily.class, EvpnSubsequentAddressFamily.class));
ribAct.startRIBExtensionProvider(context);
assertNotNull(context.getRIBSupport(L2vpnAddressFamily.class, EvpnSubsequentAddressFamily.class));
ribAct.close();
}
use of org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext in project bgpcep by opendaylight.
the class ActivatorTest method testRIBActivator.
@Test
public void testRIBActivator() {
final RIBActivator ribAct = new RIBActivator();
final RIBExtensionProviderContext context = new SimpleRIBExtensionProviderContext();
assertNull(context.getRIBSupport(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class));
ribAct.startRIBExtensionProvider(context);
assertNotNull(context.getRIBSupport(LinkstateAddressFamily.class, LinkstateSubsequentAddressFamily.class));
ribAct.close();
}
Aggregations