Search in sources :

Example 1 with PartitionedPersistentObjectStore

use of org.mule.runtime.core.internal.store.PartitionedPersistentObjectStore in project mule by mulesoft.

the class ManagedStoresTestCase method testPartitionablePersistenceStore.

@Ignore("MULE-6926")
@Issue("MULE-6926")
@Test
public void testPartitionablePersistenceStore() throws ObjectStoreException, RegistrationException, InterruptedException {
    PartitionedPersistentObjectStore<String> partitionedStore = new PartitionedPersistentObjectStore<>(muleContext);
    partitionedStore.open();
    getRegistry().registerObject(BASE_PERSISTENT_OBJECT_STORE_KEY, partitionedStore);
    ObjectStoreManager manager = getRegistry().lookupObject(OBJECT_STORE_MANAGER);
    ObjectStore<String> store = manager.createObjectStore("persistencePart2", unmanagedPersistent());
    assertTrue(store instanceof ObjectStorePartition);
    ObjectStore<String> baseStore = ((ObjectStorePartition<String>) store).getBaseStore();
    assertTrue(baseStore instanceof PartitionedPersistentObjectStore);
    assertSame(baseStore, getRegistry().lookupObject(BASE_PERSISTENT_OBJECT_STORE_KEY));
    testObjectStore(store);
    testObjectStoreExpiry(manager, "persistenceExpPart2", ObjectStoreSettings.builder().persistent(true).entryTtl(1000L).expirationInterval(200L).build());
    testObjectStoreMaxEntries(manager, "persistenceMaxPart2", ObjectStoreSettings.builder().persistent(true).maxEntries(10).entryTtl(10000L).expirationInterval(200L).build());
}
Also used : ObjectStoreManager(org.mule.runtime.api.store.ObjectStoreManager) PartitionedPersistentObjectStore(org.mule.runtime.core.internal.store.PartitionedPersistentObjectStore) Ignore(org.junit.Ignore) Issue(io.qameta.allure.Issue) Test(org.junit.Test)

Aggregations

Issue (io.qameta.allure.Issue)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 ObjectStoreManager (org.mule.runtime.api.store.ObjectStoreManager)1 PartitionedPersistentObjectStore (org.mule.runtime.core.internal.store.PartitionedPersistentObjectStore)1