Search in sources :

Example 6 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class ChannelPoolTest method testIsConnectedDoNotThrowNullPointerExceptionWithNullLogListener.

@Test
public void testIsConnectedDoNotThrowNullPointerExceptionWithNullLogListener() throws Throwable {
    Logger logger = new Logger();
    logger.addListener(null);
    ChannelPool channelPool = new ChannelPool();
    channelPool.setLogger(logger, "testChannelPoolRealm");
    assertEquals("connected.isFalse", false, channelPool.isConnected());
    assertNull("channelPool.current", channelPool.current);
    assertEquals("channelPool.pool.size()", 0, channelPool.pool.size());
    assertTrue("channelPool.usable", channelPool.usable);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 7 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class ChannelPoolTest method testGetRealm1.

@Test
public void testGetRealm1() throws Throwable {
    ChannelPool channelPool = new ChannelPool();
    channelPool.setLogger(new Logger(), "testChannelPoolRealm");
    String result = channelPool.getRealm();
    assertEquals("result", "testChannelPoolRealm", result);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 8 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class ChannelPoolTest method testGetLogger.

@Test
public void testGetLogger() throws Throwable {
    ChannelPool channelPool = new ChannelPool();
    Logger logger = new Logger();
    channelPool.setLogger(logger, "testChannelPoolRealm");
    Logger result = channelPool.getLogger();
    assertSame("result", logger, result);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 9 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class LoopbackChannelTest method testGetRealm.

@Test
public void testGetRealm() throws Throwable {
    LoopbackChannel loopbackChannel = new LoopbackChannel();
    loopbackChannel.setLogger(new Logger(), "testLoopbackChannelRealm");
    String result = loopbackChannel.getRealm();
    assertEquals("result", "testLoopbackChannelRealm", result);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 10 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class LoopbackChannelTest method testSetLogger.

@Test
public void testSetLogger() throws Throwable {
    LoopbackChannel loopbackChannel = new LoopbackChannel();
    Logger logger = new Logger();
    loopbackChannel.setLogger(logger, "testLoopbackChannelRealm");
    assertSame("loopbackChannel.logger", logger, loopbackChannel.logger);
    assertEquals("loopbackChannel.realm", "testLoopbackChannelRealm", loopbackChannel.realm);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Aggregations

Logger (org.jpos.util.Logger)45 Test (org.junit.Test)36 SimpleConfiguration (org.jpos.core.SimpleConfiguration)7 SubConfiguration (org.jpos.core.SubConfiguration)5 ISOMsg (org.jpos.iso.ISOMsg)5 SimpleLogListener (org.jpos.util.SimpleLogListener)5 Properties (java.util.Properties)4 Configuration (org.jpos.core.Configuration)4 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)4 ISOException (org.jpos.iso.ISOException)3 ConfigurationException (org.jpos.core.ConfigurationException)2 GZIPChannel (org.jpos.iso.channel.GZIPChannel)2 Log (org.jpos.util.Log)2 NameRegistrar (org.jpos.util.NameRegistrar)2 Before (org.junit.Before)2 PrintStream (java.io.PrintStream)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 IFA_LLLLCHAR (org.jpos.iso.IFA_LLLLCHAR)1 IFE_CHAR (org.jpos.iso.IFE_CHAR)1