Search in sources :

Example 1 with CachePartitionLostListenerConfig

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

the class YamlMemberDomConfigProcessor method cachePartitionLostListenerHandle.

@Override
protected void cachePartitionLostListenerHandle(Node n, CacheSimpleConfig cacheConfig) {
    for (Node listenerNode : childElements(n)) {
        String listenerClass = listenerNode.getNodeValue();
        cacheConfig.addCachePartitionLostListenerConfig(new CachePartitionLostListenerConfig(listenerClass));
    }
}
Also used : Node(org.w3c.dom.Node) YamlNode(com.hazelcast.internal.yaml.YamlNode) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig)

Example 2 with CachePartitionLostListenerConfig

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

the class CachePartitionLostListenerConfigTest method testCachePartitionLostListenerReadOnlyConfig_withClassName.

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

Example 3 with CachePartitionLostListenerConfig

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

the class CachePartitionLostListenerConfigTest method testGetClassName.

@Test
public void testGetClassName() {
    String className = "EventCollectingCachePartitionLostListener";
    CachePartitionLostListenerConfig listenerConfig = new CachePartitionLostListenerConfig(className);
    assertEquals(className, listenerConfig.getClassName());
}
Also used : CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 4 with CachePartitionLostListenerConfig

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

the class CachePartitionLostListenerConfigTest method testCachePartitionLostListenerConfig_setImplementation.

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

Example 5 with CachePartitionLostListenerConfig

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

the class CachePartitionLostListenerConfigTest method testEqualsAndHashCode.

@Test
public void testEqualsAndHashCode() {
    CachePartitionLostListener listener = new EventCollectingCachePartitionLostListener(0);
    CachePartitionLostListenerConfig listenerConfig1 = new CachePartitionLostListenerConfig();
    CachePartitionLostListenerConfig listenerConfig2 = new CachePartitionLostListenerConfig();
    assertEquals(listenerConfig1, listenerConfig1);
    assertEquals(listenerConfig1, new CachePartitionLostListenerConfig());
    assertNotEquals(listenerConfig1, null);
    assertNotEquals(listenerConfig1, new Object());
    listenerConfig1.setImplementation(listener);
    assertNotEquals(listenerConfig1, listenerConfig2);
    assertNotEquals(listenerConfig1.hashCode(), listenerConfig2.hashCode());
    listenerConfig2.setImplementation(listener);
    assertEquals(listenerConfig1, listenerConfig2);
    assertEquals(listenerConfig1.hashCode(), listenerConfig2.hashCode());
    listenerConfig1.setClassName("EventCollectingCachePartitionLostListener");
    listenerConfig2.setClassName("CachePartitionLostListenerConfig");
    assertNotEquals(listenerConfig1, listenerConfig2);
    assertNotEquals(listenerConfig1.hashCode(), listenerConfig2.hashCode());
    listenerConfig2.setClassName("EventCollectingCachePartitionLostListener");
    assertEquals(listenerConfig1, listenerConfig2);
    assertEquals(listenerConfig1.hashCode(), listenerConfig2.hashCode());
}
Also used : EventCollectingCachePartitionLostListener(com.hazelcast.cache.CachePartitionLostListenerTest.EventCollectingCachePartitionLostListener) CachePartitionLostListener(com.hazelcast.cache.impl.event.CachePartitionLostListener) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) EventCollectingCachePartitionLostListener(com.hazelcast.cache.CachePartitionLostListenerTest.EventCollectingCachePartitionLostListener) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

CachePartitionLostListenerConfig (com.hazelcast.config.CachePartitionLostListenerConfig)20 Test (org.junit.Test)14 QuickTest (com.hazelcast.test.annotation.QuickTest)12 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)9 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)9 CachePartitionLostListener (com.hazelcast.cache.impl.event.CachePartitionLostListener)6 EventCollectingCachePartitionLostListener (com.hazelcast.cache.CachePartitionLostListenerTest.EventCollectingCachePartitionLostListener)5 Config (com.hazelcast.config.Config)5 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)4 EvictionConfig (com.hazelcast.config.EvictionConfig)4 ItemListenerConfig (com.hazelcast.config.ItemListenerConfig)4 ListenerConfig (com.hazelcast.config.ListenerConfig)4 MapPartitionLostListenerConfig (com.hazelcast.config.MapPartitionLostListenerConfig)4 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)4 AttributeConfig (com.hazelcast.config.AttributeConfig)3 AwsConfig (com.hazelcast.config.AwsConfig)3 CacheSimpleEntryListenerConfig (com.hazelcast.config.CacheSimpleEntryListenerConfig)3 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)3 DataPersistenceConfig (com.hazelcast.config.DataPersistenceConfig)3 DiscoveryConfig (com.hazelcast.config.DiscoveryConfig)3