

Public Member Functions | |
| EngineFilteringTest () throws Exception | |
| void | acsLogConnConnecting () |
| void | acsLogConnDisconnected () |
| void | acsLogConnEstablished () |
| void | acsLogConnLost () |
| void | acsLogConnSuspended () |
| void | acsLogsDelay () |
| void | reportStatus (String status) |
| void | logEntryReceived (ILogEntry logEntry) |
| void | xmlEntryReceived (String xmlLogString) |
| void | errorReceived (String xml) |
| void | testAddFilter () throws Exception |
| void | testAddFiltersVector () throws Exception |
| void | testFiltering () throws Exception |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Private Attributes | |
| LCEngine | engine |
| Vector< ILogEntry > | receivedLogs |
| int | xmlLogs = 0 |
| int | xmlInfos = 0 |
Static Private Attributes | |
| static final int | TIMEOUT = 120 |
| static final int | NUMBER_OF_LOGS = 100 |
A class testing the filtering of logs in the engine.
| alma::acs::jlog::test::EngineFilteringTest::EngineFilteringTest | ( | ) | throws Exception [inline] |
Constructor
| Exception |
| void alma::acs::jlog::test::EngineFilteringTest::acsLogConnConnecting | ( | ) | [inline] |
Notify that an attempt to connect to ACS NC is in progress
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::jlog::test::EngineFilteringTest::acsLogConnDisconnected | ( | ) | [inline] |
| void alma::acs::jlog::test::EngineFilteringTest::acsLogConnEstablished | ( | ) | [inline] |
| void alma::acs::jlog::test::EngineFilteringTest::acsLogConnLost | ( | ) | [inline] |
Connection lost: tat will show this situation
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::jlog::test::EngineFilteringTest::acsLogConnSuspended | ( | ) | [inline] |
tat will show this situation
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::jlog::test::EngineFilteringTest::acsLogsDelay | ( | ) | [inline] |
Notify that for some internal reason the service is not able to follow the flow of the incoming logs and is queueing the messages to be inserted later, when flow will decrease and enough CPU time is availbale
This method is not executed each time a log is queued but once when the situation begins. When the temporary problem has been fixed, the status will revert to connected
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::jlog::test::EngineFilteringTest::errorReceived | ( | String | xml | ) | [inline] |
Method executed in case of error: print a message in the stdout, tat will show this error
Implements com::cosylab::logging::engine::ACS::ACSRemoteErrorListener.
| void alma::acs::jlog::test::EngineFilteringTest::logEntryReceived | ( | ILogEntry | logEntry | ) | [inline] |
Executed whenever a new log is received. Filtering works here.
The received log is added to the vector
Implements com::cosylab::logging::engine::ACS::ACSRemoteLogListener.
References receivedLogs.
| void alma::acs::jlog::test::EngineFilteringTest::reportStatus | ( | String | status | ) | [inline] |
Send a report string with the current status of the connection
| status | The status string |
Implements com::cosylab::logging::engine::ACS::ACSLogConnectionListener.
| void alma::acs::jlog::test::EngineFilteringTest::setUp | ( | ) | throws Exception [inline, protected] |
Setup the environment by creating the engine with a null set of filters. The engine is disconnected because some of the tests do not need the connection alive.
Reimplemented from alma::acs::component::client::ComponentClientTestCase.
References com::cosylab::logging::engine::ACS::LCEngine::addLogConnectionListener(), com::cosylab::logging::engine::ACS::LCEngine::addLogErrorListener(), com::cosylab::logging::engine::ACS::LCEngine::addLogListener(), com::cosylab::logging::engine::ACS::LCEngine::addRawLogListener(), alma::acs::logging::AcsLogger::configureLogging(), engine, alma::acs::component::client::ComponentClientTestCase::m_logger, receivedLogs, xmlInfos, and xmlLogs.
| void alma::acs::jlog::test::EngineFilteringTest::tearDown | ( | ) | throws Exception [inline, protected] |
Reimplemented from alma::acs::component::client::ComponentClientTestCase.
References com::cosylab::logging::engine::ACS::LCEngine::disconnect(), and engine.
| void alma::acs::jlog::test::EngineFilteringTest::testAddFilter | ( | ) | throws Exception [inline] |
Test the adding and clearing filters
| Exception |
References com::cosylab::logging::engine::ACS::LCEngine::addFilter(), com::cosylab::logging::engine::ACS::LCEngine::clearFilters(), engine, com::cosylab::logging::engine::ACS::LCEngine::getFilters(), and com::cosylab::logging::engine::FiltersVector::hasActiveFilters().
| void alma::acs::jlog::test::EngineFilteringTest::testAddFiltersVector | ( | ) | throws Exception [inline] |
Test adding a FiltersVector
References com::cosylab::logging::engine::FiltersVector::addFilter(), engine, com::cosylab::logging::engine::ACS::LCEngine::getFilters(), and com::cosylab::logging::engine::ACS::LCEngine::setFilters().
| void alma::acs::jlog::test::EngineFilteringTest::testFiltering | ( | ) | throws Exception [inline] |
Set a filter and checks if the logs received are those passing a filters.
In this case we do not need to check the correctness of the logs received in the listeners but only if they are received or not because it means that the engine is using the filters.
For this example, the test defines 1 filter based on the type of the logs.
The correctness of the filtering is also tested in another test because the engine uses the same filters used by the table.
| Exception |
References com::cosylab::logging::engine::ACS::LCEngine::addFilter(), com::cosylab::logging::engine::ACS::LCEngine::connect(), engine, com::cosylab::logging::engine::ACS::LCEngine::getFilters(), com::cosylab::logging::engine::ACS::LCEngine::isConnected(), alma::acs::logging::AcsLogger::log(), alma::acs::component::client::ComponentClientTestCase::m_logger, NUMBER_OF_LOGS, receivedLogs, TIMEOUT, and xmlLogs.
| void alma::acs::jlog::test::EngineFilteringTest::xmlEntryReceived | ( | String | xmlLogString | ) | [inline] |
XML entries are not filtered!
Implements com::cosylab::logging::engine::ACS::ACSRemoteRawLogListener.
Referenced by setUp(), tearDown(), testAddFilter(), testAddFiltersVector(), and testFiltering().
final int alma::acs::jlog::test::EngineFilteringTest::NUMBER_OF_LOGS = 100 [static, private] |
Referenced by testFiltering().
Vector<ILogEntry> alma::acs::jlog::test::EngineFilteringTest::receivedLogs [private] |
Referenced by logEntryReceived(), setUp(), and testFiltering().
final int alma::acs::jlog::test::EngineFilteringTest::TIMEOUT = 120 [static, private] |
Referenced by testFiltering().
int alma::acs::jlog::test::EngineFilteringTest::xmlInfos = 0 [private] |
Referenced by setUp(), and xmlEntryReceived().
int alma::acs::jlog::test::EngineFilteringTest::xmlLogs = 0 [private] |
Referenced by setUp(), testFiltering(), and xmlEntryReceived().
1.6.2