use of nl.nn.adapterframework.extensions.esb.DirectWrapperPipe in project iaf by ibissource.
the class PipeLineTest method testDirectWrapperPipeSuccessForward.
// Should add tests to assertThat(configuration.getConfigWarning(0), StringEndsWith.endsWith("] has no pipe forwards defined"));
@Test
public void testDirectWrapperPipeSuccessForward() throws ConfigurationException, PipeRunException {
TestConfiguration configuration = new TestConfiguration();
PipeLine pipeline = configuration.createBean(PipeLine.class);
PipeForward pf = configuration.createBean(PipeForward.class);
pf.setName("success");
pf.setPath("nextPipe");
PipeForward toExit = configuration.createBean(PipeForward.class);
toExit.setName("success");
toExit.setPath("EXIT");
DirectWrapperPipe pipe = configuration.createBean(DirectWrapperPipe.class);
pipe.setName("DirectWrapperPipe");
pipe.registerForward(pf);
pipeline.addPipe(pipe);
EchoPipe echoPipe = configuration.createBean(EchoPipe.class);
echoPipe.setName("nextPipe");
echoPipe.setPipeLine(pipeline);
echoPipe.registerForward(toExit);
pipeline.addPipe(echoPipe);
PipeLineExit exit = configuration.createBean(PipeLineExit.class);
exit.setPath("exit");
exit.setState(ExitState.SUCCESS);
pipeline.registerPipeLineExit(exit);
pipeline.setOwner(pipe);
pipeline.configure();
CorePipeProcessor cpp = configuration.createBean(CorePipeProcessor.class);
PipeLineSession ps = configuration.createBean(PipeLineSession.class);
PipeRunResult pipeRunResult = cpp.processPipe(pipeline, pipe, new Message("<dummy/>"), ps);
PipeForward pipeForward = pipeRunResult.getPipeForward();
IForwardTarget target = pipeline.resolveForward(pipe, pipeForward);
assertNotNull(target);
configuration.close();
configuration = null;
}
Aggregations