Search in sources :

Example 6 with GenericValidatingPackager

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

the class BaseChannelTest method testSendMessageHeader.

@Test
public void testSendMessageHeader() throws Throwable {
    ISOMsg m = new ISOMsg();
    BaseChannel gZIPChannel = new GZIPChannel(new GenericValidatingPackager());
    gZIPChannel.sendMessageHeader(m, 100);
    assertNull("(GZIPChannel) gZIPChannel.serverOut", ((GZIPChannel) gZIPChannel).serverOut);
    assertEquals("m.getDirection()", 0, m.getDirection());
}
Also used : GenericValidatingPackager(org.jpos.iso.packager.GenericValidatingPackager) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 7 with GenericValidatingPackager

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

the class CSChannelTest method testConstructor1.

@Test
public void testConstructor1() throws Throwable {
    ISOPackager p = new GenericValidatingPackager();
    CSChannel cSChannel = new CSChannel("testCSChannelHost", 100, p);
    assertEquals("cSChannel.getIncomingFilters().size()", 0, cSChannel.getIncomingFilters().size());
    assertEquals("cSChannel.getMaxPacketLength()", 100000, cSChannel.getMaxPacketLength());
    assertSame("cSChannel.getPackager()", p, cSChannel.getPackager());
    assertEquals("cSChannel.getPort()", 100, cSChannel.getPort());
    assertEquals("cSChannel.getName()", "", cSChannel.getName());
    assertEquals("cSChannel.getCounters().length", 3, cSChannel.getCounters().length);
    assertNull("cSChannel.getLogger()", cSChannel.getLogger());
    assertNull("cSChannel.getSocketFactory()", cSChannel.getSocketFactory());
    assertNull("cSChannel.getHeader()", cSChannel.getHeader());
    assertEquals("cSChannel.getOutgoingFilters().size()", 0, cSChannel.getOutgoingFilters().size());
    assertNull("cSChannel.getServerSocket()", cSChannel.getServerSocket());
    assertEquals("cSChannel.getOriginalRealm()", "org.jpos.iso.channel.CSChannel", cSChannel.getOriginalRealm());
    assertNull("cSChannel.getRealm()", cSChannel.getRealm());
    assertEquals("cSChannel.getHost()", "testCSChannelHost", cSChannel.getHost());
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) GenericValidatingPackager(org.jpos.iso.packager.GenericValidatingPackager) Test(org.junit.Test)

Example 8 with GenericValidatingPackager

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

the class StatefulFilterTest method testFilterThrowsNullPointerException2.

@Test
public void testFilterThrowsNullPointerException2() throws Throwable {
    int[] key = new int[1];
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setKey(key);
    try {
        statefulFilter.filter(new BASE24TCPChannel(new GenericValidatingPackager()), null, new LogEvent());
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : BASE24TCPChannel(org.jpos.iso.channel.BASE24TCPChannel) GenericValidatingPackager(org.jpos.iso.packager.GenericValidatingPackager) LogEvent(org.jpos.util.LogEvent) Test(org.junit.Test)

Aggregations

GenericValidatingPackager (org.jpos.iso.packager.GenericValidatingPackager)8 Test (org.junit.Test)8 ISOPackager (org.jpos.iso.ISOPackager)2 LogChannel (org.jpos.iso.channel.LogChannel)2 SimpleConfiguration (org.jpos.core.SimpleConfiguration)1 ISOMsg (org.jpos.iso.ISOMsg)1 ASCIIChannel (org.jpos.iso.channel.ASCIIChannel)1 BASE24TCPChannel (org.jpos.iso.channel.BASE24TCPChannel)1 GZIPChannel (org.jpos.iso.channel.GZIPChannel)1 X25Channel (org.jpos.iso.channel.X25Channel)1 BaseHeader (org.jpos.iso.header.BaseHeader)1 LogEvent (org.jpos.util.LogEvent)1