Search in sources :

Example 1 with LogChannel

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);
}
Also used : ISOMsg(org.jpos.iso.ISOMsg) LogChannel(org.jpos.iso.channel.LogChannel) Test(org.junit.Test)

Example 2 with LogChannel

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());
}
Also used : LogChannel(org.jpos.iso.channel.LogChannel) ISO87APackager(org.jpos.iso.packager.ISO87APackager) Test(org.junit.Test)

Example 3 with LogChannel

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);
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) LogEvent(org.jpos.util.LogEvent) SimpleConfiguration(org.jpos.core.SimpleConfiguration) LogChannel(org.jpos.iso.channel.LogChannel) Properties(java.util.Properties) Test(org.junit.Test)

Example 4 with LogChannel

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);
}
Also used : GenericValidatingPackager(org.jpos.iso.packager.GenericValidatingPackager) LogChannel(org.jpos.iso.channel.LogChannel) BaseHeader(org.jpos.iso.header.BaseHeader) Test(org.junit.Test)

Example 5 with LogChannel

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());
    }
}
Also used : GenericValidatingPackager(org.jpos.iso.packager.GenericValidatingPackager) LogChannel(org.jpos.iso.channel.LogChannel) Test(org.junit.Test)

Aggregations

LogChannel (org.jpos.iso.channel.LogChannel)6 Test (org.junit.Test)6 SimpleConfiguration (org.jpos.core.SimpleConfiguration)2 ISOMsg (org.jpos.iso.ISOMsg)2 GenericValidatingPackager (org.jpos.iso.packager.GenericValidatingPackager)2 LogEvent (org.jpos.util.LogEvent)2 Properties (java.util.Properties)1 Configuration (org.jpos.core.Configuration)1 BaseHeader (org.jpos.iso.header.BaseHeader)1 ISO87APackager (org.jpos.iso.packager.ISO87APackager)1