Search in sources :

Example 1 with DirectWrapperPipe

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;
}
Also used : Message(nl.nn.adapterframework.stream.Message) EchoPipe(nl.nn.adapterframework.pipes.EchoPipe) CorePipeProcessor(nl.nn.adapterframework.processors.CorePipeProcessor) TestConfiguration(nl.nn.adapterframework.testutil.TestConfiguration) DirectWrapperPipe(nl.nn.adapterframework.extensions.esb.DirectWrapperPipe) Test(org.junit.Test)

Aggregations

DirectWrapperPipe (nl.nn.adapterframework.extensions.esb.DirectWrapperPipe)1 EchoPipe (nl.nn.adapterframework.pipes.EchoPipe)1 CorePipeProcessor (nl.nn.adapterframework.processors.CorePipeProcessor)1 Message (nl.nn.adapterframework.stream.Message)1 TestConfiguration (nl.nn.adapterframework.testutil.TestConfiguration)1 Test (org.junit.Test)1