Search in sources :

Example 6 with CSChannel

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

the class BaseChannelTest method testSetHeaderThrowsNullPointerException.

@Test
public void testSetHeaderThrowsNullPointerException() throws Throwable {
    BaseChannel cSChannel = new CSChannel(new PostPackager());
    try {
        cSChannel.setHeader((String) null);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertNull("(CSChannel) cSChannel.header", ((CSChannel) cSChannel).header);
    }
}
Also used : PostPackager(org.jpos.iso.packager.PostPackager) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Example 7 with CSChannel

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

the class MacroFilterTest method testFilter6.

@Test
public void testFilter6() throws Throwable {
    ISOMsg m = new ISOMsg(100);
    m.set(100, "");
    ISOMsg result = new MacroFilter().filter(new CSChannel(new ISOBaseValidatingPackager()), m, new LogEvent("testMacroFilterTag", ""));
    assertEquals("result.getDirection()", 0, result.getDirection());
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Example 8 with CSChannel

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

the class StatefulFilterTest method testFilterThrowsNullPointerException8.

@Test
public void testFilterThrowsNullPointerException8() throws Throwable {
    int[] key = new int[0];
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setKey(key);
    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)

Example 9 with CSChannel

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

the class BSHFilterTest method testFilterThrowsNullPointerException.

@Test
public void testFilterThrowsNullPointerException() throws Throwable {
    BSHFilter bSHFilter = new BSHFilter();
    LogEvent evt = new LogEvent();
    try {
        bSHFilter.filter(new CSChannel("testBSHFilterHost", 100, new PostPackager()), new ISOMsg("testBSHFilterMti"), evt);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertNull("bSHFilter.cfg", bSHFilter.cfg);
    }
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) PostPackager(org.jpos.iso.packager.PostPackager) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Example 10 with CSChannel

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

the class BSHRequestListenerTest method testProcess1.

@Test
public void testProcess1() throws Throwable {
    BSHRequestListener bSHRequestListener = new BSHRequestListener();
    boolean result = bSHRequestListener.process(new CSChannel(), new ISOMsg());
    assertFalse("result", result);
    assertNull("bSHRequestListener.whitelist", bSHRequestListener.whitelist);
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) 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