use of org.jpos.iso.packager.Base1Packager in project jPOS by jpos.
the class VAPChannelTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Throwable {
VAPChannel vAPChannel = new VAPChannel(new Base1Packager());
vAPChannel.setSocketFactory(new SunJSSESocketFactory());
vAPChannel.setConfiguration(new SimpleConfiguration());
assertEquals("vAPChannel.srcid", "000000", vAPChannel.srcid);
assertEquals("vAPChannel.dstid", "000000", vAPChannel.dstid);
assertEquals("vAPChannel.getMaxPacketLength()", 100000, vAPChannel.getMaxPacketLength());
assertEquals("vAPChannel.getPort()", 0, vAPChannel.getPort());
assertNull("vAPChannel.getSocket()", vAPChannel.getSocket());
assertEquals("vAPChannel.getTimeout()", 300000, vAPChannel.getTimeout());
assertFalse("vAPChannel.isOverrideHeader()", vAPChannel.isOverrideHeader());
assertNull("vAPChannel.getHost()", vAPChannel.getHost());
}
use of org.jpos.iso.packager.Base1Packager in project jPOS by jpos.
the class ASCIIChannelTest method testGetMessageLengthThrowsNullPointerException.
@Test
public void testGetMessageLengthThrowsNullPointerException() throws Throwable {
ASCIIChannel aSCIIChannel = new ASCIIChannel(new Base1Packager());
try {
aSCIIChannel.getMessageLength();
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.packager.Base1Packager in project jPOS by jpos.
the class CSChannelTest method testConstructor.
@Test
public void testConstructor() throws Throwable {
ISOPackager p = new Base1Packager();
ServerSocket serverSocket = new ServerSocket();
CSChannel cSChannel = new CSChannel(p, serverSocket);
assertEquals("cSChannel.getIncomingFilters().size()", 0, cSChannel.getIncomingFilters().size());
assertEquals("cSChannel.getMaxPacketLength()", 100000, cSChannel.getMaxPacketLength());
assertSame("cSChannel.getPackager()", p, cSChannel.getPackager());
assertEquals("cSChannel.getPort()", 0, cSChannel.getPort());
assertEquals("cSChannel.getName()", "", cSChannel.getName());
assertEquals("cSChannel.getCounters().length", 3, cSChannel.getCounters().length);
assertNull("cSChannel.getLogger()", cSChannel.getLogger());
assertNull("cSChannel.getSocketFactory()", cSChannel.getSocketFactory());
assertNull("cSChannel.getHeader()", cSChannel.getHeader());
assertEquals("cSChannel.getOutgoingFilters().size()", 0, cSChannel.getOutgoingFilters().size());
assertSame("cSChannel.getServerSocket()", serverSocket, cSChannel.getServerSocket());
assertEquals("cSChannel.getOriginalRealm()", "org.jpos.iso.channel.CSChannel", cSChannel.getOriginalRealm());
assertNull("cSChannel.getRealm()", cSChannel.getRealm());
assertNull("cSChannel.getHost()", cSChannel.getHost());
}
use of org.jpos.iso.packager.Base1Packager in project jPOS by jpos.
the class GZIPChannelTest method testSendMessageLengthThrowsNullPointerException.
@Test
public void testSendMessageLengthThrowsNullPointerException() throws Throwable {
GZIPChannel gZIPChannel = new GZIPChannel("testGZIPChannelHost", 100, new Base1Packager());
try {
gZIPChannel.sendMessageLength(100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.packager.Base1Packager in project jPOS by jpos.
the class VAPChannelTest method testSendMessageHeaderThrowsNullPointerException1.
@Test
public void testSendMessageHeaderThrowsNullPointerException1() throws Throwable {
ISOMsg m = new ISOMsg(100);
VAPChannel vAPChannel = new VAPChannel(new Base1Packager());
vAPChannel.setConfiguration(new SimpleConfiguration());
try {
vAPChannel.sendMessageHeader(m, 100);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations