

Classes | |
| class | ClientLogManagerStandalone |
Public Member Functions | |
| void | testSimpleRemoteLogging () throws Exception |
| void | testConcurrentRemoteInitAndStop () throws InterruptedException |
Protected Member Functions | |
| void | setUp () throws Exception |
Private Member Functions | |
| boolean | initRemoteLogging (ClientLogManagerStandalone clm) |
Tests remote logging, using mock objects, and therefore does not need a running ACS which would not even exist in the strict module build order.
| boolean alma::acs::logging::RemoteLoggingTest::initRemoteLogging | ( | ClientLogManagerStandalone | clm | ) | [inline, private] |
Calls ClientLogManagerStandalone::initRemoteLogging(ORB, Manager, int, boolean)} with appropriate dummy parameters.
| clm | The instance to call initRemoteLogging on. |
References alma::acs::logging::ClientLogManager::initRemoteLogging().
Referenced by testConcurrentRemoteInitAndStop(), and testSimpleRemoteLogging().
| void alma::acs::logging::RemoteLoggingTest::setUp | ( | ) | throws Exception [inline, protected] |
| void alma::acs::logging::RemoteLoggingTest::testConcurrentRemoteInitAndStop | ( | ) | throws InterruptedException [inline] |
Tests the situation in which the ClientLogManager is shut down before it has finished the asynchronous initRemoteLogging call. This can happen in a ComponentClient-based application that performs a short task.
It is important to make the stdout printing part of this test, e.g. by using TAT without output suppression tricks, because among other things we expect the string Will abort ClientLogManager::initRemoteLogging because remote logging seems no longer needed. when initRemoteLogging is interrupted by a shutdown.
The main test thread that logs some messages and the thread that calls initRemoteLogging compete for the internal lock ClientLogManager#logQueueLock, whose functioning is being tested here.
Unfortunately this cannot be totally deterministic, so we must accept occasional failures of the kind that the output contains "Remote log: <Info .../>" instead of "Will abort ..." strings, or vice versa.
References alma::acs::logging::ClientLogManager::getLogConfig(), alma::acs::logging::ClientLogManager::getLoggerForApplication(), initRemoteLogging(), alma::acs::concurrent::DaemonThreadFactory::newThread(), alma::acs::logging::config::LogConfig::setDefaultMinLogLevel(), alma::acs::logging::config::LogConfig::setDefaultMinLogLevelLocal(), alma::acs::logging::RemoteLoggingTest::ClientLogManagerStandalone::setDelayMillis(), and alma::acs::logging::ClientLogManager::shutdown().
| void alma::acs::logging::RemoteLoggingTest::testSimpleRemoteLogging | ( | ) | throws Exception [inline] |
Tests the simple case where logging occurs after the call to ClientLogManager#initRemoteLogging(ORB, Manager, int, boolean).
References alma::acs::logging::ClientLogManager::getLoggerForApplication(), initRemoteLogging(), and alma::acs::logging::ClientLogManager::shutdown().
1.6.2