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