use of org.jpos.iso.packager.CTCSubFieldPackager in project jPOS by jpos.
the class BaseChannelTest method testApplyOutgoingFilters1.
@Test
public void testApplyOutgoingFilters1() throws Throwable {
BaseChannel x25Channel = new X25Channel();
ISOMsg result = x25Channel.applyOutgoingFilters(null, new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag"));
assertNull("result", result);
}
use of org.jpos.iso.packager.CTCSubFieldPackager in project jPOS by jpos.
the class GZIPChannelTest method testSendMessageThrowsNullPointerException.
@Test
public void testSendMessageThrowsNullPointerException() throws Throwable {
GZIPChannel gZIPChannel = new GZIPChannel("testGZIPChannelHost", 100, new CTCSubFieldPackager());
byte[] b = new byte[3];
try {
gZIPChannel.sendMessage(b, 100, 1000);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.iso.packager.CTCSubFieldPackager in project jPOS by jpos.
the class NACChannelTest method testConstructor2.
@Test
public void testConstructor2() throws Throwable {
ISOPackager p = new CTCSubFieldPackager();
byte[] TPDU = new byte[0];
ServerSocket serverSocket = new ServerSocket();
NACChannel nACChannel = new NACChannel(p, TPDU, serverSocket);
assertEquals("nACChannel.getIncomingFilters().size()", 0, nACChannel.getIncomingFilters().size());
assertEquals("nACChannel.getMaxPacketLength()", 100000, nACChannel.getMaxPacketLength());
assertSame("nACChannel.getPackager()", p, nACChannel.getPackager());
assertEquals("nACChannel.getPort()", 0, nACChannel.getPort());
assertEquals("nACChannel.getName()", "", nACChannel.getName());
assertEquals("nACChannel.getCounters().length", 3, nACChannel.getCounters().length);
assertNull("nACChannel.getLogger()", nACChannel.getLogger());
assertNull("nACChannel.getSocketFactory()", nACChannel.getSocketFactory());
assertSame("nACChannel.getHeader()", TPDU, nACChannel.getHeader());
assertEquals("nACChannel.getOutgoingFilters().size()", 0, nACChannel.getOutgoingFilters().size());
assertSame("nACChannel.getServerSocket()", serverSocket, nACChannel.getServerSocket());
assertEquals("nACChannel.getOriginalRealm()", "org.jpos.iso.channel.NACChannel", nACChannel.getOriginalRealm());
assertNull("nACChannel.getRealm()", nACChannel.getRealm());
assertNull("nACChannel.getHost()", nACChannel.getHost());
}
use of org.jpos.iso.packager.CTCSubFieldPackager in project jPOS by jpos.
the class NCCChannelTest method testConstructor3.
@Test
public void testConstructor3() throws Throwable {
byte[] TPDU = new byte[1];
ISOPackager p = new CTCSubFieldPackager();
NCCChannel nCCChannel = new NCCChannel("testNCCChannelHost", 100, p, TPDU);
assertEquals("nCCChannel.getIncomingFilters().size()", 0, nCCChannel.getIncomingFilters().size());
assertEquals("nCCChannel.getMaxPacketLength()", 100000, nCCChannel.getMaxPacketLength());
assertSame("nCCChannel.getPackager()", p, nCCChannel.getPackager());
assertEquals("nCCChannel.getPort()", 100, nCCChannel.getPort());
assertEquals("nCCChannel.getName()", "", nCCChannel.getName());
assertEquals("nCCChannel.getCounters().length", 3, nCCChannel.getCounters().length);
assertNull("nCCChannel.getLogger()", nCCChannel.getLogger());
assertNull("nCCChannel.getSocketFactory()", nCCChannel.getSocketFactory());
assertSame("nCCChannel.getHeader()", TPDU, nCCChannel.getHeader());
assertEquals("nCCChannel.getOutgoingFilters().size()", 0, nCCChannel.getOutgoingFilters().size());
assertNull("nCCChannel.getServerSocket()", nCCChannel.getServerSocket());
assertEquals("nCCChannel.getOriginalRealm()", "org.jpos.iso.channel.NCCChannel", nCCChannel.getOriginalRealm());
assertNull("nCCChannel.getRealm()", nCCChannel.getRealm());
assertEquals("nCCChannel.getHost()", "testNCCChannelHost", nCCChannel.getHost());
}
use of org.jpos.iso.packager.CTCSubFieldPackager in project jPOS by jpos.
the class MD5FilterTest method testFilterThrowsNullPointerException1.
@Test
public void testFilterThrowsNullPointerException1() throws Throwable {
int[] fields = new int[1];
MD5Filter mD5Filter = new MD5Filter();
mD5Filter.setConfiguration(new SimpleConfiguration());
mD5Filter.setFields(fields);
LogEvent evt = new LogEvent("testMD5FilterTag", Integer.valueOf(-12));
try {
mD5Filter.filter(new PostChannel(new CTCSubFieldPackager()), null, evt);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations