Search in sources :

Example 46 with ParameterResolutionContext

use of nl.nn.adapterframework.parameters.ParameterResolutionContext in project iaf by ibissource.

the class XsltSenderTest method basic.

@Test
public void basic() throws SenderException, TimeOutException, ConfigurationException, IOException {
    sender.setStyleSheetName("/Xslt/duplicateImport/root.xsl");
    sender.configure();
    String input = getFile("/Xslt/duplicateImport/in.xml");
    log.debug("inputfile [" + input + "]");
    String expected = getFile("/Xslt/duplicateImport/out.xml");
    ParameterResolutionContext prc = new ParameterResolutionContext(input, session);
    String result = sender.sendMessage(null, input, prc);
    assertEquals(expected.replaceAll("\\s", ""), result.replaceAll("\\s", ""));
}
Also used : ParameterResolutionContext(nl.nn.adapterframework.parameters.ParameterResolutionContext) Test(org.junit.Test)

Example 47 with ParameterResolutionContext

use of nl.nn.adapterframework.parameters.ParameterResolutionContext in project iaf by ibissource.

the class ConfigData method activeConfigQuery.

private String activeConfigQuery(IPipeLineSession session, String name, String formJmsRealm, String result) throws PipeRunException {
    FixedQuerySender qs = (FixedQuerySender) ibisContext.createBeanAutowireByName(FixedQuerySender.class);
    try {
        qs.setName("QuerySender");
        qs.setJmsRealm(formJmsRealm);
        qs.setQueryType("update");
        qs.setQuery("UPDATE IBISCONFIG SET ACTIVECONFIG = '" + qs.getDbmsSupport().getBooleanValue(false) + "' WHERE NAME=?");
        Parameter param = new Parameter();
        param.setName("name");
        param.setValue(name);
        qs.addParameter(param);
        qs.setScalar(true);
        qs.configure();
        qs.open();
        ParameterResolutionContext prc = new ParameterResolutionContext(DUMMY, session);
        result = qs.sendMessage(DUMMY, DUMMY, prc);
    } catch (Exception t) {
        throw new PipeRunException(this, getLogPrefix(session) + "Error occured on executing jdbc query", t);
    } finally {
        qs.close();
    }
    return result;
}
Also used : PipeRunException(nl.nn.adapterframework.core.PipeRunException) Parameter(nl.nn.adapterframework.parameters.Parameter) ParameterResolutionContext(nl.nn.adapterframework.parameters.ParameterResolutionContext) FixedQuerySender(nl.nn.adapterframework.jdbc.FixedQuerySender) PipeRunException(nl.nn.adapterframework.core.PipeRunException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException)

Aggregations

ParameterResolutionContext (nl.nn.adapterframework.parameters.ParameterResolutionContext)47 PipeRunException (nl.nn.adapterframework.core.PipeRunException)32 PipeRunResult (nl.nn.adapterframework.core.PipeRunResult)21 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)20 ParameterException (nl.nn.adapterframework.core.ParameterException)18 IOException (java.io.IOException)17 ParameterValueList (nl.nn.adapterframework.parameters.ParameterValueList)16 Parameter (nl.nn.adapterframework.parameters.Parameter)15 Map (java.util.Map)10 SenderException (nl.nn.adapterframework.core.SenderException)10 ParameterList (nl.nn.adapterframework.parameters.ParameterList)10 FixedQuerySender (nl.nn.adapterframework.jdbc.FixedQuerySender)8 PipeForward (nl.nn.adapterframework.core.PipeForward)7 HashMap (java.util.HashMap)6 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)5 PipeLineSessionBase (nl.nn.adapterframework.core.PipeLineSessionBase)4 DomBuilderException (nl.nn.adapterframework.util.DomBuilderException)4 URL (java.net.URL)3 ISender (nl.nn.adapterframework.core.ISender)3 PipeStartException (nl.nn.adapterframework.core.PipeStartException)3