Search in sources :

Example 6 with ISO87APackagerBBitmap

use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.

the class LogEventTest method testAddMessage.

@Test
public void testAddMessage() throws Throwable {
    LogEvent logEvent = new LogEvent(new ISO87APackagerBBitmap(), "testLogEventTag", Integer.valueOf(-2));
    logEvent.addMessage("false");
    assertEquals("logEvent.payLoad.size()", 2, logEvent.getPayLoad().size());
    assertEquals("logEvent.payLoad.get(1)", "false", logEvent.getPayLoad().get(1));
}
Also used : ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) Test(org.junit.Test)

Example 7 with ISO87APackagerBBitmap

use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.

the class BaseChannelTest method testGetHeaderLength.

@Test
public void testGetHeaderLength() throws Throwable {
    BaseChannel hEXChannel = new HEXChannel(new ISO87APackagerBBitmap(), "".getBytes(), new ServerSocket());
    byte[] b = new byte[3];
    int result = hEXChannel.getHeaderLength(b);
    assertEquals("result", 0, result);
}
Also used : HEXChannel(org.jpos.iso.channel.HEXChannel) ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) Test(org.junit.Test)

Example 8 with ISO87APackagerBBitmap

use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.

the class BaseChannelTest method testGetBytesThrowsNullPointerException.

@Test
public void testGetBytesThrowsNullPointerException() throws Throwable {
    BaseChannel rawChannel = new RawChannel(new ISO87APackagerBBitmap(), "".getBytes());
    byte[] b = new byte[1];
    try {
        rawChannel.getBytes(b);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertNull("(RawChannel) rawChannel.serverIn", ((RawChannel) rawChannel).serverIn);
    }
}
Also used : ISO87APackagerBBitmap(org.jpos.iso.packager.ISO87APackagerBBitmap) RawChannel(org.jpos.iso.channel.RawChannel) Test(org.junit.Test)

Example 9 with ISO87APackagerBBitmap

use of org.jpos.iso.packager.ISO87APackagerBBitmap 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 10 with ISO87APackagerBBitmap

use of org.jpos.iso.packager.ISO87APackagerBBitmap 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

ISO87APackagerBBitmap (org.jpos.iso.packager.ISO87APackagerBBitmap)15 Test (org.junit.Test)15 BASE24Channel (org.jpos.iso.channel.BASE24Channel)5 ISOPackager (org.jpos.iso.ISOPackager)3 ServerSocket (java.net.ServerSocket)2 Socket (java.net.Socket)2 RawChannel (org.jpos.iso.channel.RawChannel)2 MD5Filter (org.jpos.iso.filter.MD5Filter)2 SocketException (java.net.SocketException)1 HEXChannel (org.jpos.iso.channel.HEXChannel)1 XSLTFilter (org.jpos.iso.filter.XSLTFilter)1 LogEvent (org.jpos.util.LogEvent)1