Search in sources :

Example 1 with DelayFilter

use of org.jpos.iso.filter.DelayFilter in project jPOS by jpos.

the class BaseChannelTest method testRemoveFilter4.

@Test
public void testRemoveFilter4() throws Throwable {
    BaseChannel nACChannel = new NACChannel();
    nACChannel.removeFilter(new DelayFilter());
    assertEquals("(NACChannel) nACChannel.incomingFilters.size()", 0, ((NACChannel) nACChannel).incomingFilters.size());
    assertEquals("(NACChannel) nACChannel.outgoingFilters.size()", 0, ((NACChannel) nACChannel).outgoingFilters.size());
}
Also used : NACChannel(org.jpos.iso.channel.NACChannel) DelayFilter(org.jpos.iso.filter.DelayFilter) Test(org.junit.Test)

Example 2 with DelayFilter

use of org.jpos.iso.filter.DelayFilter 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 3 with DelayFilter

use of org.jpos.iso.filter.DelayFilter in project jPOS by jpos.

the class BaseChannelTest method testRemoveFilter2.

@Test
public void testRemoveFilter2() throws Throwable {
    BaseChannel bASE24TCPChannel = new BASE24TCPChannel();
    bASE24TCPChannel.removeFilter(new DelayFilter(), 0);
    assertEquals("(BASE24TCPChannel) bASE24TCPChannel.incomingFilters.size()", 0, ((BASE24TCPChannel) bASE24TCPChannel).incomingFilters.size());
    assertEquals("(BASE24TCPChannel) bASE24TCPChannel.outgoingFilters.size()", 0, ((BASE24TCPChannel) bASE24TCPChannel).outgoingFilters.size());
}
Also used : BASE24TCPChannel(org.jpos.iso.channel.BASE24TCPChannel) DelayFilter(org.jpos.iso.filter.DelayFilter) Test(org.junit.Test)

Example 4 with DelayFilter

use of org.jpos.iso.filter.DelayFilter in project jPOS by jpos.

the class NACChannelTest method testSetHeaderThrowsNullPointerException.

@Test
public void testSetHeaderThrowsNullPointerException() throws Throwable {
    byte[] TPDU = new byte[0];
    byte[] TPDU2 = new byte[1];
    NACChannel nACChannel = new NACChannel(new ISO93APackager(), TPDU2, new ServerSocket());
    new NACChannel(new ISO93BPackager(), TPDU).addFilter(new DelayFilter(), 100);
    try {
        nACChannel.setHeader((String) null);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertSame("nACChannel.getHeader()", TPDU2, nACChannel.getHeader());
    }
}
Also used : DelayFilter(org.jpos.iso.filter.DelayFilter) ISO93BPackager(org.jpos.iso.packager.ISO93BPackager) ISO93APackager(org.jpos.iso.packager.ISO93APackager) ServerSocket(java.net.ServerSocket) Test(org.junit.Test)

Aggregations

DelayFilter (org.jpos.iso.filter.DelayFilter)4 Test (org.junit.Test)4 ServerSocket (java.net.ServerSocket)1 BASE24TCPChannel (org.jpos.iso.channel.BASE24TCPChannel)1 GZIPChannel (org.jpos.iso.channel.GZIPChannel)1 NACChannel (org.jpos.iso.channel.NACChannel)1 ISO93APackager (org.jpos.iso.packager.ISO93APackager)1 ISO93BPackager (org.jpos.iso.packager.ISO93BPackager)1