use of nl.nn.adapterframework.core.PipeRunResult in project iaf by ibissource.
the class ShowConfigurationStatusTest method testSingleConfig.
@Test
public void testSingleConfig() throws ConfigurationException, PipeRunException, DomBuilderException, SAXException, IOException, TransformerException {
ShowConfigurationStatus showConfigurationStatus = new ShowConfigurationStatus();
PipeLine pipeLine = new PipeLine();
Adapter adapter = (Adapter) ibisContext.getIbisManager().getRegisteredAdapter("WebControlShowConfigurationStatus");
pipeLine.setAdapter(adapter);
showConfigurationStatus.registerForward(createPipeSuccessForward());
showConfigurationStatus.configure(pipeLine);
session.put("configuration", "Ibis4Example");
MockHttpServletRequest request = new MockHttpServletRequest();
session.put(IPipeLineSession.HTTP_REQUEST_KEY, request);
PipeRunResult pipeRunResult = showConfigurationStatus.doPipe(null, session);
compareXML("webcontrol/singleConfig.xml", (String) pipeRunResult.getResult());
}
use of nl.nn.adapterframework.core.PipeRunResult in project iaf by ibissource.
the class HashPipeTest method basic.
@Test
public void basic() throws ConfigurationException, PipeStartException, IOException, PipeRunException {
pipe.setSecret("Potato");
pipe.configure();
pipe.start();
PipeRunResult prr = pipe.doPipe("hash me plz", session);
String hash = (String) prr.getResult();
assertEquals("KZAvcWh5wSTeoBWty9MHZl+L4ApUjbWnJNaVq6xftAo=", hash);
}
use of nl.nn.adapterframework.core.PipeRunResult in project iaf by ibissource.
the class HashPipeTest method sha512.
@Test
public void sha512() throws ConfigurationException, PipeStartException, IOException, PipeRunException {
pipe.setSecret("Potato");
pipe.setAlgorithm("HmacSHA512");
pipe.configure();
pipe.start();
PipeRunResult prr = pipe.doPipe("hash me plz", session);
String hash = (String) prr.getResult();
assertEquals("56V9GhAPU9NPP76zJ5KVLrfMaCherC8JcY16PTPEO3W+yxNnoXwmLS+Ic61J3gqZyeUfc0VZzzgg23WqesXm2g==", hash);
}
use of nl.nn.adapterframework.core.PipeRunResult in project iaf by ibissource.
the class Json2WsdlXmlValidatorTest method validatePlainText.
public void validatePlainText(String input, String expectedError) throws Exception {
String wsdl = "/GetPolicyDetailsTravel/wsdl/GetPolicyDetailsTravel.wsdl";
String soapBody = "GetPolicyDetailsTravel_Response";
WsdlXmlValidator val = new WsdlXmlValidator();
val.setWsdl(wsdl);
val.setThrowException(true);
val.registerForward(new PipeForward("success", null));
val.setSoapBody(soapBody);
val.configure();
PipeRunResult result;
try {
result = val.doPipe(input, session);
String resultStr = (String) result.getResult();
fail("expected error [" + expectedError + "]");
} catch (PipeRunException e) {
String msg = e.getMessage();
if (msg == null || msg.indexOf(expectedError) < 0) {
fail("expected [" + expectedError + "] in error message, but was [" + msg + "]");
}
}
}
use of nl.nn.adapterframework.core.PipeRunResult in project iaf by ibissource.
the class JsonXsltPipeTest method basic.
// @Test
// public void testGetInput() throws ConfigurationException, PipeStartException, IOException, PipeRunException, DomBuilderException, TransformerException {
// pipe.setStyleSheetName("/Xslt3/orgchart.xslt");
// pipe.configure();
// pipe.start();
// String input=getFile("/Xslt3/employees.json");
// log.debug("inputfile ["+input+"]");
//
// ParameterResolutionContext prc = pipe.getInput(input, session);
// prc.getInputSource();
// TransformerFactory factory = XmlUtils.getTransformerFactory(false);
// Transformer transformer = factory.newTransformer();
//
// String result = XmlUtils.transformXml(transformer, prc.getInputSource());
//
// String expected=getFile("/Xslt3/employees.xml");
// assertEquals(expected,result);
// }
@Test
public void basic() throws ConfigurationException, PipeStartException, IOException, PipeRunException {
pipe.setStyleSheetName("/Xslt3/orgchart.xslt");
pipe.configure();
pipe.start();
String input = getFile("/Xslt3/employees.json");
log.debug("inputfile [" + input + "]");
String expectedJson = getFile("/Xslt3/orgchart.json");
PipeRunResult prr = pipe.doPipe(input, session);
String jsonOut = (String) prr.getResult();
assertJsonEqual(null, expectedJson, jsonOut);
}
Aggregations