Search in sources :

Example 31 with QueueConfig

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);
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) HazelcastInstance(com.hazelcast.core.HazelcastInstance) ListConfig(com.hazelcast.config.ListConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 32 with QueueConfig

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);
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) HazelcastInstance(com.hazelcast.core.HazelcastInstance) ListConfig(com.hazelcast.config.ListConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 33 with QueueConfig

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);
    }
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) QueueConfig(com.hazelcast.config.QueueConfig)

Example 34 with QueueConfig

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);
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 35 with QueueConfig

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();
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) QueueConfig(com.hazelcast.config.QueueConfig) Config(com.hazelcast.config.Config) Before(org.junit.Before)

Aggregations

QueueConfig (com.hazelcast.config.QueueConfig)35 Test (org.junit.Test)13 Config (com.hazelcast.config.Config)12 QuickTest (com.hazelcast.test.annotation.QuickTest)11 HazelcastInstance (com.hazelcast.core.HazelcastInstance)9 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)9 MapConfig (com.hazelcast.config.MapConfig)7 QueueStoreConfig (com.hazelcast.config.QueueStoreConfig)7 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)6 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)5 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)5 ExecutorConfig (com.hazelcast.config.ExecutorConfig)5 FlakeIdGeneratorConfig (com.hazelcast.config.FlakeIdGeneratorConfig)5 ItemListenerConfig (com.hazelcast.config.ItemListenerConfig)5 ListConfig (com.hazelcast.config.ListConfig)5 MergePolicyConfig (com.hazelcast.config.MergePolicyConfig)5 MultiMapConfig (com.hazelcast.config.MultiMapConfig)5 PNCounterConfig (com.hazelcast.config.PNCounterConfig)5 ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)5 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)5