Search in sources :

Example 11 with HazelcastProperties

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

the class BackpressureRegulatorTest method testConstruction_invalidSyncWindow.

@Test(expected = IllegalArgumentException.class)
public void testConstruction_invalidSyncWindow() {
    Config config = new Config();
    config.setProperty(BACKPRESSURE_ENABLED.getName(), "true");
    config.setProperty(BACKPRESSURE_SYNCWINDOW.getName(), "0");
    HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
    new BackpressureRegulator(hazelcastProperties, logger);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Config(com.hazelcast.config.Config) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 12 with HazelcastProperties

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

the class BackpressureRegulatorTest method newEnabledBackPressureService.

private BackpressureRegulator newEnabledBackPressureService() {
    Config config = new Config();
    config.setProperty(BACKPRESSURE_ENABLED.getName(), "true");
    config.setProperty(BACKPRESSURE_SYNCWINDOW.getName(), String.valueOf(SYNC_WINDOW));
    HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
    return new BackpressureRegulator(hazelcastProperties, logger);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Config(com.hazelcast.config.Config)

Example 13 with HazelcastProperties

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

the class BackpressureRegulatorTest method newCallIdSequence_whenBackPressureDisabled.

@Test
public void newCallIdSequence_whenBackPressureDisabled() {
    Config config = new Config();
    config.setProperty(BACKPRESSURE_ENABLED.getName(), "false");
    HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
    BackpressureRegulator backpressureRegulator = new BackpressureRegulator(hazelcastProperties, logger);
    CallIdSequence callIdSequence = backpressureRegulator.newCallIdSequence();
    assertInstanceOf(CallIdSequence.CallIdSequenceWithoutBackpressure.class, callIdSequence);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Config(com.hazelcast.config.Config) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 14 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) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 15 with HazelcastProperties

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

the class BackpressureRegulatorTest method testBackPressureDisabledByDefault.

@Test
public void testBackPressureDisabledByDefault() {
    Config config = new Config();
    HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
    BackpressureRegulator regulator = new BackpressureRegulator(hazelcastProperties, logger);
    assertFalse(regulator.isEnabled());
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) Config(com.hazelcast.config.Config) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)29 Config (com.hazelcast.config.Config)12 QuickTest (com.hazelcast.test.annotation.QuickTest)11 Test (org.junit.Test)11 ParallelTest (com.hazelcast.test.annotation.ParallelTest)9 ExecutionService (com.hazelcast.spi.ExecutionService)4 ILogger (com.hazelcast.logging.ILogger)3 Before (org.junit.Before)3 MapConfig (com.hazelcast.config.MapConfig)2 HazelcastThreadGroup (com.hazelcast.instance.HazelcastThreadGroup)2 BatchInvalidator (com.hazelcast.internal.nearcache.impl.invalidation.BatchInvalidator)2 NonStopInvalidator (com.hazelcast.internal.nearcache.impl.invalidation.NonStopInvalidator)2 RecordStore (com.hazelcast.map.impl.recordstore.RecordStore)2 NodeEngine (com.hazelcast.spi.NodeEngine)2 OperationService (com.hazelcast.spi.OperationService)2 Properties (java.util.Properties)2 ClientLoggingService (com.hazelcast.client.impl.ClientLoggingService)1 MapIndexConfig (com.hazelcast.config.MapIndexConfig)1 SSLConfig (com.hazelcast.config.SSLConfig)1 ClusterService (com.hazelcast.internal.cluster.ClusterService)1