use of org.jpos.iso.packager.ISO87APackager in project jPOS by jpos.
the class BASE24TCPChannelTest method testConstructor1.
@Test
public void testConstructor1() throws Throwable {
ISOPackager p = new ISO87APackager();
ServerSocket serverSocket = new ServerSocket();
BASE24TCPChannel bASE24TCPChannel = new BASE24TCPChannel(p, serverSocket);
assertEquals("bASE24TCPChannel.getIncomingFilters().size()", 0, bASE24TCPChannel.getIncomingFilters().size());
assertEquals("bASE24TCPChannel.getMaxPacketLength()", 100000, bASE24TCPChannel.getMaxPacketLength());
assertSame("bASE24TCPChannel.getPackager()", p, bASE24TCPChannel.getPackager());
assertEquals("bASE24TCPChannel.getPort()", 0, bASE24TCPChannel.getPort());
assertEquals("bASE24TCPChannel.getName()", "", bASE24TCPChannel.getName());
assertEquals("bASE24TCPChannel.getCounters().length", 3, bASE24TCPChannel.getCounters().length);
assertNull("bASE24TCPChannel.getLogger()", bASE24TCPChannel.getLogger());
assertNull("bASE24TCPChannel.getSocketFactory()", bASE24TCPChannel.getSocketFactory());
assertNull("bASE24TCPChannel.getHeader()", bASE24TCPChannel.getHeader());
assertEquals("bASE24TCPChannel.getOutgoingFilters().size()", 0, bASE24TCPChannel.getOutgoingFilters().size());
assertSame("bASE24TCPChannel.getServerSocket()", serverSocket, bASE24TCPChannel.getServerSocket());
assertEquals("bASE24TCPChannel.getOriginalRealm()", "org.jpos.iso.channel.BASE24TCPChannel", bASE24TCPChannel.getOriginalRealm());
assertNull("bASE24TCPChannel.getRealm()", bASE24TCPChannel.getRealm());
assertNull("bASE24TCPChannel.getHost()", bASE24TCPChannel.getHost());
}
use of org.jpos.iso.packager.ISO87APackager in project jPOS by jpos.
the class BASE24TCPChannelTest method testSendMessageLengthThrowsNullPointerException.
@Test
public void testSendMessageLengthThrowsNullPointerException() throws Throwable {
BASE24TCPChannel bASE24TCPChannel = new BASE24TCPChannel(new ISO87APackager());
try {
bASE24TCPChannel.sendMessageLength(100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.packager.ISO87APackager in project jPOS by jpos.
the class NCCChannelTest method testSendMessageHeaderThrowsNullPointerException2.
@Test
public void testSendMessageHeaderThrowsNullPointerException2() throws Throwable {
byte[] TPDU = new byte[16];
NCCChannel nCCChannel = new NCCChannel(new ISO87APackager(), TPDU);
try {
nCCChannel.sendMessageHeader(null, 100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations