// ... so the interceptor after() is not called:
assertEquals("[2, 1]", calls.toString());
}
public void testOpenInterceptors() throws Exception {
RepeatTemplate template = new RepeatTemplate();
final List<Object> calls = new ArrayList<Object>();
template.setListeners(new RepeatListener[] { new RepeatListenerSupport() {
@Override
public void open(RepeatContext context) {
calls.add("1");
}
}, new RepeatListenerSupport() {
@Override
public void open(RepeatContext context) {
calls.add("2");
context.setCompleteOnly();
}
} });
template.iterate(new RepeatCallback() {
@Override
public RepeatStatus doInIteration(RepeatContext context) throws Exception {
count++;
return RepeatStatus.CONTINUABLE;
}