use of org.mule.runtime.core.internal.store.PartitionedInMemoryObjectStore in project mule by mulesoft.
the class ManagedStoresTestCase method testPartitionableInMemoryStore.
@Test
public void testPartitionableInMemoryStore() throws ObjectStoreException, RegistrationException, InterruptedException {
getRegistry().registerObject(BASE_IN_MEMORY_OBJECT_STORE_KEY, new PartitionedInMemoryObjectStore<String>());
ObjectStoreManager manager = getRegistry().lookupObject(OBJECT_STORE_MANAGER);
ObjectStore<String> store = manager.createObjectStore("inMemoryPart2", unmanagedTransient());
assertTrue(store instanceof ObjectStorePartition);
ObjectStore<String> baseStore = ((ObjectStorePartition<String>) store).getBaseStore();
assertTrue(baseStore instanceof PartitionedInMemoryObjectStore);
testObjectStore(store);
testObjectStoreExpiry(manager, "inMemoryExpPart2", ObjectStoreSettings.builder().persistent(false).entryTtl(500L).expirationInterval(200L).build());
testObjectStoreMaxEntries(manager, "inMemoryMaxPart2", ObjectStoreSettings.builder().persistent(false).maxEntries(10).entryTtl(10000L).expirationInterval(200L).build());
}
Aggregations