Search in sources :

Example 1 with ConsolidatedDataStoreCacheStats

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();
}
Also used : AbstractSharedCachingDataStore(org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore) ConsolidatedDataStoreCacheStats(org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats) ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) ServiceRegistration(org.osgi.framework.ServiceRegistration) Test(org.junit.Test)

Example 2 with ConsolidatedDataStoreCacheStats

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();
}
Also used : AbstractSharedCachingDataStore(org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore) ConsolidatedDataStoreCacheStats(org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats) ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) ServiceRegistration(org.osgi.framework.ServiceRegistration) Test(org.junit.Test)

Example 3 with ConsolidatedDataStoreCacheStats

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();
}
Also used : ConsolidatedDataStoreCacheStats(org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats) ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) Test(org.junit.Test)

Example 4 with ConsolidatedDataStoreCacheStats

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();
    }
}
Also used : ConsolidatedDataStoreCacheStats(org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats) ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) Test(org.junit.Test)

Aggregations

ConsolidatedDataStoreCacheStatsMBean (org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean)4 ConsolidatedDataStoreCacheStats (org.apache.jackrabbit.oak.plugins.blob.ConsolidatedDataStoreCacheStats)4 Test (org.junit.Test)4 AbstractSharedCachingDataStore (org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore)2 ServiceRegistration (org.osgi.framework.ServiceRegistration)2