Search in sources :

Example 16 with CSChannel

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

the class StatefulFilterTest method testFilterThrowsNullPointerException3.

@Test
public void testFilterThrowsNullPointerException3() throws Throwable {
    int[] key = new int[0];
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setKey(key);
    statefulFilter.setSpace((Space) null);
    try {
        statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100, new GenericPackager()), new ISOMsg("testStatefulFilterMti"), new LogEvent("testStatefulFilterTag", "testString"));
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : GenericPackager(org.jpos.iso.packager.GenericPackager) ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Example 17 with CSChannel

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

the class StatefulFilterTest method testFilterThrowsNullPointerException1.

@Test
public void testFilterThrowsNullPointerException1() throws Throwable {
    int[] key = new int[0];
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setKey(key);
    statefulFilter.setSpace((Space) null);
    statefulFilter.setMatchDirection(0);
    statefulFilter.setIgnoredFields(null);
    try {
        statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100, new PostPackager()), 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) PostPackager(org.jpos.iso.packager.PostPackager) LogEvent(org.jpos.util.LogEvent) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Example 18 with CSChannel

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

the class StatefulFilterTest method testFilterThrowsNullPointerException10.

@Test
public void testFilterThrowsNullPointerException10() throws Throwable {
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setSpace((Space) null);
    statefulFilter.setMatchDirection(0);
    statefulFilter.setSavedFields(null);
    statefulFilter.setIgnoredFields(null);
    try {
        statefulFilter.filter(new CSChannel("testStatefulFilterHost", 100, new PostPackager()), 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) PostPackager(org.jpos.iso.packager.PostPackager) LogEvent(org.jpos.util.LogEvent) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Aggregations

CSChannel (org.jpos.iso.channel.CSChannel)18 Test (org.junit.Test)18 LogEvent (org.jpos.util.LogEvent)12 ISOMsg (org.jpos.iso.ISOMsg)10 PostPackager (org.jpos.iso.packager.PostPackager)8 ISOBaseValidatingPackager (org.jpos.iso.packager.ISOBaseValidatingPackager)3 ISOChannel (org.jpos.iso.ISOChannel)2 ServerSocket (java.net.ServerSocket)1 Collection (java.util.Collection)1 Configuration (org.jpos.core.Configuration)1 SimpleConfiguration (org.jpos.core.SimpleConfiguration)1 ISOVMsg (org.jpos.iso.ISOVMsg)1 MacroFilter (org.jpos.iso.filter.MacroFilter)1 Base1SubFieldPackager (org.jpos.iso.packager.Base1SubFieldPackager)1 GenericPackager (org.jpos.iso.packager.GenericPackager)1 ISO93BPackager (org.jpos.iso.packager.ISO93BPackager)1