use of com.ibm.streamsx.topology.consistent.ConsistentRegionConfig in project streamsx.topology by IBMStreams.
the class ConsistentRegionConfigTest method checkCRC.
private static void checkCRC(ConsistentRegionConfig config, Trigger trigger, int period, long drain, long reset, int attempts) {
assertNotNull(config.getTrigger());
assertTrue(config.getDrainTimeout() > 0);
assertTrue(config.getResetTimeout() > 0);
assertTrue(config.getMaxConsecutiveResetAttempts() > 0);
assertEquals(TimeUnit.SECONDS, config.getTimeUnit());
assertEquals(trigger, config.getTrigger());
assertEquals(((long) period), config.getPeriod());
assertEquals(drain, config.getDrainTimeout());
assertEquals(reset, config.getResetTimeout());
assertEquals(attempts, config.getMaxConsecutiveResetAttempts());
assertEquals(config, config);
ConsistentRegionConfig dup;
if (config.getTrigger() == Trigger.OPERATOR_DRIVEN)
dup = operatorDriven();
else
dup = periodic(period);
dup = dup.drainTimeout(drain).resetTimeout(reset).maxConsecutiveResetAttempts(attempts);
assertEquals(config, dup);
assertEquals(config.hashCode(), dup.hashCode());
}
use of com.ibm.streamsx.topology.consistent.ConsistentRegionConfig in project streamsx.topology by IBMStreams.
the class ConsistentRegionConfigTest method testDefaultOpDrivenNew.
@Test
public void testDefaultOpDrivenNew() {
ConsistentRegionConfig config = new ConsistentRegionConfig();
checkCRC(config, Trigger.OPERATOR_DRIVEN, -1, 180, 180, 5);
}
Aggregations