use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class InvocationRegistryTest method setup.
@Before
public void setup() {
logger = Mockito.mock(ILogger.class);
int capacity = 2;
CallIdSequenceWithBackpressure callIdSequence = new CallIdSequenceWithBackpressure(capacity, 1000, ConcurrencyDetection.createDisabled());
HazelcastProperties properties = new HazelcastProperties(new Properties());
invocationRegistry = new InvocationRegistry(logger, callIdSequence, properties);
}
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());
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class BackpressureRegulatorTest method newCallIdSequence_whenBackPressureEnabled.
// ========================== newCallIdSequence =================
@Test
public void newCallIdSequence_whenBackPressureEnabled() {
Config config = new Config();
config.setProperty(BACKPRESSURE_ENABLED.getName(), "true");
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
BackpressureRegulator backpressureRegulator = new BackpressureRegulator(hazelcastProperties, logger);
CallIdSequence callIdSequence = backpressureRegulator.newCallIdSequence(ConcurrencyDetection.createEnabled(100));
assertInstanceOf(CallIdSequenceWithBackpressure.class, callIdSequence);
assertEquals(backpressureRegulator.getMaxConcurrentInvocations(), callIdSequence.getMaxConcurrentInvocations());
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class BackpressureRegulatorTest method testWriteThroughDoesntEnableBackPressure.
@Test
public void testWriteThroughDoesntEnableBackPressure() {
Config config = new Config();
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
BackpressureRegulator regulator = new BackpressureRegulator(hazelcastProperties, logger);
CallIdSequence callIdSequence = regulator.newCallIdSequence(ConcurrencyDetection.createEnabled(1000));
assertEquals(Integer.MAX_VALUE, callIdSequence.getMaxConcurrentInvocations());
}
use of com.hazelcast.spi.properties.HazelcastProperties in project hazelcast by hazelcast.
the class BackpressureRegulatorTest method newDisabledBackPressureService.
private BackpressureRegulator newDisabledBackPressureService() {
Config config = new Config();
config.setProperty(BACKPRESSURE_ENABLED.getName(), "false");
HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
return new BackpressureRegulator(hazelcastProperties, logger);
}
Aggregations