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);
}
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);
}
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);
}
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);
}
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());
}
Aggregations