Search in sources :

Example 1 with CachePartitionLostListenerConfigReadOnly

use of com.hazelcast.config.CachePartitionLostListenerConfigReadOnly in project hazelcast by hazelcast.

the class CachePartitionLostListenerConfigTest method testCachePartitionLostListenerReadOnlyConfig_withImplementation.

@Test(expected = UnsupportedOperationException.class)
public void testCachePartitionLostListenerReadOnlyConfig_withImplementation() {
    CachePartitionLostListener listener = mock(CachePartitionLostListener.class);
    CachePartitionLostListenerConfig listenerConfig = new CachePartitionLostListenerConfig(listener);
    CachePartitionLostListenerConfigReadOnly readOnly = listenerConfig.getAsReadOnly();
    assertEquals(listener, readOnly.getImplementation());
    readOnly.setImplementation(mock(CachePartitionLostListener.class));
}
Also used : EventCollectingCachePartitionLostListener(com.hazelcast.cache.CachePartitionLostListenerTest.EventCollectingCachePartitionLostListener) CachePartitionLostListener(com.hazelcast.cache.impl.event.CachePartitionLostListener) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) CachePartitionLostListenerConfigReadOnly(com.hazelcast.config.CachePartitionLostListenerConfigReadOnly) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 2 with CachePartitionLostListenerConfigReadOnly

use of com.hazelcast.config.CachePartitionLostListenerConfigReadOnly in project hazelcast by hazelcast.

the class CachePartitionLostListenerConfigTest method testCachePartitionLostListenerReadOnlyConfig_withEventListenerImplementation.

@Test(expected = UnsupportedOperationException.class)
public void testCachePartitionLostListenerReadOnlyConfig_withEventListenerImplementation() {
    CachePartitionLostListenerConfigReadOnly readOnly = new CachePartitionLostListenerConfig().getAsReadOnly();
    readOnly.setImplementation(mock(EventListener.class));
}
Also used : CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) CachePartitionLostListenerConfigReadOnly(com.hazelcast.config.CachePartitionLostListenerConfigReadOnly) EventListener(java.util.EventListener) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 3 with CachePartitionLostListenerConfigReadOnly

use of com.hazelcast.config.CachePartitionLostListenerConfigReadOnly in project hazelcast by hazelcast.

the class CachePartitionLostListenerConfigTest method testCachePartitionLostListenerReadOnlyConfig_withClassName.

@Test(expected = UnsupportedOperationException.class)
public void testCachePartitionLostListenerReadOnlyConfig_withClassName() {
    CachePartitionLostListenerConfigReadOnly readOnly = new CachePartitionLostListenerConfig().getAsReadOnly();
    readOnly.setClassName("com.hz");
}
Also used : CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) CachePartitionLostListenerConfigReadOnly(com.hazelcast.config.CachePartitionLostListenerConfigReadOnly) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

CachePartitionLostListenerConfig (com.hazelcast.config.CachePartitionLostListenerConfig)3 CachePartitionLostListenerConfigReadOnly (com.hazelcast.config.CachePartitionLostListenerConfigReadOnly)3 ParallelTest (com.hazelcast.test.annotation.ParallelTest)3 QuickTest (com.hazelcast.test.annotation.QuickTest)3 Test (org.junit.Test)3 EventCollectingCachePartitionLostListener (com.hazelcast.cache.CachePartitionLostListenerTest.EventCollectingCachePartitionLostListener)1 CachePartitionLostListener (com.hazelcast.cache.impl.event.CachePartitionLostListener)1 EventListener (java.util.EventListener)1