use of com.hazelcast.config.ListenerConfig in project hazelcast by hazelcast.
the class TestReplicatedMapApplicationContext method testReplicatedMapConfig.
@Test
public void testReplicatedMapConfig() {
ReplicatedMapConfig replicatedMapConfig = instance.getConfig().getReplicatedMapConfig("replicatedMap");
assertNotNull(replicatedMapConfig);
assertEquals(3, replicatedMapConfig.getConcurrencyLevel());
assertEquals("OBJECT", InMemoryFormat.OBJECT.name());
assertTrue(replicatedMapConfig.isAsyncFillup());
assertFalse(replicatedMapConfig.isStatisticsEnabled());
assertEquals(10, replicatedMapConfig.getReplicationDelayMillis());
List<ListenerConfig> listenerConfigs = replicatedMapConfig.getListenerConfigs();
assertEquals(1, listenerConfigs.size());
assertEquals("com.hazelcast.spring.DummyEntryListener", listenerConfigs.get(0).getClassName());
}
use of com.hazelcast.config.ListenerConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testReplicatedMapConfig.
@Test
public void testReplicatedMapConfig() {
assertNotNull(config);
assertEquals(1, config.getReplicatedMapConfigs().size());
ReplicatedMapConfig replicatedMapConfig = config.getReplicatedMapConfig("replicatedMap");
assertNotNull(replicatedMapConfig);
assertEquals("replicatedMap", replicatedMapConfig.getName());
assertEquals(200, replicatedMapConfig.getReplicationDelayMillis());
assertEquals(16, replicatedMapConfig.getConcurrencyLevel());
assertEquals(InMemoryFormat.OBJECT, replicatedMapConfig.getInMemoryFormat());
assertFalse(replicatedMapConfig.isStatisticsEnabled());
assertFalse(replicatedMapConfig.isAsyncFillup());
replicatedMapConfig.getListenerConfigs();
for (ListenerConfig listener : replicatedMapConfig.getListenerConfigs()) {
if (listener.getClassName() != null) {
assertNull(listener.getImplementation());
assertTrue(listener.isIncludeValue());
assertFalse(listener.isLocal());
} else {
assertNotNull(listener.getImplementation());
assertEquals(entryListener, listener.getImplementation());
assertTrue(listener.isLocal());
assertTrue(listener.isIncludeValue());
}
}
}
use of com.hazelcast.config.ListenerConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testConfigListeners.
@Test
public void testConfigListeners() {
assertNotNull(membershipListener);
List<ListenerConfig> list = config.getListenerConfigs();
assertEquals(2, list.size());
for (ListenerConfig lc : list) {
if (lc.getClassName() != null) {
assertNull(lc.getImplementation());
assertEquals(DummyMembershipListener.class.getName(), lc.getClassName());
} else {
assertNotNull(lc.getImplementation());
assertEquals(membershipListener, lc.getImplementation());
}
}
}
use of com.hazelcast.config.ListenerConfig in project hazelcast by hazelcast.
the class TestFullApplicationContext method testTopicConfig.
@Test
public void testTopicConfig() {
TopicConfig testTopicConfig = config.getTopicConfig("testTopic");
assertNotNull(testTopicConfig);
assertEquals("testTopic", testTopicConfig.getName());
assertEquals(1, testTopicConfig.getMessageListenerConfigs().size());
assertEquals(true, testTopicConfig.isGlobalOrderingEnabled());
assertEquals(false, testTopicConfig.isStatisticsEnabled());
ListenerConfig listenerConfig = testTopicConfig.getMessageListenerConfigs().get(0);
assertEquals("com.hazelcast.spring.DummyMessageListener", listenerConfig.getClassName());
}
use of com.hazelcast.config.ListenerConfig in project hazelcast by hazelcast.
the class XmlClientConfigBuilderTest method testLeftovers.
@Test
public void testLeftovers() {
assertEquals(40, clientConfig.getExecutorPoolSize());
assertEquals("com.hazelcast.security.UsernamePasswordCredentials", clientConfig.getSecurityConfig().getCredentialsClassname());
assertEquals(40, clientConfig.getExecutorPoolSize());
assertEquals("com.hazelcast.client.util.RandomLB", clientConfig.getLoadBalancer().getClass().getName());
final List<ListenerConfig> listenerConfigs = clientConfig.getListenerConfigs();
assertEquals(3, listenerConfigs.size());
assertContains(listenerConfigs, new ListenerConfig("com.hazelcast.examples.MembershipListener"));
assertContains(listenerConfigs, new ListenerConfig("com.hazelcast.examples.InstanceListener"));
assertContains(listenerConfigs, new ListenerConfig("com.hazelcast.examples.MigrationListener"));
}
Aggregations