Search in sources :

Example 1 with ActivationManager

use of org.infinispan.eviction.impl.ActivationManager in project infinispan by infinispan.

the class LocalConditionalCommandTest method afterMethod.

@AfterMethod
public void afterMethod() {
    if (passivation) {
        ActivationManager activationManager = TestingUtil.extractComponent(cache(PRIVATE_STORE_CACHE_NAME), ActivationManager.class);
        // Make sure no passivations are pending, which could leak between tests
        eventuallyEquals((long) 0, activationManager::getPendingActivationCount);
    }
}
Also used : ActivationManager(org.infinispan.eviction.impl.ActivationManager) AfterMethod(org.testng.annotations.AfterMethod)

Example 2 with ActivationManager

use of org.infinispan.eviction.impl.ActivationManager in project infinispan by infinispan.

the class ClusteredConditionalCommandTest method afterMethod.

@AfterMethod
public void afterMethod() {
    if (passivation) {
        for (EmbeddedCacheManager cacheManager : cacheManagers) {
            ActivationManager activationManager = TestingUtil.extractComponent(cacheManager.getCache(PRIVATE_STORE_CACHE_NAME), ActivationManager.class);
            // Make sure no activations are pending, which could leak between tests
            eventuallyEquals((long) 0, activationManager::getPendingActivationCount);
        }
    }
}
Also used : ActivationManager(org.infinispan.eviction.impl.ActivationManager) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager) AfterMethod(org.testng.annotations.AfterMethod)

Example 3 with ActivationManager

use of org.infinispan.eviction.impl.ActivationManager in project infinispan by infinispan.

the class SimpleDataContainerTest method createContainer.

protected DataContainer<String, String> createContainer() {
    DefaultDataContainer<String, String> dc = new DefaultDataContainer<>(16);
    InternalEntryFactoryImpl internalEntryFactory = new InternalEntryFactoryImpl();
    timeService = new ControlledTimeService();
    TestingUtil.inject(internalEntryFactory, timeService);
    ActivationManager activationManager = mock(ActivationManager.class);
    InternalExpirationManager expirationManager = mock(InternalExpirationManager.class);
    Mockito.when(expirationManager.entryExpiredInMemory(Mockito.any(), Mockito.anyLong(), Mockito.anyBoolean())).thenReturn(CompletableFutures.completedTrue());
    TestingUtil.inject(dc, internalEntryFactory, timeService, expirationManager);
    return dc;
}
Also used : InternalEntryFactoryImpl(org.infinispan.container.impl.InternalEntryFactoryImpl) DefaultDataContainer(org.infinispan.container.impl.DefaultDataContainer) ActivationManager(org.infinispan.eviction.impl.ActivationManager) InternalExpirationManager(org.infinispan.expiration.impl.InternalExpirationManager) ControlledTimeService(org.infinispan.util.ControlledTimeService)

Aggregations

ActivationManager (org.infinispan.eviction.impl.ActivationManager)3 AfterMethod (org.testng.annotations.AfterMethod)2 DefaultDataContainer (org.infinispan.container.impl.DefaultDataContainer)1 InternalEntryFactoryImpl (org.infinispan.container.impl.InternalEntryFactoryImpl)1 InternalExpirationManager (org.infinispan.expiration.impl.InternalExpirationManager)1 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)1 ControlledTimeService (org.infinispan.util.ControlledTimeService)1