Search in sources :

Example 26 with Logger

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

the class XMLPackagerTest method onSetup.

@Before
public void onSetup() throws ISOException, NoSuchFieldException {
    // PrintStream p = new PrintStream(new ByteArrayOutputStream())
    xMLPackager = new XMLPackager();
    atts = new Attributes2Impl();
    logger = new Logger();
    logger.addListener(new SimpleLogListener());
    isoMsg = xMLPackager.createISOMsg();
    xMLPackager.setLogger(logger, xMLPackager.getClass().getName());
    isoMsg.setPackager(xMLPackager);
}
Also used : SimpleLogListener(org.jpos.util.SimpleLogListener) Attributes2Impl(org.xml.sax.ext.Attributes2Impl) Logger(org.jpos.util.Logger) Before(org.junit.Before)

Example 27 with Logger

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

the class VErrorParserTest method testSetLogger.

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

Example 28 with Logger

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

the class BaseChannelTest method testSetLogger.

@Test
public void testSetLogger() throws Throwable {
    BaseChannel gZIPChannel = new GZIPChannel();
    Logger logger = new Logger();
    gZIPChannel.setLogger(logger, "testBaseChannelRealm");
    assertSame("(GZIPChannel) gZIPChannel.logger", logger, ((GZIPChannel) gZIPChannel).logger);
    assertEquals("(GZIPChannel) gZIPChannel.originalRealm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).originalRealm);
    assertEquals("(GZIPChannel) gZIPChannel.realm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).realm);
}
Also used : GZIPChannel(org.jpos.iso.channel.GZIPChannel) Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 29 with Logger

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

the class ConnectorTest method testGetLogger.

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

Example 30 with Logger

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

the class ConnectorTest method testSetLogger.

@Test
public void testSetLogger() throws Throwable {
    Connector connector = new Connector();
    Logger logger = new Logger();
    connector.setLogger(logger, "testConnectorRealm");
    assertSame("connector.getLogger()", logger, connector.getLogger());
    assertEquals("connector.getRealm()", "testConnectorRealm", connector.getRealm());
}
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