Search in sources :

Example 11 with CTCSubFieldPackager

use of org.jpos.iso.packager.CTCSubFieldPackager in project jPOS by jpos.

the class StatefulFilterTest method testFilterThrowsNullPointerException6.

@Test
public void testFilterThrowsNullPointerException6() throws Throwable {
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setKeyPrefix(null);
    try {
        statefulFilter.filter(new PostChannel(new CTCSubFieldPackager()), new ISOMsg("testStatefulFilterMti"), new LogEvent());
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) PostChannel(org.jpos.iso.channel.PostChannel) CTCSubFieldPackager(org.jpos.iso.packager.CTCSubFieldPackager) Test(org.junit.Test)

Example 12 with CTCSubFieldPackager

use of org.jpos.iso.packager.CTCSubFieldPackager in project jPOS by jpos.

the class StatefulFilterTest method testFilter3.

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

Example 13 with CTCSubFieldPackager

use of org.jpos.iso.packager.CTCSubFieldPackager 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

CTCSubFieldPackager (org.jpos.iso.packager.CTCSubFieldPackager)13 Test (org.junit.Test)13 LogEvent (org.jpos.util.LogEvent)9 ISOMsg (org.jpos.iso.ISOMsg)4 PostChannel (org.jpos.iso.channel.PostChannel)4 ISOPackager (org.jpos.iso.ISOPackager)3 X25Channel (org.jpos.iso.channel.X25Channel)3 ServerSocket (java.net.ServerSocket)2 PADChannel (org.jpos.iso.channel.PADChannel)2 XMLPackager (org.jpos.iso.packager.XMLPackager)2 SimpleConfiguration (org.jpos.core.SimpleConfiguration)1 ISOChannel (org.jpos.iso.ISOChannel)1 ISOFilter (org.jpos.iso.ISOFilter)1 MD5Filter (org.jpos.iso.filter.MD5Filter)1