Search in sources :

Example 1 with StatementRegistry

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry in project bgpcep by opendaylight.

the class AbstractStatementRegistryConsumerTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    this.statementRegistry = new StatementRegistry(getDataBroker());
    final StatementActivator activator = new StatementActivator(getDataBroker());
    activator.start(this.statementRegistry);
}
Also used : StatementRegistry(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry) Before(org.junit.Before)

Example 2 with StatementRegistry

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry in project bgpcep by opendaylight.

the class AbstractStatementRegistryTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    this.statementRegistry = new StatementRegistry(getDataBroker());
}
Also used : StatementRegistry(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry) Before(org.junit.Before)

Example 3 with StatementRegistry

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry in project bgpcep by opendaylight.

the class BgpDeployerTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    doReturn("mapping").when(tableTypeRegistry).toString();
    doReturn(TABLE_TYPE).when(tableTypeRegistry).getTableType(any());
    doReturn(TABLES_KEY).when(tableTypeRegistry).getTableKey(any());
    final ClusterSingletonServiceRegistration serviceRegistration = mock(ClusterSingletonServiceRegistration.class);
    doReturn(serviceRegistration).when(singletonServiceProvider).registerClusterSingletonService(any());
    doNothing().when(serviceRegistration).close();
    final Future future = mock(BGPReconnectPromise.class);
    doReturn(true).when(future).cancel(true);
    doReturn(future).when(dispatcher).createReconnectingClient(any(), any(), anyInt(), any());
    deployer = spy(new DefaultBgpDeployer(NETWORK_INSTANCE_NAME, singletonServiceProvider, rpcRegistry, extensionContext, dispatcher, new DefaultBGPRibRoutingPolicyFactory(getDataBroker(), new StatementRegistry()), codecsRegistry, getDomBroker(), getDataBroker(), tableTypeRegistry, stateProviderRegistry));
    bgpSingletonObtainedLatch = new CountDownLatch(1);
    doAnswer(invocationOnMock -> {
        final BGPClusterSingletonService real = (BGPClusterSingletonService) invocationOnMock.callRealMethod();
        if (spiedBgpSingletonService == null) {
            spiedBgpSingletonService = spy(real);
        }
        bgpSingletonObtainedLatch.countDown();
        return spiedBgpSingletonService;
    }).when(deployer).getBgpClusterSingleton(any());
}
Also used : DefaultBGPRibRoutingPolicyFactory(org.opendaylight.protocol.bgp.openconfig.routing.policy.impl.DefaultBGPRibRoutingPolicyFactory) ClusterSingletonServiceRegistration(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration) Future(io.netty.util.concurrent.Future) StatementRegistry(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry) CountDownLatch(java.util.concurrent.CountDownLatch) Before(org.junit.Before)

Example 4 with StatementRegistry

use of org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry in project bgpcep by opendaylight.

the class OSGiStatementRegistry method activate.

@Activate
void activate() {
    delegate = new StatementRegistry();
    LOG.info("Starting {} StatementProviderActivator instances", activators.size());
    activators.forEach(activator -> activator.start(delegate));
}
Also used : StatementRegistry(org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

StatementRegistry (org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry)4 Before (org.junit.Before)3 Future (io.netty.util.concurrent.Future)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ClusterSingletonServiceRegistration (org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration)1 DefaultBGPRibRoutingPolicyFactory (org.opendaylight.protocol.bgp.openconfig.routing.policy.impl.DefaultBGPRibRoutingPolicyFactory)1 Activate (org.osgi.service.component.annotations.Activate)1