Search in sources :

Example 26 with QueueConfig

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

the class QueueAbstractTest method setup.

@Before
public void setup() {
    Config config = smallInstanceConfig();
    config.getQueueConfig("default").setPriorityComparatorClassName(comparatorClassName);
    config.getQueueConfig("testOffer_whenFull*").setMaxSize(100);
    config.getQueueConfig("testOfferWithTimeout*").setMaxSize(100);
    instances = newInstances(config);
    HazelcastInstance local = instances[0];
    HazelcastInstance target = instances[instances.length - 1];
    String methodName = getTestMethodName();
    String name = randomNameOwnedBy(target, methodName);
    queueConfig = config.getQueueConfig(name);
    queue = local.getQueue(name);
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) QueueConfig(com.hazelcast.config.QueueConfig) Before(org.junit.Before)

Example 27 with QueueConfig

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

the class StoreLatencyPlugin_QueueIntegrationTest method setup.

@Before
public void setup() {
    Config config = smallInstanceConfig().setProperty("hazelcast.diagnostics.enabled", "true").setProperty("hazelcast.diagnostics.storeLatency.period.seconds", "1");
    config.getQueueConfig("default").setPriorityComparatorClassName(comparatorClassName);
    QueueConfig queueConfig = addQueueConfig(config);
    hz = createHazelcastInstance(config);
    queue = hz.getQueue(queueConfig.getName());
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) QueueConfig(com.hazelcast.config.QueueConfig) Config(com.hazelcast.config.Config) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) Before(org.junit.Before)

Example 28 with QueueConfig

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

the class ConfigUtilsTest method getExistingConfig.

@Test
public void getExistingConfig() {
    QueueConfig aDefault = new QueueConfig("newConfig");
    aDefault.setBackupCount(5);
    queueConfigs.put(aDefault.getName(), aDefault);
    QueueConfig newConfig = ConfigUtils.getConfig(configPatternMatcher, queueConfigs, "newConfig", QueueConfig.class);
    assertEquals("newConfig", newConfig.getName());
    assertEquals(5, newConfig.getBackupCount());
    assertEquals(1, queueConfigs.size());
    assertTrue(queueConfigs.containsKey("newConfig"));
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 29 with QueueConfig

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

the class ConfigUtilsTest method getNonExistingConfig_createNewWithCloningDefault.

@Test
public void getNonExistingConfig_createNewWithCloningDefault() {
    QueueConfig aDefault = new QueueConfig("default");
    aDefault.setBackupCount(5);
    queueConfigs.put(aDefault.getName(), aDefault);
    QueueConfig newConfig = ConfigUtils.getConfig(configPatternMatcher, queueConfigs, "newConfig", QueueConfig.class);
    assertEquals("newConfig", newConfig.getName());
    assertEquals(5, newConfig.getBackupCount());
    assertEquals(2, queueConfigs.size());
    assertTrue(queueConfigs.containsKey("newConfig"));
    assertTrue(queueConfigs.containsKey("default"));
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 30 with QueueConfig

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

the class MergePolicyValidatorQueueIntegrationTest method addConfig.

@Override
void addConfig(Config config, String name, MergePolicyConfig mergePolicyConfig) {
    QueueConfig queueConfig = new QueueConfig(name).setMergePolicyConfig(mergePolicyConfig);
    config.addQueueConfig(queueConfig);
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig)

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