use of org.opendaylight.mdsal.binding.testutils.DataBrokerTestModule in project genius by opendaylight.
the class InterfaceManagerTestModule method configureBindings.
@Override
protected void configureBindings() {
// 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(DataTreeEventCallbackRegistrar.class).toInstance(mock(DataTreeEventCallbackRegistrar.class));
bind(ManagedNewTransactionRunner.class).toInstance(mock(ManagedNewTransactionRunner.class));
bind(DataImportBootReady.class).toInstance(new DataImportBootReady() {
});
bind(LockManagerService.class).to(LockManagerServiceImpl.class);
bind(LockListener.class);
bind(IdManagerService.class).to(IdManager.class);
bind(ShardStatusMonitor.class).toInstance(TestShardStatusMonitor.newInstance());
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(), new ConstantAdapterContext(dataBrokerTestModule.getBindingToNormalizedNodeCodec()));
bind(EntityOwnershipService.class).toInstance(entityOwnershipService);
bind(EntityOwnershipUtils.class);
bind(AlivenessMonitorService.class).toInstance(mock(AlivenessMonitorService.class));
bind(TombstonedNodeManager.class).toInstance(mock(TombstonedNodeManager.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(HwvtepHACache.class).toInstance(mock(HwvtepHACache.class));
bind(IfmConfig.class).toInstance(mock(IfmConfig.class));
bind(CacheProvider.class).toInstance(mock(CacheProvider.class));
bind(IfmDiagStatusProvider.class).toInstance(mock(IfmDiagStatusProvider.class));
}
use of org.opendaylight.mdsal.binding.testutils.DataBrokerTestModule 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).setPortname("").setVlanId(Uint16.ZERO).setUseOfTunnels(true).build();
bind(ItmConfig.class).toInstance(itmConfigObj);
IfmConfig interfaceConfig = new IfmConfigBuilder().setItmDirectTunnels(false).setItmOfTunnels(false).build();
bind(IfmConfig.class).toInstance(interfaceConfig);
bind(TunnelMonitorIntervalListener.class);
bind(TransportZoneListener.class);
bind(OvsdbNodeListener.class);
bind(InterfaceStateListener.class);
bind(TunnelMonitorChangeListener.class);
bind(ItmTunnelEventListener.class);
// Bindings for external services to "real" implementations
bind(IdManagerService.class).to(IdManager.class);
bind(LockManagerService.class).to(LockManagerServiceImpl.class);
bind(JobCoordinatorEventsWaiter.class).to(TestableJobCoordinatorEventsWaiter.class);
DataBrokerTestModule dataBrokerTestModule = new DataBrokerTestModule(false);
DataBroker dataBroker = dataBrokerTestModule.getDataBroker();
bind(DataBroker.class).toInstance(dataBroker);
DataTreeEventCallbackRegistrar dataTreeEventCallbackRegistrar = new DataTreeEventCallbackRegistrarImpl(dataBroker);
bind(DataTreeEventCallbackRegistrar.class).toInstance(dataTreeEventCallbackRegistrar);
bind(InterfaceManagerService.class).to(InterfaceManagerServiceImpl.class);
bind(OdlInterfaceRpcService.class).to(InterfaceManagerRpcService.class);
bind(IInterfaceManager.class).to(InterfacemgrProvider.class);
bind(ServiceRecoveryRegistry.class).toInstance(mock(ServiceRecoveryRegistry.class));
bind(ItmDiagStatusProvider.class).toInstance(mock(ItmDiagStatusProvider.class));
EntityOwnershipService entityOwnershipService = new BindingDOMEntityOwnershipServiceAdapter(new SimpleDOMEntityOwnershipService(), new ConstantAdapterContext(dataBrokerTestModule.getBindingToNormalizedNodeCodec()));
bind(EntityOwnershipService.class).toInstance(entityOwnershipService);
bind(EntityOwnershipUtils.class);
bind(TombstonedNodeManager.class).to(TombstonedNodeManagerImpl.class);
// Bindings to test infra (fakes & mocks)
TestIMdsalApiManager mdsalManager = TestIMdsalApiManager.newInstance();
bind(IMdsalApiManager.class).toInstance(mdsalManager);
bind(TestIMdsalApiManager.class).toInstance(mdsalManager);
bind(DataImportBootReady.class).toInstance(new DataImportBootReady() {
});
bind(DiagStatusService.class).toInstance(mock(DiagStatusService.class));
bind(ShardStatusMonitor.class).toInstance(TestShardStatusMonitor.newInstance());
}
use of org.opendaylight.mdsal.binding.testutils.DataBrokerTestModule in project genius by opendaylight.
the class ManagedNewTransactionRunnerImplTest method beforeTest.
@Before
public void beforeTest() {
testableDataBroker = new DataBrokerFailuresImpl(new DataBrokerTestModule(true).getDataBroker());
managedNewTransactionRunner = createManagedNewTransactionRunnerToTest(testableDataBroker);
singleTransactionDataBroker = new SingleTransactionDataBroker(testableDataBroker);
}
use of org.opendaylight.mdsal.binding.testutils.DataBrokerTestModule in project genius by opendaylight.
the class NetworkUtilTestModule method configureBindings.
@Override
protected void configureBindings() throws Exception {
DataBrokerTestModule dataBrokerTestModule = new DataBrokerTestModule(false);
DataBroker dataBroker = dataBrokerTestModule.getDataBroker();
bind(DataBroker.class).toInstance(dataBroker);
bind(NetworkConfig.class).toInstance(mock(NetworkConfig.class));
bind(IdManagerService.class).to(IdManager.class);
bind(ShardStatusMonitor.class).toInstance(TestShardStatusMonitor.newInstance());
bind(DataImportBootReady.class).toInstance(new DataImportBootReady() {
});
bind(LockManagerService.class).to(LockManagerServiceImpl.class);
bind(VniUtils.class).to(VniUtilsImpl.class);
bind(RDUtils.class).to(RDUtilsImpl.class);
}
Aggregations