

Public Member Functions | |
| void | testSetMode () throws Exception |
| void | testOperatorModeFiltering () throws Exception |
| void | testNoAudienceModeFiltering () throws Exception |
| void | xmlEntryReceived (String xmlLogString) |
| void | logEntryReceived (ILogEntry logEntry) |
Static Public Attributes | |
| static final String | logHeaderStr = " TimeStamp=\"" |
| static final String | logBodyStr = "\" Routine=\"CacheTest::testGet\" Host=\"this\" Process=\"test\" Thread=\"main\" Context=\"\" Audience=\"" |
| static final String | logEndOfBodyStr = "\"><![CDATA[" |
| static final String | logFooterStr = "]]></" |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Private Member Functions | |
| boolean | waitForLogs () |
Private Attributes | |
| final int | TIMEOUT = 60 |
| ACSLogRetrieval | logRetieval = null |
| ACSListenersDispatcher | dispatcher = null |
| int | numOfReceivedLogs |
| int | numOfReceivedXMLLogs |
| Audience | audience |
A class testing the filtering by mode performed by ACSLogretrieval. The mode is defined in log_audience ILD module.
The test is done by checking what logs ACSLogRetrieval discards i.e. the LCEngine is not used here as it is stressed by other tests. This class is the listener for the log and the XMLs that ACSLogRetrieval sends to the listeners throw the ACSListenersDispatcher.
| void alma::acs::jlog::test::EngineAudienceTest::logEntryReceived | ( | ILogEntry | logEntry | ) | [inline] |
The counter numOfReceivedLogs is incremented for each received log. The method write a message in the stdout if the received log does not match with the audience
Implements com::cosylab::logging::engine::ACS::ACSRemoteLogListener.
References audience, com::cosylab::logging::engine::log::ILogEntry::getField(), com::cosylab::logging::engine::log::ILogEntry::getType(), numOfReceivedLogs, and com::cosylab::logging::engine::log::ILogEntry::toString().
| void alma::acs::jlog::test::EngineAudienceTest::setUp | ( | ) | throws Exception [inline, protected] |
| void alma::acs::jlog::test::EngineAudienceTest::tearDown | ( | ) | throws Exception [inline, protected] |
| void alma::acs::jlog::test::EngineAudienceTest::testNoAudienceModeFiltering | ( | ) | throws Exception [inline] |
Test the case of ENGINEER i.e. no filtering
| Exception |
References com::cosylab::logging::engine::ACS::ACSLogRetrieval::addLog(), audience, logRetieval, numOfReceivedLogs, numOfReceivedXMLLogs, com::cosylab::logging::engine::LogMatcher::setAudience(), and waitForLogs().
| void alma::acs::jlog::test::EngineAudienceTest::testOperatorModeFiltering | ( | ) | throws Exception [inline] |
Test the filtering for OPERATOR.
The logs that should not be filtered are those that:
The test is done in 2 times: 1. a collection of logs with no audience is tested 2. a collection of logs with different values for audience is tested
| Exception |
References com::cosylab::logging::engine::ACS::ACSLogRetrieval::addLog(), audience, logBodyStr, logEndOfBodyStr, logFooterStr, logHeaderStr, logRetieval, numOfReceivedLogs, numOfReceivedXMLLogs, alma::acs::logging::engine::parser::ACSLogParser::parse(), com::cosylab::logging::engine::LogMatcher::setAudience(), and waitForLogs().
| void alma::acs::jlog::test::EngineAudienceTest::testSetMode | ( | ) | throws Exception [inline] |
Test the setting of the mode
References com::cosylab::logging::engine::LogMatcher::getAudience(), logRetieval, and com::cosylab::logging::engine::LogMatcher::setAudience().
| boolean alma::acs::jlog::test::EngineAudienceTest::waitForLogs | ( | ) | [inline, private] |
Wait until the logRetrieval publishes all the logs
References com::cosylab::logging::engine::ACS::ACSLogRetrieval::hasPendingEntries(), logRetieval, com::cosylab::logging::engine::ACS::ACSLogRetrieval::size(), and TIMEOUT.
Referenced by testNoAudienceModeFiltering(), and testOperatorModeFiltering().
| void alma::acs::jlog::test::EngineAudienceTest::xmlEntryReceived | ( | String | xmlLogString | ) | [inline] |
The counter numOfReceivedXMLLogs is incremented for each received log
Implements com::cosylab::logging::engine::ACS::ACSRemoteRawLogListener.
References numOfReceivedXMLLogs.
Referenced by logEntryReceived(), testNoAudienceModeFiltering(), and testOperatorModeFiltering().
/ The dispatcher used by ACSLogRetrieval to send logs to the registered listeners.
Referenced by setUp(), and tearDown().
final String alma::acs::jlog::test::EngineAudienceTest::logBodyStr = "\" Routine=\"CacheTest::testGet\" Host=\"this\" Process=\"test\" Thread=\"main\" Context=\"\" Audience=\"" [static] |
Referenced by testOperatorModeFiltering().
final String alma::acs::jlog::test::EngineAudienceTest::logEndOfBodyStr = "\"><![CDATA[" [static] |
Referenced by testOperatorModeFiltering().
final String alma::acs::jlog::test::EngineAudienceTest::logFooterStr = "]]></" [static] |
Referenced by testOperatorModeFiltering().
final String alma::acs::jlog::test::EngineAudienceTest::logHeaderStr = " TimeStamp=\"" [static] |
Referenced by testOperatorModeFiltering().
ACSLogRetrieval alma::acs::jlog::test::EngineAudienceTest::logRetieval = null [private] |
The object whose filtering capabilities we want to test
Referenced by setUp(), tearDown(), testNoAudienceModeFiltering(), testOperatorModeFiltering(), testSetMode(), and waitForLogs().
Referenced by logEntryReceived(), setUp(), testNoAudienceModeFiltering(), and testOperatorModeFiltering().
Referenced by setUp(), testNoAudienceModeFiltering(), testOperatorModeFiltering(), and xmlEntryReceived().
final int alma::acs::jlog::test::EngineAudienceTest::TIMEOUT = 60 [private] |
The timeout (secs) to wait before giving up waiting for logs
Referenced by waitForLogs().
1.6.2