Search in sources :

Example 6 with SaxElementBuilder

use of nl.nn.adapterframework.xml.SaxElementBuilder in project iaf by ibissource.

the class DB2XMLWriter method getRowXml.

public static String getRowXml(IDbmsSupport dbmsSupport, ResultSet rs, int rowNumber, ResultSetMetaData rsmeta, String blobCharset, boolean decompressBlobs, String nullValue, boolean trimSpaces, boolean getBlobSmart) throws SenderException, SQLException, SAXException {
    SaxElementBuilder parent = new SaxElementBuilder();
    getRowXml(parent, dbmsSupport, rs, rowNumber, rsmeta, blobCharset, decompressBlobs, nullValue, trimSpaces, getBlobSmart);
    return parent.toString();
}
Also used : SaxElementBuilder(nl.nn.adapterframework.xml.SaxElementBuilder)

Example 7 with SaxElementBuilder

use of nl.nn.adapterframework.xml.SaxElementBuilder in project iaf by ibissource.

the class MailFileSystemTestBase method testExtractProblematicMessage.

@Test
public void testExtractProblematicMessage() throws Exception {
    M emailMessage = getFirstFileFromFolder("XmlProblem");
    SaxElementBuilder xml = new SaxElementBuilder("email");
    fileSystem.extractEmail(emailMessage, xml);
    xml.close();
    String expected = TestFileUtils.getTestFile("/ExchangeMailProblem.xml");
    MatchUtils.assertXmlEquals(expected, xml.toString());
}
Also used : SaxElementBuilder(nl.nn.adapterframework.xml.SaxElementBuilder) Test(org.junit.Test)

Example 8 with SaxElementBuilder

use of nl.nn.adapterframework.xml.SaxElementBuilder in project iaf by ibissource.

the class MailFileSystemTestBase method testExtractNormalMessage.

@Test
public void testExtractNormalMessage() throws Exception {
    M emailMessage = getFirstFileFromFolder(null);
    SaxElementBuilder xml = new SaxElementBuilder("email");
    fileSystem.extractEmail(emailMessage, xml);
    xml.close();
    String expected = TestFileUtils.getTestFile("/ExchangeMailNormal.xml");
    MatchUtils.assertXmlEquals(expected, xml.toString());
}
Also used : SaxElementBuilder(nl.nn.adapterframework.xml.SaxElementBuilder) Test(org.junit.Test)

Example 9 with SaxElementBuilder

use of nl.nn.adapterframework.xml.SaxElementBuilder in project iaf by ibissource.

the class MailFileSystemTestBase method testExtractProblematicMessage2.

@Test
public void testExtractProblematicMessage2() throws Exception {
    M emailMessage = getFirstFileFromFolder("XmlProblem2");
    SaxElementBuilder xml = new SaxElementBuilder("email");
    fileSystem.extractEmail(emailMessage, xml);
    xml.close();
    String expected = TestFileUtils.getTestFile("/ExchangeMailProblem2.xml");
    MatchUtils.assertXmlEquals(expected, xml.toString());
}
Also used : SaxElementBuilder(nl.nn.adapterframework.xml.SaxElementBuilder) Test(org.junit.Test)

Example 10 with SaxElementBuilder

use of nl.nn.adapterframework.xml.SaxElementBuilder in project iaf by ibissource.

the class MailFileSystemTestBase method testExtractMessageWithMessageAttached.

// @Test
// public void testExtractMessageWithProblematicAddress2() throws Exception {
// M emailMessage = getFirstFileFromFolder("FromAddressProblem2");
// SaxElementBuilder xml = new SaxElementBuilder("email");
// fileSystem.extractEmail(emailMessage, xml);
// xml.close();
// String expected = TestFileUtils.getTestFile("/ExchangeMailFromAddressProblem2.xml");
// MatchUtils.assertXmlEquals(expected,xml.toString());
// }
// 
// @Test
// public void testExtractMessageWithProblematicAddress3() throws Exception {
// M emailMessage = getFirstFileFromFolder("FromAddressProblem3");
// SaxElementBuilder xml = new SaxElementBuilder("email");
// fileSystem.extractEmail(emailMessage, xml);
// xml.close();
// String expected = TestFileUtils.getTestFile("/ExchangeMailFromAddressProblem3.xml");
// MatchUtils.assertXmlEquals(expected,xml.toString());
// }
@Test
public void testExtractMessageWithMessageAttached() throws Exception {
    M emailMessage = getFirstFileFromFolder("AttachedMessage");
    SaxElementBuilder xml = new SaxElementBuilder("email");
    fileSystem.extractEmail(emailMessage, xml);
    xml.close();
    String expected = TestFileUtils.getTestFile("/ExchangeMailAttachedMessage.xml");
    MatchUtils.assertXmlEquals(expected, xml.toString());
}
Also used : SaxElementBuilder(nl.nn.adapterframework.xml.SaxElementBuilder) Test(org.junit.Test)

Aggregations

SaxElementBuilder (nl.nn.adapterframework.xml.SaxElementBuilder)15 Test (org.junit.Test)7 SAXException (org.xml.sax.SAXException)5 IOException (java.io.IOException)2 SQLException (java.sql.SQLException)2 SenderException (nl.nn.adapterframework.core.SenderException)2 SaxDocumentBuilder (nl.nn.adapterframework.xml.SaxDocumentBuilder)2 XmlWriter (nl.nn.adapterframework.xml.XmlWriter)2 Reader (java.io.Reader)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 ResultSetMetaData (java.sql.ResultSetMetaData)1 Statement (java.sql.Statement)1 Map (java.util.Map)1 AddressException (javax.mail.internet.AddressException)1 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)1 ListenerException (nl.nn.adapterframework.core.ListenerException)1 PipeRunException (nl.nn.adapterframework.core.PipeRunException)1 Message (nl.nn.adapterframework.stream.Message)1 MessageOutputStream (nl.nn.adapterframework.stream.MessageOutputStream)1 PrettyPrintFilter (nl.nn.adapterframework.xml.PrettyPrintFilter)1