aQute.bnd.testing
Class TestingLog

java.lang.Object
  extended by aQute.bnd.testing.TestingLog
All Implemented Interfaces:
org.osgi.service.log.LogService

public class TestingLog
extends Object
implements org.osgi.service.log.LogService

Provides a log service object to be used in testing. It can filter levels and messages and can trace stack traces and directly output the diagnostic info. At the end it can be checked if there were any messages logged that fell within the set criteria.


Field Summary
 
Fields inherited from interface org.osgi.service.log.LogService
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
 
Constructor Summary
TestingLog()
           
 
Method Summary
 boolean check(String... patterns)
           
 TestingLog debugs()
           
 TestingLog direct()
           
 TestingLog errors()
           
 TestingLog filter(String pattern)
           
 TestingLog full()
           
 List<org.osgi.service.log.LogEntry> getEntries()
           
 TestingLog infos()
           
 TestingLog level(int level)
           
 void log(int level, String message)
           
 void log(int level, String message, Throwable exception)
           
 void log(org.osgi.framework.ServiceReference sr, int level, String message)
           
 void log(org.osgi.framework.ServiceReference sr, int level, String message, Throwable exception)
           
 TestingLog stacktrace()
           
 TestingLog warnings()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestingLog

public TestingLog()
Method Detail

log

public void log(int level,
                String message)
Specified by:
log in interface org.osgi.service.log.LogService

log

public void log(int level,
                String message,
                Throwable exception)
Specified by:
log in interface org.osgi.service.log.LogService

log

public void log(org.osgi.framework.ServiceReference sr,
                int level,
                String message)
Specified by:
log in interface org.osgi.service.log.LogService

log

public void log(org.osgi.framework.ServiceReference sr,
                int level,
                String message,
                Throwable exception)
Specified by:
log in interface org.osgi.service.log.LogService

getEntries

public List<org.osgi.service.log.LogEntry> getEntries()

filter

public TestingLog filter(String pattern)

stacktrace

public TestingLog stacktrace()

direct

public TestingLog direct()

errors

public TestingLog errors()

warnings

public TestingLog warnings()

infos

public TestingLog infos()

debugs

public TestingLog debugs()

level

public TestingLog level(int level)

full

public TestingLog full()

check

public boolean check(String... patterns)


Copyright © 2014 aQute SARL. All rights reserved.