use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class XmlSwitchTest method withSessionKey.
@Test
public void withSessionKey() throws Exception {
pipe.registerForward(new PipeForward("Envelope", "Envelope-Path"));
pipe.registerForward(new PipeForward("selectValue", "SelectValue-Path"));
pipe.setSessionKey("selectKey");
session = new PipeLineSession();
session.put("selectKey", "selectValue");
Message input = TestFileUtils.getTestFileMessage("/XmlSwitch/in.xml");
testSwitch(input, "selectValue");
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class XmlSwitchTest method basicXpathSessionKeyUsedAsInput.
@Test
public void basicXpathSessionKeyUsedAsInput() throws Exception {
pipe.registerForward(new PipeForward("Envelope", "Envelope-Path"));
pipe.setSessionKey("sessionKey");
pipe.setXpathExpression("name(/node()[position()=last()])");
session = new PipeLineSession();
Message input = TestFileUtils.getTestFileMessage("/XmlSwitch/in.xml");
session.put("sessionKey", input);
testSwitch(new Message("dummy"), "Envelope");
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class XmlSwitchTest method withSessionKeyOverridesGetInputFromSessionKey.
@Test
public void withSessionKeyOverridesGetInputFromSessionKey() throws Exception {
pipe.registerForward(new PipeForward("Envelope", "Envelope-Path"));
pipe.registerForward(new PipeForward("dummy", "dummy-Path"));
pipe.setGetInputFromSessionKey("input");
pipe.setSessionKey("selectKey");
pipe.setXpathExpression("name(/node()[position()=last()])");
session = new PipeLineSession();
session.put("selectKey", "<dummy/>");
Message input = TestFileUtils.getTestFileMessage("/XmlSwitch/in.xml");
session.put("input", input);
testSwitch(input, "dummy");
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class SoapWrapperPipeTest method testWrapSoapVersionSoap12.
@Test
public void testWrapSoapVersionSoap12() throws Exception {
pipe.setOutputNamespace(TARGET_NAMESPACE);
pipe.setSoapVersion(SoapVersion.SOAP12);
pipe.configure();
pipe.start();
String input = "<root>\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root>";
String expected = "<soapenv:Envelope xmlns:soapenv=\"http://www.w3.org/2003/05/soap-envelope\"><soapenv:Body>" + "<root xmlns=\"" + TARGET_NAMESPACE + "\">\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root></soapenv:Body></soapenv:Envelope>";
PipeRunResult prr = doPipe(pipe, input, new PipeLineSession());
String actual = prr.getResult().asString();
TestAssertions.assertEqualsIgnoreCRLF(expected, actual);
}
use of nl.nn.adapterframework.core.PipeLineSession in project iaf by ibissource.
the class SoapWrapperPipeTest method testUnwrapSwitchRoot.
@Test
public void testUnwrapSwitchRoot() throws Exception {
pipe.setDirection(Direction.UNWRAP);
pipe.setRoot("OtherRoot");
pipe.configure();
pipe.start();
String input = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Body>" + "<root xmlns=\"" + TARGET_NAMESPACE + "\">\n" + "<attrib>1</attrib>\n" + "<attrib>2</attrib>\n" + "</root></soapenv:Body></soapenv:Envelope>";
String expected = "<OtherRoot xmlns=\"" + TARGET_NAMESPACE + "\">" + "<attrib>1</attrib>" + "<attrib>2</attrib>" + "</OtherRoot>";
PipeRunResult prr = doPipe(pipe, input, new PipeLineSession());
String actual = prr.getResult().asString();
TestAssertions.assertEqualsIgnoreCRLF(expected, actual);
}
Aggregations