use of nl.nn.adapterframework.senders.XsltSender in project iaf by ibissource.
the class ForEachChildElementPipeTest method testElementChain.
// The XmlFileElementIteratorPipe has been deprecated, elementChain has been replaced with targetElement + containerElement.
// This test proves that the old method works with the ForEachChildElemenPipe.
// The xPath in the sender was adjusted to match the targetElement
@Test
public void testElementChain() throws Exception {
XsltSender sender = new XsltSender();
sender.setXpathExpression("concat(Party/Person/PersonName/Id,'_',Party/Person/Demographics/Gender)");
pipe.setProcessFile(true);
pipe.setSender(sender);
pipe.setContainerElement("PartyInternalAgreementRole");
pipe.setTargetElement("Party");
pipe.configure();
pipe.start();
URL input = TestFileUtils.getTestFileURL("/XmlFileElementIteratorPipe/input.xml");
File file = new File(input.toURI());
String expected = TestFileUtils.getTestFile("/XmlFileElementIteratorPipe/ElementChainOutput.xml");
PipeRunResult prr = doPipe(pipe, file.toString(), session);
String result = Message.asString(prr.getResult());
TestAssertions.assertEqualsIgnoreCRLF(expected, result);
}
use of nl.nn.adapterframework.senders.XsltSender in project iaf by ibissource.
the class XmlFileElementIteratorPipeTest method testElementName.
@Test
public void testElementName() throws Exception {
XsltSender sender = new XsltSender();
sender.setXpathExpression("concat(Person/PersonName/Id,'_',Person/Demographics/Gender)");
pipe.setSender(sender);
pipe.setElementName("Person");
pipe.configure();
pipe.start();
URL input = TestFileUtils.getTestFileURL("/XmlFileElementIteratorPipe/input.xml");
File file = new File(input.toURI());
String expected = TestFileUtils.getTestFile("/XmlFileElementIteratorPipe/ElementNameOutput.xml");
PipeRunResult prr = doPipe(pipe, file.toString(), session);
String result = Message.asString(prr.getResult());
TestAssertions.assertEqualsIgnoreCRLF(expected, result);
}
use of nl.nn.adapterframework.senders.XsltSender in project iaf by ibissource.
the class ParallelXsltTest method createPipe.
@Override
public SenderPipe createPipe() {
SenderPipe pipe = new SenderPipe();
SenderSeries psenders = createSenderContainer();
xsltSenders = new ArrayList<XsltSender>();
for (int i = 0; i < NUM_SENDERS; i++) {
XsltSender sender = new XsltSender();
// sender.setSessionKey("out"+i);
sender.setOmitXmlDeclaration(true);
sender.addParameter(new Parameter("header", "header" + i));
session.put("sessionKey" + i, "sessionKeyValue" + i);
sender.addParameter(ParameterBuilder.create().withName("sessionKey").withSessionKey("sessionKey" + i));
autowireByType(sender);
psenders.registerSender(sender);
xsltSenders.add(sender);
}
session.put("sessionKeyGlobal", "sessionKeyGlobalValue");
psenders.addParameter(ParameterBuilder.create().withName("sessionKeyGlobal").withSessionKey("sessionKeyGlobal"));
pipe.setSender(psenders);
return pipe;
}
use of nl.nn.adapterframework.senders.XsltSender in project iaf by ibissource.
the class ForEachChildElementPipeTest method testElementName.
// The XmlFileElementIteratorPipe has been deprecated, elementName has been replaced by targetElement.
// This test proves that the old method works with the ForEachChildElemenPipe
@Test
public void testElementName() throws Exception {
XsltSender sender = new XsltSender();
sender.setXpathExpression("concat(Person/PersonName/Id,'_',Person/Demographics/Gender)");
pipe.setProcessFile(true);
pipe.setSender(sender);
pipe.setTargetElement("Person");
pipe.configure();
pipe.start();
URL input = TestFileUtils.getTestFileURL("/XmlFileElementIteratorPipe/input.xml");
File file = new File(input.toURI());
String expected = TestFileUtils.getTestFile("/XmlFileElementIteratorPipe/ElementNameOutput.xml");
PipeRunResult prr = doPipe(pipe, file.toString(), session);
String result = Message.asString(prr.getResult());
TestAssertions.assertEqualsIgnoreCRLF(expected, result);
}
use of nl.nn.adapterframework.senders.XsltSender in project iaf by ibissource.
the class XsltSenderTest method createPipe.
@Override
public SenderPipe createPipe() {
SenderPipe pipe = new SenderPipe();
sender = new XsltSender();
autowireByType(sender);
pipe.setSender(sender);
return pipe;
}
Aggregations