use of org.opendaylight.infrautils.caches.baseimpl.internal.CacheManagersRegistryImpl in project infrautils by opendaylight.
the class CacheModule method configure.
@Override
protected void configure() {
bind(CacheProvider.class).to(providerClass);
bind(CacheProvider.class).annotatedWith(OsgiService.class).to(providerClass);
CacheManagersRegistry monitor = new CacheManagersRegistryImpl();
bind(CacheManagersRegistry.class).toInstance(monitor);
bind(CacheManagers.class).toInstance(monitor);
}
use of org.opendaylight.infrautils.caches.baseimpl.internal.CacheManagersRegistryImpl in project genius by opendaylight.
the class ItmExternalTunnelAddTest method setUp.
@Before
public void setUp() {
setupMocks();
optionalDpnEndPoints = Optional.of(dpnEndpointsVxlan);
tunnelMonitorParamsOptional = Optional.of(tunnelMonitorParams);
tunnelMonitorIntervalOptional = Optional.of(tunnelMonitorInterval);
doReturn(Futures.immediateCheckedFuture(optionalDpnEndPoints)).when(mockReadTx).read(LogicalDatastoreType.CONFIGURATION, dpnEndpointsIdentifier);
doReturn(Futures.immediateCheckedFuture(tunnelMonitorParamsOptional)).when(mockReadTx).read(LogicalDatastoreType.CONFIGURATION, tunnelMonitorParamsInstanceIdentifier);
doReturn(Futures.immediateCheckedFuture(tunnelMonitorIntervalOptional)).when(mockReadTx).read(LogicalDatastoreType.CONFIGURATION, tunnelMonitorIntervalIdentifier);
externalTunnelAddWorker = new ItmExternalTunnelAddWorker(dataBroker, itmConfig, new DPNTEPsInfoCache(dataBroker, new GuavaCacheProvider(new CacheManagersRegistryImpl())));
}
use of org.opendaylight.infrautils.caches.baseimpl.internal.CacheManagersRegistryImpl in project genius by opendaylight.
the class ItmInternalTunnelAddTest method setUp.
@Before
public void setUp() {
PowerMockito.mockStatic(ITMBatchingUtils.class);
setupMocks();
tunnelMonitorParamsOptional = Optional.of(tunnelMonitorParams);
tunnelMonitorIntervalOptional = Optional.of(tunnelMonitorInterval);
idOutputOptional1 = RpcResultBuilder.success(expectedId1).buildFuture();
idOutputOptional2 = RpcResultBuilder.success(expectedId2).buildFuture();
doReturn(Futures.immediateCheckedFuture(tunnelMonitorParamsOptional)).when(mockReadTx).read(LogicalDatastoreType.CONFIGURATION, tunnelMonitorParamsInstanceIdentifier);
doReturn(Futures.immediateCheckedFuture(tunnelMonitorIntervalOptional)).when(mockReadTx).read(LogicalDatastoreType.CONFIGURATION, tunnelMonitorIntervalIdentifier);
itmInternalTunnelAddWorker = new ItmInternalTunnelAddWorker(dataBroker, jobCoordinator, new TunnelMonitoringConfig(dataBroker, new GuavaCacheProvider(new CacheManagersRegistryImpl())), itmConfig);
}
use of org.opendaylight.infrautils.caches.baseimpl.internal.CacheManagersRegistryImpl in project netvirt by opendaylight.
the class NeutronPortChangeListenerTest method setUp.
@Before
public void setUp() {
doReturn(mockWriteTx).when(dataBroker).newWriteOnlyTransaction();
doReturn(Futures.immediateCheckedFuture(null)).when(mockWriteTx).submit();
doReturn(mockReadTx).when(dataBroker).newReadOnlyTransaction();
when(mockReadTx.read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class))).thenReturn(Futures.immediateCheckedFuture(Optional.of(mockNetwork)));
neutronPortChangeListener = new NeutronPortChangeListener(dataBroker, neutronvpnManager, neutronvpnNatManager, gwMacResolver, elanService, jobCoordinator, new NeutronvpnUtils(dataBroker, idManager, jobCoordinator, ipV6InternetDefRt), new HostConfigCache(dataBroker, new GuavaCacheProvider(new CacheManagersRegistryImpl())));
InstanceIdentifier<ElanInstance> elanIdentifierId = InstanceIdentifier.builder(ElanInstances.class).child(ElanInstance.class, new ElanInstanceKey(new Uuid("12345678-1234-1234-1234-123456789012").getValue())).build();
when(mockReadTx.read(any(LogicalDatastoreType.class), eq(elanIdentifierId))).thenReturn(Futures.immediateCheckedFuture(Optional.of(elanInstance)));
}
use of org.opendaylight.infrautils.caches.baseimpl.internal.CacheManagersRegistryImpl in project genius by opendaylight.
the class DataObjectCacheTest method setup.
@Before
public void setup() {
doReturn(mockReadTx).when(mockDataBroker).newReadOnlyTransaction();
doReturn(mockListenerReg).when(mockDataBroker).registerDataTreeChangeListener(eq(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, PATH)), any());
cache = new InstanceIdDataObjectCache<>(Config.class, mockDataBroker, LogicalDatastoreType.OPERATIONAL, PATH, new GuavaCacheProvider(new CacheManagersRegistryImpl()));
verify(mockDataBroker).registerDataTreeChangeListener(eq(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, PATH)), listenerCapture.capture());
doReturn(mockModification).when(mockDataTreeModification).getRootNode();
doReturn(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, PATH)).when(mockDataTreeModification).getRootPath();
doReturn(CONFIG_OBJ).when(mockModification).getDataAfter();
}
Aggregations