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));
}
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);
}
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);
}
}
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);
}
}
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());
}
Aggregations