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());
}
Aggregations