use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class BaseChannelTest method testResetCounters.
@Test
public void testResetCounters() throws Throwable {
BaseChannel x25Channel = new X25Channel(new GenericValidatingPackager());
x25Channel.resetCounters();
assertEquals("(X25Channel) x25Channel.cnt.length", 3, ((X25Channel) x25Channel).cnt.length);
}
use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class GZIPChannelTest method testConstructor2.
@Test
public void testConstructor2() throws Throwable {
ISOPackager p = new GenericValidatingPackager();
GZIPChannel gZIPChannel = new GZIPChannel("testGZIPChannelHost", 100, p);
assertEquals("gZIPChannel.getIncomingFilters().size()", 0, gZIPChannel.getIncomingFilters().size());
assertEquals("gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength());
assertSame("gZIPChannel.getPackager()", p, gZIPChannel.getPackager());
assertEquals("gZIPChannel.getPort()", 100, gZIPChannel.getPort());
assertEquals("gZIPChannel.getName()", "", gZIPChannel.getName());
assertEquals("gZIPChannel.getCounters().length", 3, gZIPChannel.getCounters().length);
assertNull("gZIPChannel.getLogger()", gZIPChannel.getLogger());
assertNull("gZIPChannel.getSocketFactory()", gZIPChannel.getSocketFactory());
assertNull("gZIPChannel.getHeader()", gZIPChannel.getHeader());
assertEquals("gZIPChannel.getOutgoingFilters().size()", 0, gZIPChannel.getOutgoingFilters().size());
assertNull("gZIPChannel.getServerSocket()", gZIPChannel.getServerSocket());
assertEquals("gZIPChannel.getOriginalRealm()", "org.jpos.iso.channel.GZIPChannel", gZIPChannel.getOriginalRealm());
assertNull("gZIPChannel.getRealm()", gZIPChannel.getRealm());
assertEquals("gZIPChannel.getHost()", "testGZIPChannelHost", gZIPChannel.getHost());
}
use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class MD5FilterTest method testFilterThrowsNullPointerException2.
@Test
public void testFilterThrowsNullPointerException2() throws Throwable {
MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration());
ISOMsg m = new ISOMsg("testMD5FilterMti");
try {
mD5Filter.filter(new ASCIIChannel(new GenericValidatingPackager()), m, null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertEquals("m.getDirection()", 0, m.getDirection());
}
}
use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class BaseChannelTest method testGetHeaderLength1.
@Test
public void testGetHeaderLength1() throws Throwable {
BaseChannel logChannel = new LogChannel("testBaseChannelHost", 100, new GenericValidatingPackager());
ISOMsg iSOVMsg = new ISOMsg();
iSOVMsg.setHeader(new BaseHeader());
int result = logChannel.getHeaderLength((ISOMsg) iSOVMsg.clone());
assertEquals("result", 0, result);
}
use of org.jpos.iso.packager.GenericValidatingPackager in project jPOS by jpos.
the class BaseChannelTest method testGetHeaderLengthThrowsNullPointerException.
@Test
public void testGetHeaderLengthThrowsNullPointerException() throws Throwable {
BaseChannel logChannel = new LogChannel("testBaseChannelHost", 100, new GenericValidatingPackager());
try {
logChannel.getHeaderLength((ISOMsg) null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations