alma::acs::logging::RemoteLoggingTest Class Reference

Inheritance diagram for alma::acs::logging::RemoteLoggingTest:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::RemoteLoggingTest:
Collaboration graph
[legend]

List of all members.

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)

Detailed Description

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.


Member Function Documentation

boolean alma::acs::logging::RemoteLoggingTest::initRemoteLogging ( ClientLogManagerStandalone  clm  )  [inline, private]

Calls ClientLogManagerStandalone::initRemoteLogging(ORB, Manager, int, boolean)} with appropriate dummy parameters.

Parameters:
clm The instance to call initRemoteLogging on.
Returns:
true if simulated remote logging was initialized successfully

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]

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2