Search in sources :

Example 56 with HazelcastProperties

use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.

the class WriteBehindQueueTest method createQueueCapacityController.

private static NodeWideUsedCapacityCounter createQueueCapacityController() {
    Config config = new Config();
    config.setProperty(ClusterProperty.MAP_WRITE_BEHIND_QUEUE_CAPACITY.toString(), "1000");
    HazelcastProperties properties = new HazelcastProperties(config);
    return new NodeWideUsedCapacityCounter(properties);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Config(com.hazelcast.config.Config)

Example 57 with HazelcastProperties

use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.

the class QueryOptimizerFactoryTest method newOptimizer_whenUnknownValue_thenThrowIllegalArgumentException.

@Test(expected = IllegalArgumentException.class)
public void newOptimizer_whenUnknownValue_thenThrowIllegalArgumentException() {
    HazelcastProperties hazelcastProperties = createMockHazelcastProperties(QUERY_OPTIMIZER_TYPE, "foo");
    QueryOptimizerFactory.newOptimizer(hazelcastProperties);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 58 with HazelcastProperties

use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.

the class QueryOptimizerFactoryTest method newOptimizer_whenPropertyContainsRule_thenCreateRulesBasedOptimizer.

@Test
public void newOptimizer_whenPropertyContainsRule_thenCreateRulesBasedOptimizer() {
    HazelcastProperties hazelcastProperties = createMockHazelcastProperties(QUERY_OPTIMIZER_TYPE, "RULES");
    QueryOptimizer queryOptimizer = QueryOptimizerFactory.newOptimizer(hazelcastProperties);
    assertThat(queryOptimizer, instanceOf(RuleBasedQueryOptimizer.class));
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 59 with HazelcastProperties

use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.

the class QueryOptimizerFactoryTest method newOptimizer_whenPropertyContainsNone_thenCreateEmptyOptimizer.

@Test
public void newOptimizer_whenPropertyContainsNone_thenCreateEmptyOptimizer() {
    HazelcastProperties hazelcastProperties = createMockHazelcastProperties(QUERY_OPTIMIZER_TYPE, "NONE");
    QueryOptimizer queryOptimizer = QueryOptimizerFactory.newOptimizer(hazelcastProperties);
    assertThat(queryOptimizer, instanceOf(EmptyOptimizer.class));
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 60 with HazelcastProperties

use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.

the class InboundResponseHandlerSupplierTest method newSupplier.

private InboundResponseHandlerSupplier newSupplier(int threadCount) {
    Properties props = new Properties();
    props.put(ClusterProperty.RESPONSE_THREAD_COUNT.getName(), "" + threadCount);
    HazelcastProperties properties = new HazelcastProperties(props);
    when(nodeEngine.getProperties()).thenReturn(properties);
    return new InboundResponseHandlerSupplier(getClass().getClassLoader(), invocationRegistry, "hz", nodeEngine);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Properties(java.util.Properties) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties)

Aggregations

HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)71 Config (com.hazelcast.config.Config)31 QuickTest (com.hazelcast.test.annotation.QuickTest)29 Test (org.junit.Test)29 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)25 ILogger (com.hazelcast.logging.ILogger)15 Address (com.hazelcast.cluster.Address)11 JoinConfig (com.hazelcast.config.JoinConfig)8 MulticastConfig (com.hazelcast.config.MulticastConfig)8 InetAddress (java.net.InetAddress)8 InetSocketAddress (java.net.InetSocketAddress)8 MulticastSocket (java.net.MulticastSocket)8 Before (org.junit.Before)8 ExecutionService (com.hazelcast.spi.impl.executionservice.ExecutionService)7 Properties (java.util.Properties)7 Node (com.hazelcast.instance.impl.Node)4 LoggingService (com.hazelcast.logging.LoggingService)4 MapConfig (com.hazelcast.config.MapConfig)3 TcpServerConnectionChannelErrorHandler (com.hazelcast.internal.server.tcp.TcpServerConnectionChannelErrorHandler)3 ClientConfig (com.hazelcast.client.config.ClientConfig)2