use of org.jpos.iso.channel.LogChannel in project jPOS by jpos.
the class BSHRequestListenerTest method testProcess2.
@Test
public void testProcess2() throws Throwable {
BSHRequestListener bSHRequestListener = new BSHRequestListener();
ISOMsg m = new ISOMsg();
m.setMTI("testBSHRequestListenerMti");
boolean result = bSHRequestListener.process(new LogChannel(), m);
assertFalse("result", result);
assertNull("bSHRequestListener.whitelist", bSHRequestListener.whitelist);
}
use of org.jpos.iso.channel.LogChannel in project jPOS by jpos.
the class ISOMsg2Test method testSetSource.
@Test
public void testSetSource() throws Throwable {
ISOMsg iSOMsg = new ISOMsg();
ISOSource source = new LogChannel("testISOMsgHost", 100, new ISO87APackager());
iSOMsg.setSource(source);
assertSame("iSOMsg.getSource()", source, iSOMsg.getSource());
}
use of org.jpos.iso.channel.LogChannel in project jPOS by jpos.
the class BSHLogListenerTest method testLog.
@Test
public void testLog() throws Throwable {
BSHLogListener bSHLogListener = new BSHLogListener();
Configuration cfg = new SimpleConfiguration(new Properties());
bSHLogListener.setConfiguration(cfg);
LogEvent ev = new LogEvent("testBSHLogListenerTag");
ev.setSource(new LogChannel());
LogEvent result = bSHLogListener.log(ev);
assertSame("result", ev, result);
assertSame("bSHLogListener.cfg", cfg, bSHLogListener.cfg);
}
use of org.jpos.iso.channel.LogChannel 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.channel.LogChannel 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