Search in sources :

Example 1 with Log

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

the class Q2Test method testGetLog.

@Test
public void testGetLog() throws Throwable {
    Log result = m_q2.getLog();
    assertEquals("result.getRealm()", "Q2.system", result.getRealm());
}
Also used : Log(org.jpos.util.Log) Test(org.junit.Test)

Example 2 with Log

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

the class DUKPTTest method initLogger.

private void initLogger() {
    Logger logger = new Logger();
    logger.addListener(new SimpleLogListener());
    log = new Log(logger, "SM Test");
}
Also used : SimpleLogListener(org.jpos.util.SimpleLogListener) Log(org.jpos.util.Log) Logger(org.jpos.util.Logger)

Example 3 with Log

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

the class Q2 method getLog.

public Log getLog() {
    if (log == null) {
        Logger logger = Logger.getLogger(LOGGER_NAME);
        if (!hasSystemLogger && !logger.hasListeners() && cli == null)
            logger.addListener(new SimpleLogListener(System.out));
        log = new Log(logger, REALM);
    }
    return log;
}
Also used : SimpleLogListener(org.jpos.util.SimpleLogListener) Log(org.jpos.util.Log) Logger(org.jpos.util.Logger)

Example 4 with Log

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

the class Q2Test method testGetLog2.

@Test
public void testGetLog2() throws Throwable {
    String[] args = new String[2];
    args[0] = "testString";
    args[1] = "testString";
    m_q2 = new Q2(args);
    Log log = m_q2.getLog();
    Log result = m_q2.getLog();
    assertSame("result", log, result);
}
Also used : Log(org.jpos.util.Log) Test(org.junit.Test)

Example 5 with Log

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

the class QThreadPoolExecutorTest method setUp.

@Before
public void setUp() {
    mockedLog = mock(Log.class);
    qbean = new QThreadPoolExecutor() {

        @Override
        public Log getLog() {
            return mockedLog;
        }

        @Override
        public String getName() {
            return QBEAN_DEFAULT_NAME;
        }
    };
    qbeanConfigBos = new ByteArrayOutputStream();
    qbeanConfigPw = new PrintWriter(new OutputStreamWriter(qbeanConfigBos));
    NameRegistrar.getAsMap().clear();
}
Also used : Log(org.jpos.util.Log) OutputStreamWriter(java.io.OutputStreamWriter) ByteArrayOutputStream(java.io.ByteArrayOutputStream) PrintWriter(java.io.PrintWriter) Before(org.junit.Before)

Aggregations

Log (org.jpos.util.Log)5 Logger (org.jpos.util.Logger)2 SimpleLogListener (org.jpos.util.SimpleLogListener)2 Test (org.junit.Test)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 PrintWriter (java.io.PrintWriter)1 Before (org.junit.Before)1