Search in sources :

Example 1 with DataImportBootReady

use of org.opendaylight.daexim.DataImportBootReady in project netvirt by opendaylight.

the class ElanServiceTestModule method configureBindings.

@Override
protected void configureBindings() {
    DataBroker dataBroker = DataBrokerTestModule.dataBroker();
    bind(EntityOwnershipService.class).toInstance(Mockito.mock(EntityOwnershipService.class));
    bind(INeutronVpnManager.class).toInstance(Mockito.mock(NeutronvpnManagerImpl.class));
    IVpnManager ivpnManager = Mockito.mock(VpnManagerTestImpl.class, CALLS_REAL_METHODS);
    bind(IMdsalApiManager.class).toInstance(new MDSALManager(dataBroker, Mockito.mock(PacketProcessingService.class)));
    // Bindings for external services to "real" implementations
    bind(LockManagerService.class).to(LockManagerServiceImpl.class);
    bind(ElanConfig.class).toInstance(new ElanConfigBuilder().setIntBridgeGenMac(true).setTempSmacLearnTimeout(10).build());
    // Bindings of all listeners (which are not directly referenced in the code)
    // This is required to be explicit here, because these are referenced neither from src/main nor src/test
    // and we, intentionally, don't use "classpath scanning for auto-discovery"
    // so this list must kept, manually, in line with the rc/main/resources/org/opendaylight/blueprint/*.xml
    // and target/generated-resources/org/opendaylight/blueprint/autowire.xml
    // bind(ElanGroupListener.class);
    // TODO complete this list!!! after Gerrit which adds @Inject to all listeners
    // Bindings to test infra (fakes & mocks)
    TestInterfaceManager obj = TestInterfaceManager.newInstance(dataBroker);
    ItmRpcService itmRpcService = new ItmRpcTestImpl();
    bind(DataBroker.class).toInstance(dataBroker);
    bind(DataBroker.class).annotatedWith(OsgiService.class).toInstance(dataBroker);
    bind(IdManagerService.class).toInstance(Mockito.mock(IdHelper.class, CALLS_REAL_METHODS));
    bind(IInterfaceManager.class).toInstance(obj);
    bind(TestInterfaceManager.class).toInstance(obj);
    InterfaceMetaUtils interfaceMetaUtils = new InterfaceMetaUtils(dataBroker, Mockito.mock(IdHelper.class, CALLS_REAL_METHODS), Mockito.mock(BatchingUtils.class));
    InterfaceManagerCommonUtils interfaceManagerCommonUtils = new InterfaceManagerCommonUtils(dataBroker, new MDSALManager(dataBroker, Mockito.mock(PacketProcessingService.class)), Mockito.mock(IdHelper.class, CALLS_REAL_METHODS), interfaceMetaUtils, Mockito.mock(BatchingUtils.class));
    bind(OdlInterfaceRpcService.class).toInstance(ElanEgressActionsHelper.newInstance(interfaceManagerCommonUtils));
    SingleTransactionDataBroker singleTransactionDataBroker = new SingleTransactionDataBroker(dataBroker);
    bind(SingleTransactionDataBroker.class).toInstance(singleTransactionDataBroker);
    IBgpManager ibgpManager = BgpManagerTestImpl.newInstance(singleTransactionDataBroker);
    bind(ItmRpcService.class).toInstance(itmRpcService);
    bind(ItmRpcTestImpl.class).toInstance((ItmRpcTestImpl) itmRpcService);
    bind(DataImportBootReady.class).annotatedWith(OsgiService.class).toInstance(new DataImportBootReady() {
    });
    bind(DiagStatusService.class).toInstance(Mockito.mock(DiagStatusService.class));
    bind(IVpnManager.class).toInstance(ivpnManager);
    bind(IBgpManager.class).toInstance(ibgpManager);
    bind(DataImportBootReady.class).toInstance(new DataImportBootReady() {
    });
    bind(IElanService.class).to(ElanServiceProvider.class);
    MdsalUtils mdsalUtils = new MdsalUtils(dataBroker);
    bind(MdsalUtils.class).toInstance(mdsalUtils);
    bind(SouthboundUtils.class).toInstance(new SouthboundUtils(mdsalUtils));
}
Also used : SouthboundUtils(org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils) IInterfaceManager(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager) TestInterfaceManager(org.opendaylight.genius.testutils.TestInterfaceManager) LockManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.lockmanager.rev160413.LockManagerService) IdHelper(org.opendaylight.netvirt.elanmanager.tests.utils.IdHelper) IElanService(org.opendaylight.netvirt.elanmanager.api.IElanService) SingleTransactionDataBroker(org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) NeutronvpnManagerImpl(org.opendaylight.netvirt.neutronvpn.NeutronvpnManagerImpl) InterfaceMetaUtils(org.opendaylight.genius.interfacemanager.commons.InterfaceMetaUtils) InterfaceManagerCommonUtils(org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils) MdsalUtils(org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils) OdlInterfaceRpcService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService) IVpnManager(org.opendaylight.netvirt.vpnmanager.api.IVpnManager) BatchingUtils(org.opendaylight.genius.interfacemanager.renderer.ovs.utilities.BatchingUtils) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) ElanConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.config.rev150710.ElanConfig) INeutronVpnManager(org.opendaylight.netvirt.neutronvpn.interfaces.INeutronVpnManager) SingleTransactionDataBroker(org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker) OsgiService(org.ops4j.pax.cdi.api.OsgiService) MDSALManager(org.opendaylight.genius.mdsalutil.internal.MDSALManager) ItmRpcTestImpl(org.opendaylight.genius.testutils.itm.ItmRpcTestImpl) IMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager) ElanConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.config.rev150710.ElanConfigBuilder) ItmRpcService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService) EntityOwnershipService(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService) DataImportBootReady(org.opendaylight.daexim.DataImportBootReady) DiagStatusService(org.opendaylight.infrautils.diagstatus.DiagStatusService) IBgpManager(org.opendaylight.netvirt.bgpmanager.api.IBgpManager)

Example 2 with DataImportBootReady

use of org.opendaylight.daexim.DataImportBootReady in project genius by opendaylight.

the class ItmTestModule method configureBindings.

@Override
protected void configureBindings() {
    // Bindings for services from this project
    bind(ItmRpcService.class).to(ItmManagerRpcService.class);
    bind(ItmProvider.class);
    ItmConfig itmConfigObj = new ItmConfigBuilder().setDefTzEnabled(true).setDefTzTunnelType(ITMConstants.TUNNEL_TYPE_VXLAN).setGpeExtensionEnabled(false).build();
    bind(ItmConfig.class).toInstance(itmConfigObj);
    IfmConfig interfaceConfig = new IfmConfigBuilder().setItmDirectTunnels(false).build();
    bind(IfmConfig.class).toInstance(interfaceConfig);
    bind(TunnelMonitorIntervalListener.class);
    bind(TransportZoneListener.class);
    bind(OvsdbNodeListener.class);
    bind(InterfaceStateListener.class);
    bind(VtepConfigSchemaListener.class);
    bind(TunnelMonitorChangeListener.class);
    bind(ItmTunnelEventListener.class);
    // Bindings for external services to "real" implementations
    bind(EntityOwnershipService.class).toInstance(mock(EntityOwnershipService.class));
    bind(IdManagerService.class).to(IdManager.class);
    bind(LockManagerService.class).to(LockManagerServiceImpl.class);
    DataBroker dataBroker = DataBrokerTestModule.dataBroker();
    bind(DataBroker.class).toInstance(dataBroker);
    bind(DataBroker.class).annotatedWith(OsgiService.class).toInstance(dataBroker);
    bind(InterfaceManagerService.class).to(InterfaceManagerServiceImpl.class);
    bind(IInterfaceManager.class).to(InterfacemgrProvider.class);
    bind(ServiceRecoveryRegistry.class).toInstance(mock(ServiceRecoveryRegistry.class));
    // Bindings to test infra (fakes & mocks)
    TestIMdsalApiManager mdsalManager = TestIMdsalApiManager.newInstance();
    bind(IMdsalApiManager.class).toInstance(mdsalManager);
    bind(TestIMdsalApiManager.class).toInstance(mdsalManager);
    bind(DataImportBootReady.class).annotatedWith(OsgiService.class).toInstance(new DataImportBootReady() {
    });
    bind(DiagStatusService.class).toInstance(mock(DiagStatusService.class));
}
Also used : InterfaceManagerService(org.opendaylight.genius.interfacemanager.interfaces.InterfaceManagerService) IInterfaceManager(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager) ItmConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfigBuilder) TestIMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager) IMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager) LockManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.lockmanager.rev160413.LockManagerService) TestIMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) ItmRpcService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService) ItmConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.ItmConfig) IfmConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.config.rev160406.IfmConfig) EntityOwnershipService(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) IfmConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.config.rev160406.IfmConfigBuilder) ServiceRecoveryRegistry(org.opendaylight.genius.srm.ServiceRecoveryRegistry) DataImportBootReady(org.opendaylight.daexim.DataImportBootReady) DiagStatusService(org.opendaylight.infrautils.diagstatus.DiagStatusService) OsgiService(org.ops4j.pax.cdi.api.OsgiService)

Example 3 with DataImportBootReady

use of org.opendaylight.daexim.DataImportBootReady in project genius by opendaylight.

the class InterfaceManagerTestModule method configureBindings.

@Override
protected void configureBindings() throws UnknownHostException {
    // Bindings for services from this project
    // Bindings for external services to "real" implementations
    // Bindings to test infra (fakes & mocks)
    DataBrokerTestModule dataBrokerTestModule = new DataBrokerTestModule(false);
    DataBroker dataBroker = dataBrokerTestModule.getDataBroker();
    bind(DataBroker.class).toInstance(dataBroker);
    bind(DataBroker.class).annotatedWith(OsgiService.class).toInstance(dataBroker);
    bind(DataImportBootReady.class).annotatedWith(OsgiService.class).toInstance(new DataImportBootReady() {
    });
    bind(LockManagerService.class).to(LockManagerServiceImpl.class);
    bind(LockListener.class);
    bind(IdManagerService.class).to(IdManager.class);
    bind(IInterfaceManager.class).to(InterfacemgrProvider.class);
    TestIMdsalApiManager mdsalManager = TestIMdsalApiManager.newInstance();
    bind(IMdsalApiManager.class).toInstance(mdsalManager);
    bind(TestIMdsalApiManager.class).toInstance(mdsalManager);
    bind(AbstractTestableListener.class).to(TestableDataTreeChangeListener.class);
    bind(JobCoordinatorCountedEventsWaiter.class).to(TestableJobCoordinatorCountedEventsWaiter.class);
    bind(InterfaceManagerService.class).to(InterfaceManagerServiceImpl.class);
    bind(ServiceRecoveryRegistry.class).toInstance(mock(ServiceRecoveryRegistry.class));
    EntityOwnershipService entityOwnershipService = new BindingDOMEntityOwnershipServiceAdapter(new SimpleDOMEntityOwnershipService(), dataBrokerTestModule.getBindingToNormalizedNodeCodec());
    bind(EntityOwnershipService.class).toInstance(entityOwnershipService);
    bind(EntityOwnershipUtils.class);
    bind(AlivenessMonitorService.class).toInstance(mock(AlivenessMonitorService.class));
    bind(OdlInterfaceRpcService.class).to(InterfaceManagerRpcService.class);
    bind(CacheBridgeEntryConfigListener.class);
    bind(CacheBridgeRefEntryListener.class);
    bind(FlowBasedServicesConfigListener.class);
    bind(FlowBasedServicesInterfaceStateListener.class);
    bind(HwVTEPConfigListener.class);
    bind(HwVTEPTunnelsStateListener.class);
    bind(InterfaceConfigListener.class);
    bind(InterfaceInventoryStateListener.class);
    bind(InterfaceTopologyStateListener.class);
    bind(TerminationPointStateListener.class);
    bind(VlanMemberConfigListener.class);
    bind(InterfaceStateListener.class);
    bind(HwvtepNodeHACache.class).toInstance(mock(HwvtepNodeHACache.class));
    bind(IfmConfig.class).toInstance(mock(IfmConfig.class));
}
Also used : InterfaceManagerService(org.opendaylight.genius.interfacemanager.interfaces.InterfaceManagerService) IInterfaceManager(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager) TestIMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager) IMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager) AbstractTestableListener(org.opendaylight.genius.datastoreutils.testutils.AbstractTestableListener) AlivenessMonitorService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.alivenessmonitor.rev160411.AlivenessMonitorService) LockManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.lockmanager.rev160413.LockManagerService) TestIMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) HwvtepNodeHACache(org.opendaylight.genius.utils.hwvtep.HwvtepNodeHACache) OdlInterfaceRpcService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService) DataBrokerTestModule(org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule) IfmConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.config.rev160406.IfmConfig) JobCoordinatorCountedEventsWaiter(org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorCountedEventsWaiter) TestableJobCoordinatorCountedEventsWaiter(org.opendaylight.genius.datastoreutils.testutils.TestableJobCoordinatorCountedEventsWaiter) EntityOwnershipService(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService) SimpleDOMEntityOwnershipService(org.opendaylight.mdsal.eos.dom.simple.SimpleDOMEntityOwnershipService) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) SimpleDOMEntityOwnershipService(org.opendaylight.mdsal.eos.dom.simple.SimpleDOMEntityOwnershipService) ServiceRecoveryRegistry(org.opendaylight.genius.srm.ServiceRecoveryRegistry) BindingDOMEntityOwnershipServiceAdapter(org.opendaylight.mdsal.eos.binding.dom.adapter.BindingDOMEntityOwnershipServiceAdapter) DataImportBootReady(org.opendaylight.daexim.DataImportBootReady) OsgiService(org.ops4j.pax.cdi.api.OsgiService)

Example 4 with DataImportBootReady

use of org.opendaylight.daexim.DataImportBootReady in project genius by opendaylight.

the class ResourceManagerTestModule method configureBindings.

@Override
protected void configureBindings() throws Exception {
    DataBroker dataBroker = DataBrokerTestModule.dataBroker();
    bind(DataBroker.class).toInstance(dataBroker);
    bind(DataImportBootReady.class).toInstance(new DataImportBootReady() {
    });
    bind(LockManagerService.class).to(LockManagerServiceImpl.class);
    bind(LockListener.class);
    bind(IdManagerService.class).to(IdManager.class);
    bind(ResourceManagerService.class).to(ResourceManager.class);
}
Also used : ResourceManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.resourcemanager.rev160622.ResourceManagerService) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) LockManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.lockmanager.rev160413.LockManagerService) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) DataImportBootReady(org.opendaylight.daexim.DataImportBootReady)

Example 5 with DataImportBootReady

use of org.opendaylight.daexim.DataImportBootReady in project genius by opendaylight.

the class IdManagerTestModule method configureBindings.

@Override
protected void configureBindings() {
    bind(DataImportBootReady.class).annotatedWith(OsgiService.class).toInstance(new DataImportBootReady() {
    });
    bind(IdManagerService.class).to(IdManager.class);
    bind(LockManagerService.class).to(LockManagerServiceImpl.class);
    TestIMdsalApiManager mdsalManager = TestIMdsalApiManager.newInstance();
    bind(IMdsalApiManager.class).toInstance(mdsalManager);
    bind(TestIMdsalApiManager.class).toInstance(mdsalManager);
    bind(LockListener.class);
    bind(IdPoolListener.class);
    bind(JobCoordinatorEventsWaiter.class).to(TestableJobCoordinatorEventsWaiter.class);
    DataBroker dataBroker = DataBrokerTestModule.dataBroker();
    bind(DataBroker.class).toInstance(dataBroker);
    bind(DataBroker.class).annotatedWith(OsgiService.class).toInstance(dataBroker);
}
Also used : JobCoordinatorEventsWaiter(org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorEventsWaiter) TestableJobCoordinatorEventsWaiter(org.opendaylight.genius.datastoreutils.testutils.TestableJobCoordinatorEventsWaiter) TestIMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager) IMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager) IdManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService) LockManagerService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.lockmanager.rev160413.LockManagerService) TestIMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager) DataImportBootReady(org.opendaylight.daexim.DataImportBootReady) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) OsgiService(org.ops4j.pax.cdi.api.OsgiService)

Aggregations

DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)5 DataImportBootReady (org.opendaylight.daexim.DataImportBootReady)5 IdManagerService (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService)5 LockManagerService (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.lockmanager.rev160413.LockManagerService)5 IMdsalApiManager (org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager)4 OsgiService (org.ops4j.pax.cdi.api.OsgiService)4 IInterfaceManager (org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager)3 TestIMdsalApiManager (org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager)3 EntityOwnershipService (org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService)3 InterfaceManagerService (org.opendaylight.genius.interfacemanager.interfaces.InterfaceManagerService)2 ServiceRecoveryRegistry (org.opendaylight.genius.srm.ServiceRecoveryRegistry)2 DiagStatusService (org.opendaylight.infrautils.diagstatus.DiagStatusService)2 IfmConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.config.rev160406.IfmConfig)2 OdlInterfaceRpcService (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService)2 ItmRpcService (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.ItmRpcService)2 DataBrokerTestModule (org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule)1 SingleTransactionDataBroker (org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker)1 AbstractTestableListener (org.opendaylight.genius.datastoreutils.testutils.AbstractTestableListener)1 JobCoordinatorCountedEventsWaiter (org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorCountedEventsWaiter)1 JobCoordinatorEventsWaiter (org.opendaylight.genius.datastoreutils.testutils.JobCoordinatorEventsWaiter)1