Search in sources :

Example 11 with GZIPChannel

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

the class BaseChannelTest method testAddFilter2.

@Test
public void testAddFilter2() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel();
    gZIPChannel.addFilter(new StatefulFilter(), 1);
    assertEquals("(GZIPChannel) gZIPChannel.incomingFilters.size()", 1, ((GZIPChannel) gZIPChannel).incomingFilters.size());
}
Also used : StatefulFilter(org.jpos.iso.filter.StatefulFilter) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 12 with GZIPChannel

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

the class BaseChannelTest method testGetOutgoingFilters.

@Test
public void testGetOutgoingFilters() throws Throwable {
    Collection result = (Collection) new GZIPChannel().getOutgoingFilters();
    assertEquals("result.size()", 0, result.size());
}
Also used : Collection(java.util.Collection) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 13 with GZIPChannel

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

the class BaseChannelTest method testSendKeepAliveThrowsNullPointerException1.

@Test
public void testSendKeepAliveThrowsNullPointerException1() throws Throwable {
    try {
        new GZIPChannel().sendKeepAlive();
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 14 with GZIPChannel

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

the class BaseChannelTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel(new ISO93BPackager(), null);
    gZIPChannel.setSocketFactory(new SunJSSESocketFactory());
    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 : ISO93BPackager(org.jpos.iso.packager.ISO93BPackager) SimpleConfiguration(org.jpos.core.SimpleConfiguration) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 15 with GZIPChannel

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

the class BaseChannelTest method testGetHeaderLength4.

@Test
public void testGetHeaderLength4() throws Throwable {
    byte[] header = new byte[1];
    BaseChannel gZIPChannel = new GZIPChannel("testBaseChannelHost", 100, new ISOBaseValidatingPackager());
    gZIPChannel.setHeader(header);
    int result = gZIPChannel.getHeaderLength();
    assertEquals("result", 1, result);
}
Also used : ISOBaseValidatingPackager(org.jpos.iso.packager.ISOBaseValidatingPackager) 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