use of org.jpos.iso.packager.ISO87APackager in project jPOS by jpos.
the class BaseChannelTest method testGetHeader.
@Test
public void testGetHeader() throws Throwable {
byte[] header = new byte[0];
BaseChannel bASE24Channel = new BASE24Channel(new ISO87APackager(), new ServerSocket());
bASE24Channel.setHeader(header);
byte[] result = bASE24Channel.getHeader();
assertSame("result", header, result);
}
use of org.jpos.iso.packager.ISO87APackager in project jPOS by jpos.
the class BaseChannelTest method testIsConnected.
@Test
public void testIsConnected() throws Throwable {
boolean result = new XMLChannel(new ISO87APackager()).isConnected();
assertFalse("result", result);
}
use of org.jpos.iso.packager.ISO87APackager in project jPOS by jpos.
the class BASE24TCPChannelTest method testConstructor.
@Test
public void testConstructor() throws Throwable {
ISOPackager p = new ISO87APackager();
BASE24TCPChannel bASE24TCPChannel = new BASE24TCPChannel(p);
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());
assertNull("bASE24TCPChannel.getServerSocket()", 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 NCCChannelTest method testSendMessageLengthThrowsNullPointerException.
@Test
public void testSendMessageLengthThrowsNullPointerException() throws Throwable {
byte[] TPDU = new byte[0];
NCCChannel nCCChannel = new NCCChannel(new ISO87APackager(), TPDU);
try {
nCCChannel.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 ISOMsg2Test method testSetSource.
@Test
public void testSetSource() throws Throwable {
ISOMsg iSOMsg = new ISOMsg();
ISOSource source = new LogChannel("testISOMsgHost", 100, new ISO87APackager());
iSOMsg.setSource(source);
assertSame("iSOMsg.getSource()", source, iSOMsg.getSource());
}
Aggregations