use of org.jpos.iso.packager.ISO93BPackager in project jPOS by jpos.
the class BaseChannelTest method testCreateISOMsgThrowsNullPointerException.
@Test
public void testCreateISOMsgThrowsNullPointerException() throws Throwable {
BaseChannel cSChannel = new CSChannel(new ISO93BPackager());
cSChannel.setPackager(null);
try {
cSChannel.createMsg();
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertNull("(CSChannel) cSChannel.packager", ((CSChannel) cSChannel).packager);
}
}
use of org.jpos.iso.packager.ISO93BPackager in project jPOS by jpos.
the class NCCChannelTest method testSetHeader.
@Test
public void testSetHeader() throws Throwable {
byte[] TPDU = new byte[1];
NCCChannel nCCChannel = new NCCChannel("testNCCChannelHost", 100, new ISO93BPackager(), TPDU);
nCCChannel.setHeader("testNCCChannelHeader");
assertEquals("nCCChannel.getHeader().length", 10, nCCChannel.getHeader().length);
}
use of org.jpos.iso.packager.ISO93BPackager in project jPOS by jpos.
the class PADChannelTest method testConstructor2.
@Test
public void testConstructor2() throws Throwable {
ISOPackager p = new ISO93BPackager();
PADChannel pADChannel = new PADChannel(p);
assertEquals("pADChannel.getIncomingFilters().size()", 0, pADChannel.getIncomingFilters().size());
assertEquals("pADChannel.getMaxPacketLength()", 100000, pADChannel.getMaxPacketLength());
assertSame("pADChannel.getPackager()", p, pADChannel.getPackager());
assertEquals("pADChannel.getPort()", 0, pADChannel.getPort());
assertEquals("pADChannel.getName()", "", pADChannel.getName());
assertEquals("pADChannel.getCounters().length", 3, pADChannel.getCounters().length);
assertNull("pADChannel.getLogger()", pADChannel.getLogger());
assertNull("pADChannel.getSocketFactory()", pADChannel.getSocketFactory());
assertNull("pADChannel.getHeader()", pADChannel.getHeader());
assertEquals("pADChannel.getOutgoingFilters().size()", 0, pADChannel.getOutgoingFilters().size());
assertNull("pADChannel.getServerSocket()", pADChannel.getServerSocket());
assertEquals("pADChannel.getOriginalRealm()", "org.jpos.iso.channel.PADChannel", pADChannel.getOriginalRealm());
assertNull("pADChannel.getRealm()", pADChannel.getRealm());
assertNull("pADChannel.getHost()", pADChannel.getHost());
assertNull("pADChannel.reader", pADChannel.reader);
}
use of org.jpos.iso.packager.ISO93BPackager in project jPOS by jpos.
the class BaseChannelTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Throwable {
BaseChannel gZIPChannel = new GZIPChannel(new ISO93BPackager(), null);
gZIPChannel.setSocketFactory(new SunJSSESocketFactory());
gZIPChannel.setConfiguration(new SimpleConfiguration());
assertEquals("(GZIPChannel) gZIPChannel.getTimeout()", 300000, gZIPChannel.getTimeout());
assertEquals("(GZIPChannel) gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength());
assertFalse("(GZIPChannel) gZIPChannel.overrideHeader", ((GZIPChannel) gZIPChannel).overrideHeader);
}
use of org.jpos.iso.packager.ISO93BPackager in project jPOS by jpos.
the class NACChannelTest method testSetHeaderThrowsNullPointerException.
@Test
public void testSetHeaderThrowsNullPointerException() throws Throwable {
byte[] TPDU = new byte[0];
byte[] TPDU2 = new byte[1];
NACChannel nACChannel = new NACChannel(new ISO93APackager(), TPDU2, new ServerSocket());
new NACChannel(new ISO93BPackager(), TPDU).addFilter(new DelayFilter(), 100);
try {
nACChannel.setHeader((String) null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertSame("nACChannel.getHeader()", TPDU2, nACChannel.getHeader());
}
}
Aggregations