Search in sources :

Example 6 with GZIPChannel

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

the class MacroFilterTest method testFilter.

@Test
public void testFilter() throws Throwable {
    MacroFilter macroFilter = new MacroFilter();
    ISOChannel channel = new GZIPChannel(new X92GenericPackager());
    LogEvent evt = new LogEvent("testMacroFilterTag", "\u0000\u0000");
    when(m.getMaxField()).thenReturn(0);
    ISOMsg result = macroFilter.filter(channel, m, evt);
    assertSame("result", m, result);
    verify(m).hasField(0);
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) LogEvent(org.jpos.util.LogEvent) ISOChannel(org.jpos.iso.ISOChannel) GZIPChannel(org.jpos.iso.channel.GZIPChannel) X92GenericPackager(org.jpos.iso.packager.X92GenericPackager) Test(org.junit.Test)

Example 7 with GZIPChannel

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

the class StatefulFilterTest method testFilterThrowsNullPointerException5.

@Test
public void testFilterThrowsNullPointerException5() throws Throwable {
    StatefulFilter statefulFilter = new StatefulFilter();
    statefulFilter.setSpace((Space) null);
    try {
        statefulFilter.filter(new GZIPChannel(), 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) LogEvent(org.jpos.util.LogEvent) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 8 with GZIPChannel

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

the class BaseChannelTest method testAddFilter3.

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

Example 9 with GZIPChannel

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

the class BaseChannelTest method testSetIncomingFilters.

@Test
public void testSetIncomingFilters() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel();
    gZIPChannel.setIncomingFilters(new ArrayList());
    assertEquals("(GZIPChannel) gZIPChannel.incomingFilters.size()", 0, ((GZIPChannel) gZIPChannel).incomingFilters.size());
}
Also used : ArrayList(java.util.ArrayList) GZIPChannel(org.jpos.iso.channel.GZIPChannel) Test(org.junit.Test)

Example 10 with GZIPChannel

use of org.jpos.iso.channel.GZIPChannel 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)

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