Search in sources :

Example 16 with GZIPChannel

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

the class BaseChannelTest method testSetLogger.

@Test
public void testSetLogger() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel();
    Logger logger = new Logger();
    gZIPChannel.setLogger(logger, "testBaseChannelRealm");
    assertSame("(GZIPChannel) gZIPChannel.logger", logger, ((GZIPChannel) gZIPChannel).logger);
    assertEquals("(GZIPChannel) gZIPChannel.originalRealm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).originalRealm);
    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 17 with GZIPChannel

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

the class MD5FilterTest method testFilterThrowsNullPointerException3.

@Test
public void testFilterThrowsNullPointerException3() throws Throwable {
    MD5Filter mD5Filter = new MD5Filter();
    mD5Filter.setConfiguration(new SimpleConfiguration());
    int[] fields = new int[1];
    fields[0] = -100;
    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