use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.
the class BaseChannelTest method testSendMessageHeaderThrowsNullPointerException1.
@Test
public void testSendMessageHeaderThrowsNullPointerException1() throws Throwable {
BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
try {
bASE24Channel.sendMessageHeader(null, 100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertNull("(BASE24Channel) bASE24Channel.serverOut", ((BASE24Channel) bASE24Channel).serverOut);
}
}
use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.
the class ASCIIChannelTest method testConstructor1.
@Test
public void testConstructor1() throws Throwable {
ISOPackager p = new ISO87APackagerBBitmap();
ASCIIChannel aSCIIChannel = new ASCIIChannel(p);
assertEquals("aSCIIChannel.getIncomingFilters().size()", 0, aSCIIChannel.getIncomingFilters().size());
assertEquals("aSCIIChannel.getMaxPacketLength()", 100000, aSCIIChannel.getMaxPacketLength());
assertSame("aSCIIChannel.getPackager()", p, aSCIIChannel.getPackager());
assertEquals("aSCIIChannel.getPort()", 0, aSCIIChannel.getPort());
assertEquals("aSCIIChannel.getName()", "", aSCIIChannel.getName());
assertEquals("aSCIIChannel.getCounters().length", 3, aSCIIChannel.getCounters().length);
assertNull("aSCIIChannel.getLogger()", aSCIIChannel.getLogger());
assertNull("aSCIIChannel.getSocketFactory()", aSCIIChannel.getSocketFactory());
assertNull("aSCIIChannel.getHeader()", aSCIIChannel.getHeader());
assertEquals("aSCIIChannel.getOutgoingFilters().size()", 0, aSCIIChannel.getOutgoingFilters().size());
assertNull("aSCIIChannel.getServerSocket()", aSCIIChannel.getServerSocket());
assertEquals("aSCIIChannel.getOriginalRealm()", "org.jpos.iso.channel.ASCIIChannel", aSCIIChannel.getOriginalRealm());
assertNull("aSCIIChannel.getRealm()", aSCIIChannel.getRealm());
assertNull("aSCIIChannel.getHost()", aSCIIChannel.getHost());
}
use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.
the class ASCIIChannelTest method testConstructor3.
@Test
public void testConstructor3() throws Throwable {
ISOPackager p = new ISO87APackagerBBitmap();
ASCIIChannel aSCIIChannel = new ASCIIChannel("testASCIIChannelHost", 100, p);
assertEquals("aSCIIChannel.getIncomingFilters().size()", 0, aSCIIChannel.getIncomingFilters().size());
assertEquals("aSCIIChannel.getMaxPacketLength()", 100000, aSCIIChannel.getMaxPacketLength());
assertSame("aSCIIChannel.getPackager()", p, aSCIIChannel.getPackager());
assertEquals("aSCIIChannel.getPort()", 100, aSCIIChannel.getPort());
assertEquals("aSCIIChannel.getName()", "", aSCIIChannel.getName());
assertEquals("aSCIIChannel.getCounters().length", 3, aSCIIChannel.getCounters().length);
assertNull("aSCIIChannel.getLogger()", aSCIIChannel.getLogger());
assertNull("aSCIIChannel.getSocketFactory()", aSCIIChannel.getSocketFactory());
assertNull("aSCIIChannel.getHeader()", aSCIIChannel.getHeader());
assertEquals("aSCIIChannel.getOutgoingFilters().size()", 0, aSCIIChannel.getOutgoingFilters().size());
assertNull("aSCIIChannel.getServerSocket()", aSCIIChannel.getServerSocket());
assertEquals("aSCIIChannel.getOriginalRealm()", "org.jpos.iso.channel.ASCIIChannel", aSCIIChannel.getOriginalRealm());
assertNull("aSCIIChannel.getRealm()", aSCIIChannel.getRealm());
assertEquals("aSCIIChannel.getHost()", "testASCIIChannelHost", aSCIIChannel.getHost());
}
use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.
the class LogChannelTest method testConnectThrowsSocketException.
@Test
public void testConnectThrowsSocketException() throws Throwable {
LogChannel logChannel = new LogChannel(new ISO87APackagerBBitmap());
Socket socket = new Socket();
socket.close();
try {
logChannel.connect(socket);
fail("Expected SocketException to be thrown");
} catch (SocketException ex) {
assertEquals("ex.getClass()", SocketException.class, ex.getClass());
assertEquals("logChannel.getOriginalRealm()", "org.jpos.iso.channel.LogChannel", logChannel.getOriginalRealm());
assertEquals("logChannel.getCounters().length", 3, logChannel.getCounters().length);
assertNull("logChannel.getRealm()", logChannel.getRealm());
assertSame("logChannel.getSocket()", socket, logChannel.getSocket());
assertFalse("logChannel.isConnected()", logChannel.isConnected());
assertNull("logChannel.getLogger()", logChannel.getLogger());
assertNull("logChannel.reader", logChannel.reader);
assertNull("socket.getChannel()", socket.getChannel());
}
}
use of org.jpos.iso.packager.ISO87APackagerBBitmap in project jPOS by jpos.
the class X25ChannelTest method testConnectThrowsNullPointerException.
@Test
public void testConnectThrowsNullPointerException() throws Throwable {
X25Channel x25Channel = new X25Channel("testX25ChannelHost", 100, new ISO87APackagerBBitmap());
x25Channel.setTimeout(1);
Socket socket = new Socket(Proxy.NO_PROXY);
try {
x25Channel.connect(socket);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertNull("x25Channel.reader", x25Channel.reader);
assertEquals("x25Channel.getOriginalRealm()", "org.jpos.iso.channel.X25Channel", x25Channel.getOriginalRealm());
assertEquals("x25Channel.getCounters().length", 3, x25Channel.getCounters().length);
assertNull("x25Channel.getRealm()", x25Channel.getRealm());
assertSame("x25Channel.getSocket()", socket, x25Channel.getSocket());
assertFalse("x25Channel.isConnected()", x25Channel.isConnected());
assertNull("x25Channel.getLogger()", x25Channel.getLogger());
assertNull("socket.getChannel()", socket.getChannel());
}
}
Aggregations