use of org.jpos.iso.packager.GenericPackager in project jPOS by jpos.
the class VAPChannelTest method testConstructor2.
@Test
public void testConstructor2() throws Throwable {
ISOPackager p = new GenericPackager();
VAPChannel vAPChannel = new VAPChannel(p);
assertEquals("vAPChannel.getIncomingFilters().size()", 0, vAPChannel.getIncomingFilters().size());
assertEquals("vAPChannel.getMaxPacketLength()", 100000, vAPChannel.getMaxPacketLength());
assertSame("vAPChannel.getPackager()", p, vAPChannel.getPackager());
assertEquals("vAPChannel.getPort()", 0, vAPChannel.getPort());
assertEquals("vAPChannel.getName()", "", vAPChannel.getName());
assertEquals("vAPChannel.getCounters().length", 3, vAPChannel.getCounters().length);
assertNull("vAPChannel.getLogger()", vAPChannel.getLogger());
assertNull("vAPChannel.getSocketFactory()", vAPChannel.getSocketFactory());
assertNull("vAPChannel.getHeader()", vAPChannel.getHeader());
assertEquals("vAPChannel.getOutgoingFilters().size()", 0, vAPChannel.getOutgoingFilters().size());
assertNull("vAPChannel.getServerSocket()", vAPChannel.getServerSocket());
assertEquals("vAPChannel.getOriginalRealm()", "org.jpos.iso.channel.VAPChannel", vAPChannel.getOriginalRealm());
assertNull("vAPChannel.getRealm()", vAPChannel.getRealm());
assertNull("vAPChannel.getHost()", vAPChannel.getHost());
}
use of org.jpos.iso.packager.GenericPackager in project jPOS by jpos.
the class VAPChannelTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
VAPChannel vAPChannel = new VAPChannel(new GenericPackager());
Configuration cfg = new SubConfiguration();
try {
vAPChannel.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
if (isJavaVersionAtMost(JAVA_14)) {
assertNull(ex.getMessage(), "ex.getMessage()");
} else {
assertEquals("Cannot invoke \"org.jpos.core.Configuration.get(String)\" because \"this.cfg\" is null", ex.getMessage(), "ex.getMessage()");
}
assertEquals(100000, vAPChannel.getMaxPacketLength(), "vAPChannel.getMaxPacketLength()");
assertEquals(0, vAPChannel.getPort(), "vAPChannel.getPort()");
assertNull(vAPChannel.getSocket(), "vAPChannel.getSocket()");
assertEquals(0, vAPChannel.getTimeout(), "vAPChannel.getTimeout()");
assertEquals("000000", vAPChannel.srcid, "vAPChannel.srcid");
assertFalse(vAPChannel.isOverrideHeader(), "vAPChannel.isOverrideHeader()");
assertNull(vAPChannel.getHost(), "vAPChannel.getHost()");
assertEquals("000000", vAPChannel.dstid, "vAPChannel.dstid");
}
}
use of org.jpos.iso.packager.GenericPackager in project jPOS by jpos.
the class VAPChannelTest method testShouldIgnore2.
@Test
public void testShouldIgnore2() throws Throwable {
VAPChannel vAPChannel = new VAPChannel(new GenericPackager());
boolean result = vAPChannel.shouldIgnore(null);
assertFalse(result, "result");
}
use of org.jpos.iso.packager.GenericPackager in project jPOS by jpos.
the class GZIPChannelTest method testConstructor3.
@Test
public void testConstructor3() throws Throwable {
ISOPackager p = new GenericPackager();
GZIPChannel gZIPChannel = new GZIPChannel(p);
assertEquals(0, gZIPChannel.getIncomingFilters().size(), "gZIPChannel.getIncomingFilters().size()");
assertEquals(100000, gZIPChannel.getMaxPacketLength(), "gZIPChannel.getMaxPacketLength()");
assertSame(p, gZIPChannel.getPackager(), "gZIPChannel.getPackager()");
assertEquals(0, gZIPChannel.getPort(), "gZIPChannel.getPort()");
assertEquals("", gZIPChannel.getName(), "gZIPChannel.getName()");
assertEquals(3, gZIPChannel.getCounters().length, "gZIPChannel.getCounters().length");
assertNull(gZIPChannel.getLogger(), "gZIPChannel.getLogger()");
assertNull(gZIPChannel.getSocketFactory(), "gZIPChannel.getSocketFactory()");
assertNull(gZIPChannel.getHeader(), "gZIPChannel.getHeader()");
assertEquals(0, gZIPChannel.getOutgoingFilters().size(), "gZIPChannel.getOutgoingFilters().size()");
assertNull(gZIPChannel.getServerSocket(), "gZIPChannel.getServerSocket()");
assertEquals("org.jpos.iso.channel.GZIPChannel", gZIPChannel.getOriginalRealm(), "gZIPChannel.getOriginalRealm()");
assertNull(gZIPChannel.getRealm(), "gZIPChannel.getRealm()");
assertNull(gZIPChannel.getHost(), "gZIPChannel.getHost()");
}
use of org.jpos.iso.packager.GenericPackager in project jPOS by jpos.
the class BaseChannelTest method testGetChannel.
@Test
public void testGetChannel() throws Throwable {
BaseChannel aSCIIChannel = new ASCIIChannel(new GenericPackager(), new ServerSocket());
aSCIIChannel.setName("channel.");
BaseChannel result = (BaseChannel) BaseChannel.getChannel("channel.");
assertSame(aSCIIChannel, result, "result");
}
Aggregations