Search in sources :

Example 11 with PADChannel

use of org.jpos.iso.channel.PADChannel in project jPOS by jpos.

the class StatefulFilterTest method testFilter7.

@Test
public void testFilter7() throws Throwable {
    int[] key = new int[0];
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setKey(key);
    statefulFilter.setMatchDirection(0);
    statefulFilter.setSavedFields(null);
    ISOMsg m = new ISOMsg("testStatefulFilterMti");
    ISOMsg result = statefulFilter.filter(new PADChannel(new XMLPackager()), m, new LogEvent(new Base1SubFieldPackager(), "testStatefulFilterTag"));
    assertSame("result", m, result);
}
Also used : XMLPackager(org.jpos.iso.packager.XMLPackager) Base1SubFieldPackager(org.jpos.iso.packager.Base1SubFieldPackager) ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) PADChannel(org.jpos.iso.channel.PADChannel) Test(org.junit.Test)

Example 12 with PADChannel

use of org.jpos.iso.channel.PADChannel in project jPOS by jpos.

the class XSLTFilterTest method testFilterThrowsVetoException1.

@Test
public void testFilterThrowsVetoException1() throws Throwable {
    XSLTFilter xSLTFilter = new XSLTFilter();
    try {
        xSLTFilter.filter(new PADChannel(new CTCSubFieldPackager()), null, new LogEvent("testXSLTFilterTag"));
        fail("Expected VetoException to be thrown");
    } catch (ISOFilter.VetoException ex) {
        assertEquals("ex.getMessage()", "java.lang.NullPointerException", ex.getMessage());
        assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
        assertNull("xSLTFilter.tfactory.getURIResolver()", xSLTFilter.tfactory.getURIResolver());
        assertNull("xSLTFilter.transformer", xSLTFilter.transformer);
    }
}
Also used : ISOFilter(org.jpos.iso.ISOFilter) LogEvent(org.jpos.util.LogEvent) PADChannel(org.jpos.iso.channel.PADChannel) CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) Test(org.junit.Test)

Aggregations

PADChannel (org.jpos.iso.channel.PADChannel)12 Test (org.junit.Test)12 LogEvent (org.jpos.util.LogEvent)8 ISOMsg (org.jpos.iso.ISOMsg)7 ISOChannel (org.jpos.iso.ISOChannel)3 SimpleConfiguration (org.jpos.core.SimpleConfiguration)2 ISOFilter (org.jpos.iso.ISOFilter)2 Base1SubFieldPackager (org.jpos.iso.packager.Base1SubFieldPackager)2 CTCSubFieldPackager (org.jpos.iso.packager.CTCSubFieldPackager)2 XMLPackager (org.jpos.iso.packager.XMLPackager)2 Configuration (org.jpos.core.Configuration)1 BASE24TCPChannel (org.jpos.iso.channel.BASE24TCPChannel)1 MD5Filter (org.jpos.iso.filter.MD5Filter)1 EuroSubFieldPackager (org.jpos.iso.packager.EuroSubFieldPackager)1 GenericPackager (org.jpos.iso.packager.GenericPackager)1 GenericSubFieldPackager (org.jpos.iso.packager.GenericSubFieldPackager)1 PostPackager (org.jpos.iso.packager.PostPackager)1