super.loop_withBreak();
}
@Test
public void loop_conditionNotSatisfied() throws Exception {
PipelineImpl pipeline = createPipeline(new LogValve(), valve, new LogValve());
valve.setCondition(new JexlCondition("loopCount<=2"));
valve.setLoopBody(createPipeline(new LogValve(), new LogValve(), new LogValve()));
valve.afterPropertiesSet();
assertInvoke(pipeline, false);
assertLog("1-1", //
"2-1-loop-0", "2-2-loop-0", "2-3-loop-0", //
"2-1-loop-1", "2-2-loop-1", "2-3-loop-1", //
"2-1-loop-2", "2-2-loop-2", "2-3-loop-2", //
"1-3");
// set maxLoopCount = 1
valve.setMaxLoopCount(1);
try {
pipeline.newInvocation().invoke();
fail();
} catch (TooManyLoopsException e) {
assertThat(e, exception("Too many loops: exceeds the maximum count: 1"));
}