Search in sources :

Example 1 with DOMSchemaService

use of org.opendaylight.mdsal.dom.api.DOMSchemaService in project bgpcep by opendaylight.

the class BgpDeployerImplTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    doReturn("mapping").when(this.tableTypeRegistry).toString();
    doReturn(Optional.of(TABLE_TYPE)).when(this.tableTypeRegistry).getTableType(any());
    doReturn(Optional.of(TABLES_KEY)).when(this.tableTypeRegistry).getTableKey(any());
    doNothing().when(this.registration).unregister();
    doReturn(this.registration).when(this.bundleContext).registerService(eq(InstanceType.RIB.getServices()), any(), any(Dictionary.class));
    doReturn(this.registration).when(this.bundleContext).registerService(eq(InstanceType.PEER.getServices()), any(), any(Dictionary.class));
    doNothing().when(this.dataTreeRegistration).close();
    doReturn("bgpPeer").when(this.modification).toString();
    final RIBExtensionConsumerContext extension = mock(RIBExtensionConsumerContext.class);
    doReturn(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy()).when(extension).getClassLoadingStrategy();
    final ClusterSingletonServiceRegistration serviceRegistration = mock(ClusterSingletonServiceRegistration.class);
    doReturn(serviceRegistration).when(this.singletonServiceProvider).registerClusterSingletonService(any());
    doNothing().when(serviceRegistration).close();
    final DOMSchemaService schemaService = mock(DOMSchemaService.class);
    doNothing().when(this.dataTreeRegistration).close();
    doReturn(this.dataTreeRegistration).when(schemaService).registerSchemaContextListener(any());
    final RibImpl ribImpl = new RibImpl(extension, mock(BGPDispatcher.class), this.policyProvider, mock(BindingCodecTreeFactory.class), getDomBroker(), getDataBroker(), schemaService);
    doReturn(ribImpl).when(this.blueprintContainer).getComponentInstance(eq("ribImpl"));
    doReturn(new BgpPeer(mock(RpcProviderRegistry.class))).when(this.blueprintContainer).getComponentInstance(eq("bgpPeer"));
    this.deployer = new BgpDeployerImpl(NETWORK_INSTANCE_NAME, this.singletonServiceProvider, this.blueprintContainer, this.bundleContext, getDataBroker(), this.tableTypeRegistry);
}
Also used : Dictionary(java.util.Dictionary) BGPDispatcher(org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher) RIBExtensionConsumerContext(org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext) BindingCodecTreeFactory(org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory) ClusterSingletonServiceRegistration(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration) DOMSchemaService(org.opendaylight.mdsal.dom.api.DOMSchemaService) Before(org.junit.Before)

Aggregations

Dictionary (java.util.Dictionary)1 Before (org.junit.Before)1 BindingCodecTreeFactory (org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory)1 DOMSchemaService (org.opendaylight.mdsal.dom.api.DOMSchemaService)1 ClusterSingletonServiceRegistration (org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration)1 BGPDispatcher (org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher)1 RIBExtensionConsumerContext (org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext)1