Search in sources :

Example 1 with BASE24Channel

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

the class BaseChannelTest method testGetHeader.

@Test
public void testGetHeader() throws Throwable {
    byte[] header = new byte[0];
    BaseChannel bASE24Channel = new BASE24Channel(new ISO87APackager(), new ServerSocket());
    bASE24Channel.setHeader(header);
    byte[] result = bASE24Channel.getHeader();
    assertSame("result", header, result);
}
Also used : BASE24Channel(org.jpos.iso.channel.BASE24Channel) ISO87APackager(org.jpos.iso.packager.ISO87APackager) Test(org.junit.Test)

Example 2 with BASE24Channel

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

the class BaseChannelTest method testRemoveIncomingFilter.

@Test
public void testRemoveIncomingFilter() throws Throwable {
    BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
    bASE24Channel.removeIncomingFilter(new XSLTFilter());
    assertEquals("(BASE24Channel) bASE24Channel.incomingFilters.size()", 0, ((BASE24Channel) bASE24Channel).incomingFilters.size());
}
Also used : BASE24Channel(org.jpos.iso.channel.BASE24Channel) XSLTFilter(org.jpos.iso.filter.XSLTFilter) ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) Test(org.junit.Test)

Example 3 with BASE24Channel

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

the class BaseChannelTest method testGetDynamicHeader1.

@Test
public void testGetDynamicHeader1() throws Throwable {
    BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
    ISOHeader result = bASE24Channel.getDynamicHeader(null);
    assertNull("result", result);
}
Also used : BASE24Channel(org.jpos.iso.channel.BASE24Channel) ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) Test(org.junit.Test)

Example 4 with BASE24Channel

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

the class BaseChannelTest method testApplyOutgoingFiltersThrowsVetoException.

@Test
public void testApplyOutgoingFiltersThrowsVetoException() throws Throwable {
    BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
    bASE24Channel.addFilter(new MD5Filter(), 0);
    try {
        bASE24Channel.applyOutgoingFilters(new ISOMsg(), new LogEvent());
        fail("Expected VetoException to be thrown");
    } catch (ISOFilter.VetoException ex) {
        assertEquals("ex.getMessage()", "MD5Filter not configured", ex.getMessage());
        assertNull("ex.nested", ex.nested);
    }
}
Also used : BASE24Channel(org.jpos.iso.channel.BASE24Channel) LogEvent(org.jpos.util.LogEvent) MD5Filter(org.jpos.iso.filter.MD5Filter) ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) Test(org.junit.Test)

Example 5 with BASE24Channel

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

the class BaseChannelTest method testAddFilter4.

@Test
public void testAddFilter4() throws Throwable {
    BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
    bASE24Channel.addFilter(new MD5Filter(), 0);
    assertEquals("(BASE24Channel) bASE24Channel.incomingFilters.size()", 1, ((BASE24Channel) bASE24Channel).incomingFilters.size());
    assertEquals("(BASE24Channel) bASE24Channel.outgoingFilters.size()", 1, ((BASE24Channel) bASE24Channel).outgoingFilters.size());
}
Also used : BASE24Channel(org.jpos.iso.channel.BASE24Channel) MD5Filter(org.jpos.iso.filter.MD5Filter) ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) Test(org.junit.Test)

Aggregations

BASE24Channel (org.jpos.iso.channel.BASE24Channel)6 Test (org.junit.Test)6 ISO87APackagerBBitmap (org.jpos.iso.packager.ISO87APackagerBBitmap)5 MD5Filter (org.jpos.iso.filter.MD5Filter)2 XSLTFilter (org.jpos.iso.filter.XSLTFilter)1 ISO87APackager (org.jpos.iso.packager.ISO87APackager)1 LogEvent (org.jpos.util.LogEvent)1