Search in sources :

Example 26 with Resource

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

the class XmlParserTest method testParseXmlResourceWithExternalEntityInjection.

@Test
@Ignore("requires proper setup on the classpath filesystem. In order for this test to pass properly, the file referenced by the external entity in the input file must exist on the file system. " + "I currently consider it too much of a hassle to automate this setup in a way that works for both Windows and Linux")
public void testParseXmlResourceWithExternalEntityInjection() throws IOException, SAXException, ParserConfigurationException {
    Resource input = Resource.getResource("/XmlUtils/EntityResolution/in-file-entity-c-temp.xml");
    String expected = TestFileUtils.getTestFile("/XmlUtils/EntityResolution/out-resolved.xml");
    XmlWriter writer = new XmlWriter();
    XmlUtils.parseXml(input, writer);
    MatchUtils.assertXmlEquals(expected, writer.toString());
}
Also used : Resource(nl.nn.adapterframework.core.Resource) XmlWriter(nl.nn.adapterframework.xml.XmlWriter) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 27 with Resource

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

the class XmlParserTest method testParseXmlResourceWithRelativeEntityInjection.

@Test
public void testParseXmlResourceWithRelativeEntityInjection() throws IOException, SAXException, ParserConfigurationException {
    Resource input = Resource.getResource("/XmlUtils/EntityResolution/in-relative-entity.xml");
    String expected = TestFileUtils.getTestFile("/XmlUtils/EntityResolution/out-resolved.xml");
    XmlWriter writer = new XmlWriter();
    XmlUtils.parseXml(input, writer);
    MatchUtils.assertXmlEquals(expected, writer.toString());
}
Also used : Resource(nl.nn.adapterframework.core.Resource) XmlWriter(nl.nn.adapterframework.xml.XmlWriter) Test(org.junit.Test)

Aggregations

Resource (nl.nn.adapterframework.core.Resource)27 Test (org.junit.Test)12 IOException (java.io.IOException)10 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)7 XmlWriter (nl.nn.adapterframework.xml.XmlWriter)7 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)6 SAXException (org.xml.sax.SAXException)6 TransformerException (javax.xml.transform.TransformerException)4 TransformerPool (nl.nn.adapterframework.util.TransformerPool)4 URL (java.net.URL)3 PipeRunException (nl.nn.adapterframework.core.PipeRunException)3 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 ValidatorHandler (javax.xml.validation.ValidatorHandler)2 ConfigurationDigester (nl.nn.adapterframework.configuration.ConfigurationDigester)2 CredentialFactory (nl.nn.adapterframework.util.CredentialFactory)2 Digester (org.apache.commons.digester3.Digester)2 QueueInfo (com.tibco.tibjms.admin.QueueInfo)1 TibjmsAdmin (com.tibco.tibjms.admin.TibjmsAdmin)1 TibjmsAdminException (com.tibco.tibjms.admin.TibjmsAdminException)1 File (java.io.File)1