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