Search in sources :

Example 1 with GZIPChannel

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

the class BaseChannelTest method testSetLogger1.

@Test
public void testSetLogger1() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel();
    Logger logger = new Logger();
    gZIPChannel.setLogger(logger, "testBaseChannelRealm");
    gZIPChannel.setLogger(logger, "testBaseChannelRealm");
    assertSame("(GZIPChannel) gZIPChannel.logger", logger, ((GZIPChannel) gZIPChannel).logger);
    assertEquals("(GZIPChannel) gZIPChannel.realm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).realm);
}
Also used : GZIPChannel(org.jpos.iso.channel.GZIPChannel) Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 2 with GZIPChannel

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

the class BaseChannelTest method testRemoveFilter1.

@Test
public void testRemoveFilter1() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel();
    gZIPChannel.removeFilter(new BSHFilter(), 1);
    assertEquals("(GZIPChannel) gZIPChannel.incomingFilters.size()", 0, ((GZIPChannel) gZIPChannel).incomingFilters.size());
}
Also used : BSHFilter(org.jpos.bsh.BSHFilter) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 3 with GZIPChannel

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

the class BaseChannelTest method testApplyIncomingFilters1.

@Test
public void testApplyIncomingFilters1() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel("testBaseChannelHost", 100, new ISOBaseValidatingPackager());
    LogEvent evt = new LogEvent();
    byte[] header = new byte[0];
    byte[] image = new byte[2];
    ISOMsg result = gZIPChannel.applyIncomingFilters(m, header, image, evt);
    assertSame("result", m, result);
}
Also used : LogEvent(org.jpos.util.LogEvent) ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 4 with GZIPChannel

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

the class BaseChannelTest method testSetConfiguration1.

@Test
public void testSetConfiguration1() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel();
    gZIPChannel.setConfiguration(new SimpleConfiguration());
    assertEquals("(GZIPChannel) gZIPChannel.getTimeout()", 300000, gZIPChannel.getTimeout());
    assertEquals("(GZIPChannel) gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength());
    assertFalse("(GZIPChannel) gZIPChannel.overrideHeader", ((GZIPChannel) gZIPChannel).overrideHeader);
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 5 with GZIPChannel

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

the class MD5FilterTest method testFilterThrowsNullPointerException.

@Test
public void testFilterThrowsNullPointerException() throws Throwable {
    MD5Filter mD5Filter = new MD5Filter();
    mD5Filter.setConfiguration(new SimpleConfiguration());
    int[] fields = new int[1];
    mD5Filter.setFields(fields);
    ISOMsg m = new ISOMsg("testMD5FilterMti");
    try {
        mD5Filter.filter(new GZIPChannel(new XMLPackager()), m, null);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("m.getDirection()", 0, m.getDirection());
    }
}
Also used : XMLPackager(org.jpos.iso.packager.XMLPackager) ISOMsg(org.jpos.iso.ISOMsg) SimpleConfiguration(org.jpos.core.SimpleConfiguration) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Aggregations

GZIPChannel (org.jpos.iso.channel.GZIPChannel)17 Test (org.junit.Test)17 SimpleConfiguration (org.jpos.core.SimpleConfiguration)4 ISOMsg (org.jpos.iso.ISOMsg)4 LogEvent (org.jpos.util.LogEvent)3 ISOBaseValidatingPackager (org.jpos.iso.packager.ISOBaseValidatingPackager)2 XMLPackager (org.jpos.iso.packager.XMLPackager)2 Logger (org.jpos.util.Logger)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 BSHFilter (org.jpos.bsh.BSHFilter)1 ISOChannel (org.jpos.iso.ISOChannel)1 DelayFilter (org.jpos.iso.filter.DelayFilter)1 StatefulFilter (org.jpos.iso.filter.StatefulFilter)1 GenericValidatingPackager (org.jpos.iso.packager.GenericValidatingPackager)1 ISO93BPackager (org.jpos.iso.packager.ISO93BPackager)1 X92GenericPackager (org.jpos.iso.packager.X92GenericPackager)1