use of nl.nn.adapterframework.core.PipeLineSessionBase in project iaf by ibissource.
the class SoapValidatorTest method validate12_invalid.
@Test(expected = PipeRunException.class)
public void validate12_invalid() throws ConfigurationException, IOException, PipeRunException {
SoapValidator xml = getSoapValidator();
xml.setSoapVersion("1.2");
xml.doPipe(getTestXml("/SoapValidator/invalid_soap.xml"), new PipeLineSessionBase());
}
use of nl.nn.adapterframework.core.PipeLineSessionBase in project iaf by ibissource.
the class Json2XmlValidatorSmileyTest method xmlToJsonViaPipe.
public String xmlToJsonViaPipe(String xml) throws ConfigurationException, PipeStartException, PipeRunException {
Json2XmlValidator json2xml = new Json2XmlValidator();
json2xml.setWarn(false);
json2xml.setSchema(xsd);
json2xml.setRoot("x");
json2xml.setOutputFormat(json2xml.FORMAT_JSON);
json2xml.setThrowException(true);
json2xml.registerForward(new PipeForward("success", null));
json2xml.configure();
json2xml.start();
IPipeLineSession pipeLineSession = new PipeLineSessionBase();
PipeRunResult prr = json2xml.doPipe(xml, pipeLineSession);
return (String) prr.getResult();
}
use of nl.nn.adapterframework.core.PipeLineSessionBase in project iaf by ibissource.
the class Json2XmlValidatorSmileyTest method jsonToXmlViaPipe.
public String jsonToXmlViaPipe(String json) throws ConfigurationException, PipeStartException, PipeRunException {
Json2XmlValidator json2xml = new Json2XmlValidator();
json2xml.setWarn(false);
json2xml.setSchema(xsd);
json2xml.setRoot("x");
json2xml.setThrowException(true);
json2xml.registerForward(new PipeForward("success", null));
json2xml.configure();
json2xml.start();
IPipeLineSession pipeLineSession = new PipeLineSessionBase();
PipeRunResult prr = json2xml.doPipe(json, pipeLineSession);
return (String) prr.getResult();
}
use of nl.nn.adapterframework.core.PipeLineSessionBase in project iaf by ibissource.
the class TestPipeline method processMessage.
@SuppressWarnings({ "rawtypes", "unchecked" })
private PipeLineResult processMessage(IAdapter adapter, String message, boolean writeSecLogMessage) {
String messageId = "testmessage" + Misc.createSimpleUUID();
IPipeLineSession pls = new PipeLineSessionBase();
Map ibisContexts = XmlUtils.getIbisContext(message);
String technicalCorrelationId = null;
if (ibisContexts != null) {
String contextDump = "ibisContext:";
for (Iterator it = ibisContexts.keySet().iterator(); it.hasNext(); ) {
String key = (String) it.next();
String value = (String) ibisContexts.get(key);
if (log.isDebugEnabled()) {
contextDump = contextDump + "\n " + key + "=[" + value + "]";
}
if (key.equals(IPipeLineSession.technicalCorrelationIdKey)) {
technicalCorrelationId = value;
} else {
pls.put(key, value);
}
}
if (log.isDebugEnabled()) {
log.debug(contextDump);
}
}
Date now = new Date();
PipeLineSessionBase.setListenerParameters(pls, messageId, technicalCorrelationId, now, now);
if (writeSecLogMessage) {
secLog.info("message [" + message + "]");
}
return adapter.processMessage(messageId, message, pls);
}
use of nl.nn.adapterframework.core.PipeLineSessionBase in project iaf by ibissource.
the class XmlValidatorTest method step5ValidationErrorUnknownNamespace.
// TODO: make more precise, prefer a ConfigurationException over a XmlValidatorException
// step4errorr1.xml uses the namespace xmlns="http://www.ing.com/BESTAATNIET
@Test(expected = Exception.class)
public void step5ValidationErrorUnknownNamespace() throws PipeRunException, ConfigurationException, IOException, XmlValidatorException {
XmlValidator validator = getValidator("http://schemas.xmlsoap.org/soap/envelope/ " + "/Tibco/xsd/soap/envelope.xsd " + "http://www.ing.com/CSP/XSD/General/Message_2 " + "/Tibco/wsdl/BankingCustomer_01_GetPartyBasicDataBanking_01_concrete1/Message_2.xsd " + "http://www.ing.com/nl/banking/coe/xsd/bankingcustomer_generate_01/getpartybasicdatabanking_01 " + "/Tibco/wsdl/BankingCustomer_01_GetPartyBasicDataBanking_01_concrete1/getpartybasicdatabanking_01.xsd " + "http://www.ing.com/bis/xsd/nl/banking/bankingcustomer_generate_01_getpartybasicdatabanking_request_01 " + "/Tibco/wsdl/BankingCustomer_01_GetPartyBasicDataBanking_01_concrete1/bankingcustomer_generate_01_getpartybasicdatabanking_request_01.xsd");
validator.setIgnoreUnknownNamespaces(false);
validator.validate(getTestXml("/Tibco/in/step5error_unknown_namespace.xml"), new PipeLineSessionBase());
}
Aggregations