Search in sources :

Example 36 with PipeLine

use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.

the class WsdlGeneratorTest method testWsdlXmlValidatorWithWsdl.

@Test
public void testWsdlXmlValidatorWithWsdl() throws Exception {
    PipeLine pipeline = createPipeline();
    WsdlXmlValidator inputValidator = new WsdlXmlValidator();
    inputValidator.setWsdl(validateResource("/WsdlGenerator/HelloWorld.wsdl"));
    inputValidator.setSoapBody("HelloWorld_Request");
    inputValidator.setOutputSoapBody("HelloWorld_Response");
    inputValidator.setSoapBodyNamespace("http://dummy.nl/HelloWorld");
    inputValidator.setThrowException(true);
    pipeline.setInputValidator(inputValidator);
    pipeline.getAdapter().configure();
    WsdlGenerator generator = new WsdlGenerator(pipeline);
    assertNotNull(generator);
    generator.init();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    generator.wsdl(out, "dummyServlet");
    String result = new String(out.toByteArray());
    result = result.replaceAll("[0-9]{4}-.*:[0-9]{2}", "DATETIME");
    TestAssertions.assertEqualsIgnoreCRLF(TestFileUtils.getTestFile("/WsdlGenerator/GeneratedHelloWorld.wsdl"), result);
}
Also used : WsdlXmlValidator(nl.nn.adapterframework.pipes.WsdlXmlValidator) ByteArrayOutputStream(java.io.ByteArrayOutputStream) PipeLine(nl.nn.adapterframework.core.PipeLine) Test(org.junit.Test)

Example 37 with PipeLine

use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.

the class WsdlTest method wubFindIntermediary.

@Test
public void wubFindIntermediary() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
    PipeLine pipe = mockPipeLine(getXmlValidatorInstance("FindIntermediaryREQ", null, null, "http://wub2nn.nn.nl/FindIntermediary WsdlTest/FindIntermediary/xsd/XSD_FindIntermediary_v1.1_r1.0.xsd"), getXmlValidatorInstance("FindIntermediaryRLY", null, null, "http://wub2nn.nn.nl/FindIntermediary WsdlTest/FindIntermediary/xsd/XSD_FindIntermediary_v1.1_r1.0.xsd"), "http://wub2nn.nn.nl/FindIntermediary", "WsdlTest/FindIntermediary");
    WsdlGenerator wsdl = new WsdlGenerator(pipe);
    wsdl.init();
    wsdl.setUseIncludes(true);
    assertTrue(wsdl.isUseIncludes());
    test(wsdl, "WsdlTest/FindIntermediary.test.wsdl");
    zip(wsdl);
// assertEquals(2, wsdl.getXSDs(true).size()); TODO?
}
Also used : PipeLine(nl.nn.adapterframework.core.PipeLine) XmlValidatorTest(nl.nn.adapterframework.pipes.XmlValidatorTest) Test(org.junit.Test)

Example 38 with PipeLine

use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.

the class WsdlTest method wubCalculateQuoteAndPolicyValuesLifeRetailMixed.

@Test
public void wubCalculateQuoteAndPolicyValuesLifeRetailMixed() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
    XmlValidator inputValidator = getXmlValidatorInstance("CalculationRequest", "CalculationResponse", null, "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail/xsd/CalculationRequestv2.1.xsd " + "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail_response  WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail/xsd/CalculationRespons.xsd");
    IValidator outputValidator = inputValidator.getResponseValidator();
    PipeLine pipe = mockPipeLine(inputValidator, outputValidator, "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail", "WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail");
    WsdlGenerator wsdl = new WsdlGenerator(pipe);
    wsdl.init();
    wsdl.setUseIncludes(true);
    test(wsdl, "WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail.test.wsdl");
}
Also used : XmlValidator(nl.nn.adapterframework.pipes.XmlValidator) AbstractXmlValidator(nl.nn.adapterframework.validation.AbstractXmlValidator) XercesXmlValidator(nl.nn.adapterframework.validation.XercesXmlValidator) JavaxXmlValidator(nl.nn.adapterframework.validation.JavaxXmlValidator) IValidator(nl.nn.adapterframework.core.IValidator) PipeLine(nl.nn.adapterframework.core.PipeLine) XmlValidatorTest(nl.nn.adapterframework.pipes.XmlValidatorTest) Test(org.junit.Test)

Example 39 with PipeLine

use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.

the class WsdlTest method wubFindIntermediaryMixed.

@Test
public void wubFindIntermediaryMixed() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
    XmlValidator inputValidator = getXmlValidatorInstance("FindIntermediaryREQ", "FindIntermediaryRLY", null, "http://wub2nn.nn.nl/FindIntermediary WsdlTest/FindIntermediary/xsd/XSD_FindIntermediary_v1.1_r1.0.xsd");
    IValidator outputValidator = inputValidator.getResponseValidator();
    PipeLine pipe = mockPipeLine(inputValidator, outputValidator, "http://wub2nn.nn.nl/FindIntermediary", "WsdlTest/FindIntermediary");
    WsdlGenerator wsdl = new WsdlGenerator(pipe);
    wsdl.setUseIncludes(true);
    wsdl.init();
    assertTrue(wsdl.isUseIncludes());
    test(wsdl, "WsdlTest/FindIntermediary.test.wsdl");
    zip(wsdl);
// assertEquals(2, wsdl.getXSDs(true).size()); TODO?
}
Also used : XmlValidator(nl.nn.adapterframework.pipes.XmlValidator) AbstractXmlValidator(nl.nn.adapterframework.validation.AbstractXmlValidator) XercesXmlValidator(nl.nn.adapterframework.validation.XercesXmlValidator) JavaxXmlValidator(nl.nn.adapterframework.validation.JavaxXmlValidator) IValidator(nl.nn.adapterframework.core.IValidator) PipeLine(nl.nn.adapterframework.core.PipeLine) XmlValidatorTest(nl.nn.adapterframework.pipes.XmlValidatorTest) Test(org.junit.Test)

Example 40 with PipeLine

use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.

the class WsdlTest method noroottagAndInclude.

@Test
@Ignore("not finished, but would fail, you must specify root tag now.")
public void noroottagAndInclude() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
    PipeLine simple = mockPipeLine(getXmlValidatorInstance(null, "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd"), getXmlValidatorInstance("b", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd"), "urn:webservice1", "TestRootTag");
    WsdlGenerator wsdl = new WsdlGenerator(simple);
    wsdl.setUseIncludes(true);
    test(wsdl, "WsdlTest/noroottag.test.wsdl");
}
Also used : PipeLine(nl.nn.adapterframework.core.PipeLine) Ignore(org.junit.Ignore) XmlValidatorTest(nl.nn.adapterframework.pipes.XmlValidatorTest) Test(org.junit.Test)

Aggregations

PipeLine (nl.nn.adapterframework.core.PipeLine)43 Adapter (nl.nn.adapterframework.core.Adapter)19 Test (org.junit.Test)17 XmlValidatorTest (nl.nn.adapterframework.pipes.XmlValidatorTest)12 IPipe (nl.nn.adapterframework.core.IPipe)10 PipeLineExit (nl.nn.adapterframework.core.PipeLineExit)8 MessageSendingPipe (nl.nn.adapterframework.pipes.MessageSendingPipe)8 IOException (java.io.IOException)6 IValidator (nl.nn.adapterframework.core.IValidator)6 XmlValidator (nl.nn.adapterframework.pipes.XmlValidator)6 Configuration (nl.nn.adapterframework.configuration.Configuration)5 PipeForward (nl.nn.adapterframework.core.PipeForward)5 PipeRunResult (nl.nn.adapterframework.core.PipeRunResult)5 Message (nl.nn.adapterframework.stream.Message)5 AbstractXmlValidator (nl.nn.adapterframework.validation.AbstractXmlValidator)5 JavaxXmlValidator (nl.nn.adapterframework.validation.JavaxXmlValidator)5 XercesXmlValidator (nl.nn.adapterframework.validation.XercesXmlValidator)5 ArrayList (java.util.ArrayList)4 Iterator (java.util.Iterator)4 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)4