use of org.jpos.iso.channel.RawChannel in project jPOS by jpos.
the class BaseChannelTest method testGetOriginalRealm.
@Test
public void testGetOriginalRealm() throws Throwable {
BaseChannel rawChannel = new RawChannel(new ISO87APackagerBBitmap(), "".getBytes());
rawChannel.setLogger(null, "testBaseChannelRealm");
String result = rawChannel.getOriginalRealm();
assertEquals("testBaseChannelRealm", result, "result");
}
use of org.jpos.iso.channel.RawChannel in project jPOS by jpos.
the class BaseChannelTest method testGetDynamicHeader.
@Test
public void testGetDynamicHeader() throws Throwable {
BaseChannel rawChannel = new RawChannel();
byte[] image = new byte[2];
BaseHeader result = (BaseHeader) rawChannel.getDynamicHeader(image);
assertEquals(2, result.getLength(), "result.getLength()");
}
use of org.jpos.iso.channel.RawChannel 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) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"java.io.DataInputStream.read(byte[])\" because \"this.serverIn\" is null", ex.getMessage(), "ex.getMessage()");
}
assertNull(((RawChannel) rawChannel).serverIn, "(RawChannel) rawChannel.serverIn");
}
}
use of org.jpos.iso.channel.RawChannel in project jPOS by jpos.
the class BaseChannelTest method testGetSocket.
@Test
public void testGetSocket() throws Throwable {
Socket result = new RawChannel().getSocket();
assertNull(result, "result");
}
Aggregations