use of org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats in project jackrabbit-oak by apache.
the class SegmentCachingDataStoreStatsTest method testUseCachingBlobStore.
@Test
public void testUseCachingBlobStore() {
ServiceRegistration delegateReg = context.bundleContext().registerService(AbstractSharedCachingDataStore.class.getName(), mock(AbstractSharedCachingDataStore.class), null);
assertNotNull(context.getService(AbstractSharedCachingDataStore.class));
registerBlobStore();
registerSegmentNodeStoreService(true);
assertServiceActivated();
ConsolidatedDataStoreCacheStats dataStoreStats = context.registerInjectActivateService(new ConsolidatedDataStoreCacheStats());
assertNotNull(context.getService(ConsolidatedDataStoreCacheStatsMBean.class));
deactivate(dataStoreStats, context.bundleContext());
unregisterSegmentNodeStoreService();
unregisterBlobStore();
delegateReg.unregister();
}
use of org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats in project jackrabbit-oak by apache.
the class DocumentCachingDataStoreStatsTest method testUseCachingBlobStore.
@Test
public void testUseCachingBlobStore() {
ServiceRegistration delegateReg = context.bundleContext().registerService(AbstractSharedCachingDataStore.class.getName(), mock(AbstractSharedCachingDataStore.class), null);
assertNotNull(context.getService(AbstractSharedCachingDataStore.class));
registerBlobStore();
registerDocumentNodeStoreService(true);
assertServiceActivated();
ConsolidatedDataStoreCacheStats dataStoreStats = context.registerInjectActivateService(new ConsolidatedDataStoreCacheStats());
assertNotNull(context.getService(ConsolidatedDataStoreCacheStatsMBean.class));
deactivate(dataStoreStats, context.bundleContext());
unregisterDocumentNodeStoreService();
unregisterBlobStore();
delegateReg.unregister();
}
use of org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats in project jackrabbit-oak by apache.
the class SegmentCachingDataStoreStatsTest method testNoCachingBlobStore.
@Test
public void testNoCachingBlobStore() {
expectedEx.expect(ReferenceViolationException.class);
registerBlobStore();
registerSegmentNodeStoreService(true);
assertServiceActivated();
ConsolidatedDataStoreCacheStats dataStoreStats = context.registerInjectActivateService(new ConsolidatedDataStoreCacheStats());
assertNull(context.getService(ConsolidatedDataStoreCacheStatsMBean.class));
unregisterSegmentNodeStoreService();
unregisterBlobStore();
}
use of org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats in project jackrabbit-oak by apache.
the class DocumentCachingDataStoreStatsTest method testNoCachingBlobStore.
@Test
public void testNoCachingBlobStore() {
expectedEx.expect(ReferenceViolationException.class);
registerBlobStore();
registerDocumentNodeStoreService(true);
assertServiceActivated();
try {
ConsolidatedDataStoreCacheStats dataStoreStats = context.registerInjectActivateService(new ConsolidatedDataStoreCacheStats());
assertNull(context.getService(ConsolidatedDataStoreCacheStatsMBean.class));
} finally {
unregisterDocumentNodeStoreService();
unregisterBlobStore();
}
}
Aggregations