Search in sources :

Example 1 with IITMProvider

use of org.opendaylight.genius.itm.api.IITMProvider in project netvirt by opendaylight.

the class ElanServiceTestModule method configureBindings.

@Override
protected void configureBindings() {
    DataBroker dataBroker = DataBrokerTestModule.dataBroker();
    EntityOwnershipService mockedEntityOwnershipService = mock(EntityOwnershipService.class);
    EntityOwnershipState mockedEntityOwnershipState = EntityOwnershipState.IS_OWNER;
    Mockito.when(mockedEntityOwnershipService.getOwnershipState(Mockito.any())).thenReturn(Optional.of(mockedEntityOwnershipState));
    bind(EntityOwnershipService.class).toInstance(mockedEntityOwnershipService);
    bind(L2GatewayCache.class).to(L2GatewayCacheImpl.class);
    bind(HwvtepHACache.class).toInstance(mock(HwvtepHACache.class));
    bind(ServiceRecoveryRegistry.class).toInstance(mock(ServiceRecoveryRegistry.class));
    bind(INeutronVpnManager.class).toInstance(mock(NeutronvpnManagerImpl.class));
    IVpnManager ivpnManager = mock(VpnManagerTestImpl.class, CALLS_REAL_METHODS);
    MDSALManager mockedMdsalManager = new MDSALManager(dataBroker, mock(PacketProcessingService.class));
    bind(IMdsalApiManager.class).toInstance(mockedMdsalManager);
    // Bindings for external services to "real" implementations
    bind(LockManagerService.class).to(LockManagerServiceImpl.class);
    bind(ElanConfig.class).toInstance(new ElanConfigBuilder().setIntBridgeGenMac(true).setTempSmacLearnTimeout(Uint16.TEN).build());
    bind(MetricProvider.class).toInstance(new TestMetricProviderImpl());
    // 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 testInterfaceManager = TestInterfaceManager.newInstance(dataBroker);
    IITMProvider testItmProvider = TestItmProvider.newInstance();
    ItmRpcService itmRpcService = new ItmRpcTestImpl();
    bind(DataBroker.class).toInstance(dataBroker);
    bind(IdManagerService.class).toInstance(mock(IdHelper.class, CALLS_REAL_METHODS));
    bind(IInterfaceManager.class).toInstance(testInterfaceManager);
    bind(TestInterfaceManager.class).toInstance(testInterfaceManager);
    bind(IITMProvider.class).toInstance(testItmProvider);
    InterfaceMetaUtils interfaceMetaUtils = new InterfaceMetaUtils(dataBroker, mock(IdHelper.class, CALLS_REAL_METHODS), mock(BatchingUtils.class));
    InterfaceManagerCommonUtils interfaceManagerCommonUtils = new InterfaceManagerCommonUtils(dataBroker, mockedMdsalManager, mock(IdHelper.class, CALLS_REAL_METHODS), interfaceMetaUtils, mock(BatchingUtils.class));
    bind(OdlInterfaceRpcService.class).toInstance(ElanEgressActionsHelper.newInstance(interfaceManagerCommonUtils, testInterfaceManager));
    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).toInstance(new DataImportBootReady() {
    });
    bind(DiagStatusService.class).toInstance(mock(DiagStatusService.class));
    bind(IVpnManager.class).toInstance(ivpnManager);
    bind(IBgpManager.class).toInstance(ibgpManager);
    bind(IElanService.class).to(ElanServiceProvider.class);
    MdsalUtils mdsalUtils = new MdsalUtils(dataBroker);
    bind(MdsalUtils.class).toInstance(mdsalUtils);
    bind(SouthboundUtils.class).toInstance(new SouthboundUtils(mdsalUtils));
    bind(IL2gwService.class).toInstance(mock(IL2gwService.class));
}
Also used : SouthboundUtils(org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils) IL2gwService(org.opendaylight.netvirt.elanmanager.api.IL2gwService) IInterfaceManager(org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager) TestInterfaceManager(org.opendaylight.genius.testutils.TestInterfaceManager) L2GatewayCache(org.opendaylight.netvirt.neutronvpn.api.l2gw.L2GatewayCache) 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.mdsal.binding.api.DataBroker) NeutronvpnManagerImpl(org.opendaylight.netvirt.neutronvpn.NeutronvpnManagerImpl) PacketProcessingService(org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService) 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) EntityOwnershipState(org.opendaylight.mdsal.eos.common.api.EntityOwnershipState) TestMetricProviderImpl(org.opendaylight.infrautils.metrics.testimpl.TestMetricProviderImpl) 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) HwvtepHACache(org.opendaylight.genius.utils.hwvtep.HwvtepHACache) MDSALManager(org.opendaylight.genius.mdsalutil.internal.MDSALManager) ItmRpcTestImpl(org.opendaylight.genius.testutils.itm.ItmRpcTestImpl) IMdsalApiManager(org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager) IITMProvider(org.opendaylight.genius.itm.api.IITMProvider) 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) MetricProvider(org.opendaylight.infrautils.metrics.MetricProvider) EntityOwnershipService(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService) ServiceRecoveryRegistry(org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry) DataImportBootReady(org.opendaylight.daexim.DataImportBootReady) DiagStatusService(org.opendaylight.infrautils.diagstatus.DiagStatusService) IBgpManager(org.opendaylight.netvirt.bgpmanager.api.IBgpManager)

Aggregations

DataImportBootReady (org.opendaylight.daexim.DataImportBootReady)1 SingleTransactionDataBroker (org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker)1 InterfaceManagerCommonUtils (org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils)1 InterfaceMetaUtils (org.opendaylight.genius.interfacemanager.commons.InterfaceMetaUtils)1 IInterfaceManager (org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager)1 BatchingUtils (org.opendaylight.genius.interfacemanager.renderer.ovs.utilities.BatchingUtils)1 IITMProvider (org.opendaylight.genius.itm.api.IITMProvider)1 IMdsalApiManager (org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager)1 MDSALManager (org.opendaylight.genius.mdsalutil.internal.MDSALManager)1 TestInterfaceManager (org.opendaylight.genius.testutils.TestInterfaceManager)1 ItmRpcTestImpl (org.opendaylight.genius.testutils.itm.ItmRpcTestImpl)1 HwvtepHACache (org.opendaylight.genius.utils.hwvtep.HwvtepHACache)1 DiagStatusService (org.opendaylight.infrautils.diagstatus.DiagStatusService)1 MetricProvider (org.opendaylight.infrautils.metrics.MetricProvider)1 TestMetricProviderImpl (org.opendaylight.infrautils.metrics.testimpl.TestMetricProviderImpl)1 DataBroker (org.opendaylight.mdsal.binding.api.DataBroker)1 EntityOwnershipService (org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService)1 EntityOwnershipState (org.opendaylight.mdsal.eos.common.api.EntityOwnershipState)1 IBgpManager (org.opendaylight.netvirt.bgpmanager.api.IBgpManager)1 IElanService (org.opendaylight.netvirt.elanmanager.api.IElanService)1