

Public Member Functions | |
| void | log (LogRecord record) |
| LogRecord[] | getCollectedLogRecords () |
| void | clearLogRecords () |
| void | suppressLogs (boolean suppressLogs) |
| void | setDelegateLogger (Logger delegate) |
Static Public Member Functions | |
| static synchronized LogRecordCollectingLogger | getCollectingLogger (String name) |
| static synchronized< T extends LogRecordCollectingLogger > T | getCollectingLogger (String name, Class< T > loggerClass) |
Protected Member Functions | |
| LogRecordCollectingLogger (String name, String resourceBundleName) | |
Private Attributes | |
| List< LogRecord > | logRecordList = Collections.synchronizedList(new ArrayList<LogRecord>()) |
| boolean | suppressLogs = false |
| Logger | delegate |
Creates a Logger that collects all LogRecords produced by calls to the various log methods. This can be used to verify log messages in a pure JUnit environment, without the need to use TAT reference files.
| alma::acs::testsupport::LogRecordCollectingLogger::LogRecordCollectingLogger | ( | String | name, | |
| String | resourceBundleName | |||
| ) | [inline, protected] |
| void alma::acs::testsupport::LogRecordCollectingLogger::clearLogRecords | ( | ) | [inline] |
References logRecordList.
Referenced by alma::acs::logging::RemoteLogDispatcherTest::setUp(), alma::acs::container::CleaningThreadFactoryTest::tearDown(), alma::acs::logging::formatters::AcsLogFormatterTest::testLoggedParameters(), alma::acs::logging::AcsLoggingHandlerTest::testOffLevel(), alma::acs::logging::RemoteLogDispatcherTest::testPeriodicFlush(), alma::acs::logging::RemoteLogDispatcherTest::testSendLogRecords(), alma::acs::container::CleaningThreadFactoryTest::testStoppingThreads(), and alma::acs::container::CleaningThreadFactoryTest::testUserThreadException().
| LogRecord [] alma::acs::testsupport::LogRecordCollectingLogger::getCollectedLogRecords | ( | ) | [inline] |
References logRecordList.
Referenced by alma::acs::logging::RemoteLogDispatcherTest::testFailingRecords(), alma::acs::logging::RemoteLogDispatcherTest::testFlushByRecordNumber(), alma::acs::exceptions::AcsJExceptionTest::testLogAcsJException(), alma::acs::logging::formatters::AcsLogFormatterTest::testLoggedParameters(), alma::acs::logging::AcsLoggingHandlerTest::testOffLevel(), alma::acs::logging::RemoteLogDispatcherTest::testPeriodicFlush(), alma::acs::logging::RemoteLogDispatcherTest::testQueueOverflow(), alma::acs::logging::RepeatGuardLoggerTest::testRepeatGuardLogger(), alma::acs::logging::RemoteLogDispatcherTest::testSendLogRecords(), alma::acs::concurrent::ThreadLoopRunnerTest::testSimple(), alma::acs::container::CleaningThreadFactoryTest::testStoppingThreads(), alma::acs::logging::RemoteLogDispatcherTest::testUnavailableRemoteLogService(), and alma::acs::container::CleaningThreadFactoryTest::testUserThreadException().
| static synchronized<T extends LogRecordCollectingLogger> T alma::acs::testsupport::LogRecordCollectingLogger::getCollectingLogger | ( | String | name, | |
| Class< T > | loggerClass | |||
| ) | [inline, static] |
| static synchronized LogRecordCollectingLogger alma::acs::testsupport::LogRecordCollectingLogger::getCollectingLogger | ( | String | name | ) | [inline, static] |
Referenced by alma::acs::logging::RemoteLogDispatcherTest::setUp(), alma::acs::container::CleaningThreadFactoryTest::setUp(), and alma::acs::logging::formatters::AcsLogFormatterTest::setUp().
| void alma::acs::testsupport::LogRecordCollectingLogger::log | ( | LogRecord | record | ) | [inline] |
Here we intercept all logging activities of the base class.
References delegate, logRecordList, and suppressLogs.
Referenced by alma::acs::logging::CollectingLogger::produceLogs1(), alma::acs::exceptions::AcsJExceptionTest::testLogAcsJException(), alma::acs::logging::formatters::AcsLogFormatterTest::testLoggedParameters(), and alma::acs::logging::AcsLoggingHandlerTest::testOffLevel().
| void alma::acs::testsupport::LogRecordCollectingLogger::setDelegateLogger | ( | Logger | delegate | ) | [inline] |
| delegate | a logger to receive log output from this logger, or null to not log any output, but only store the log records. |
References suppressLogs.
Referenced by alma::acs::container::CleaningThreadFactoryTest::setUp(), and alma::acs::concurrent::ThreadLoopRunnerTest::testSimple().
| void alma::acs::testsupport::LogRecordCollectingLogger::suppressLogs | ( | boolean | suppressLogs | ) | [inline] |
Switches real logging off/on. Logging will only happen if a real logger has been provided.
| suppressLogs | true if collected LogRecords should not be sent to a real logger |
Referenced by alma::acs::logging::RemoteLogDispatcherTest::setUp().
Logger alma::acs::testsupport::LogRecordCollectingLogger::delegate [private] |
Referenced by log().
List<LogRecord> alma::acs::testsupport::LogRecordCollectingLogger::logRecordList = Collections.synchronizedList(new ArrayList<LogRecord>()) [private] |
Referenced by clearLogRecords(), getCollectedLogRecords(), and log().
boolean alma::acs::testsupport::LogRecordCollectingLogger::suppressLogs = false [private] |
Referenced by log(), and setDelegateLogger().
1.6.2