use of com.hazelcast.config.QueueConfig in project hazelcast by hazelcast.
the class ConfigSearchTest method testQueueConfig_Dynamic.
@Test
public void testQueueConfig_Dynamic() {
TestCase<QueueConfig> testCase = new TestCase<QueueConfig>(new QueueConfig().setName(STATIC_NAME), new QueueConfig().setName(DYNAMIC_NAME), true) {
@Override
void addStaticConfig(Config config) {
config.addQueueConfig(this.staticConfig);
}
@Override
void addDynamicConfig(HazelcastInstance hazelcastInstance) {
hazelcastInstance.getConfig().addQueueConfig(this.dynamicConfig);
}
@Override
void asserts() {
QueueConfig dataConfig = hazelcastInstance.getConfig().findQueueConfig(DYNAMIC_NAME);
assertThat(dataConfig.getName(), equalTo(DYNAMIC_NAME));
}
};
testTemplate(testCase);
}
use of com.hazelcast.config.QueueConfig in project hazelcast by hazelcast.
the class ConfigSearchTest method testQueueConfig_Static.
@Test
public void testQueueConfig_Static() {
TestCase<QueueConfig> testCase = new TestCase<QueueConfig>(new QueueConfig().setName(STATIC_NAME), new QueueConfig().setName(DYNAMIC_NAME), false) {
@Override
void addStaticConfig(Config config) {
config.addQueueConfig(this.staticConfig);
}
@Override
void addDynamicConfig(HazelcastInstance hazelcastInstance) {
hazelcastInstance.getConfig().addQueueConfig(this.dynamicConfig);
}
@Override
void asserts() {
QueueConfig dataConfig = hazelcastInstance.getConfig().findQueueConfig(DYNAMIC_NAME);
assertThat(dataConfig.getName(), equalTo(STATIC_NAME));
}
};
testTemplate(testCase);
}
use of com.hazelcast.config.QueueConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method assertConfigurationsEqualOnAllMembers.
private void assertConfigurationsEqualOnAllMembers(QueueConfig queueConfig) {
String name = queueConfig.getName();
for (HazelcastInstance instance : members) {
QueueConfig registeredConfig = instance.getConfig().getQueueConfig(name);
assertEquals(queueConfig, registeredConfig);
}
}
use of com.hazelcast.config.QueueConfig in project hazelcast by hazelcast.
the class DynamicConfigTest method testQueueConfig_withListeners.
@Test
public void testQueueConfig_withListeners() {
QueueConfig config = getQueueConfig_withListeners();
driver.getConfig().addQueueConfig(config);
assertConfigurationsEqualOnAllMembers(config);
}
use of com.hazelcast.config.QueueConfig in project hazelcast by hazelcast.
the class ClientQueueTest method setup.
@Before
public void setup() {
Config config = new Config();
QueueConfig queueConfig = config.getQueueConfig(QUEUE_WITH_MAX_SIZE);
queueConfig.setMaxSize(MAX_SIZE_FOR_QUEUE);
hazelcastFactory.newHazelcastInstance(config);
client = hazelcastFactory.newHazelcastClient();
}
Aggregations