use of org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager in project netvirt by opendaylight.
the class AclServiceTestModule method configure.
@Override
protected void configure() {
bind(DataBroker.class).toInstance(DataBrokerTestModule.dataBroker());
bind(AclserviceConfig.class).toInstance(aclServiceConfig());
bind(AclClusterUtil.class).toInstance(() -> true);
TestIMdsalApiManager singleton = TestIMdsalApiManager.newInstance();
bind(IMdsalApiManager.class).toInstance(singleton);
bind(TestIMdsalApiManager.class).toInstance(singleton);
bind(IdManagerService.class).toInstance(Mockito.mock(TestIdManagerService.class, realOrException()));
bind(OpendaylightDirectStatisticsService.class).toInstance(Mockito.mock(TestOdlDirectStatisticsService.class, realOrException()));
bind(JobCoordinatorEventsWaiter.class).to(TestableJobCoordinatorEventsWaiter.class);
bind(AclInterfaceCache.class).toInstance(new AclInterfaceCacheImpl());
bind(ServiceRecoveryRegistry.class).toInstance(mock(ServiceRecoveryRegistry.class));
}
use of org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager 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));
}
use of org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager 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));
}
use of org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager 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);
}
Aggregations