
Public Member Functions | |
| CacheTest (String str) | |
| void | testSize () throws Exception |
| void | testGet () throws Exception |
| void | testAddLog () throws Exception |
| void | testReplace () throws Exception |
| void | testClear () throws Exception |
| void | testMemoryCache () throws Exception |
| void | testTimeFrameCalc () throws Exception |
| void | testLogExceedingTimeFrame () throws Exception |
| void | testGetFirstLog () throws Exception |
| void | testGetLastLog () throws Exception |
| void | testGetLogs () throws Exception |
| void | testKeySet () throws Exception |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () |
Private Member Functions | |
| long | fillCache () throws Exception |
Private Attributes | |
| LogCache | cache |
| long | logsGenerated |
The class to test the LogFileCache and the LogCache
| com::cosylab::logging::CacheTest::CacheTest | ( | String | str | ) | [inline] |
| long com::cosylab::logging::CacheTest::fillCache | ( | ) | throws Exception [inline, private] |
Fill the cache with dynamically generated logs The number of logs inserted in the list is greater than the memory cache size to stress the disk cache also.
| Exception |
References com::cosylab::logging::client::cache::LogCache::add(), cache, com::cosylab::logging::client::cache::LogCache::clear(), com::cosylab::logging::client::cache::LogCache::getCacheSize(), and alma::acs::logging::engine::parser::ACSLogParser::parse().
Referenced by setUp().
| void com::cosylab::logging::CacheTest::setUp | ( | ) | throws Exception [inline, protected] |
This execute for each test and we want to have a cache with some logs
References cache, fillCache(), and logsGenerated.
| void com::cosylab::logging::CacheTest::tearDown | ( | ) | [inline, protected] |
References cache, and com::cosylab::logging::client::cache::LogCache::clear().
| void com::cosylab::logging::CacheTest::testAddLog | ( | ) | throws Exception [inline] |
Check the add method by inserting and reading a log
References com::cosylab::logging::client::cache::LogCache::add(), cache, com::cosylab::logging::engine::log::ILogEntry::getField(), com::cosylab::logging::client::cache::LogCache::getLog(), com::cosylab::logging::client::cache::LogMultiFileCache::getSize(), and alma::acs::logging::engine::parser::ACSLogParser::parse().
| void com::cosylab::logging::CacheTest::testClear | ( | ) | throws Exception [inline] |
test if a cleared cache contains exactly 0 logs
| Exception |
References cache, com::cosylab::logging::client::cache::LogCache::clear(), and com::cosylab::logging::client::cache::LogMultiFileCache::getSize().
| void com::cosylab::logging::CacheTest::testGet | ( | ) | throws Exception [inline] |
Get all the logs in cache to check the get method
| Exception |
References cache, com::cosylab::logging::client::cache::LogCache::getLog(), and com::cosylab::logging::client::cache::LogMultiFileCache::getSize().
| void com::cosylab::logging::CacheTest::testGetFirstLog | ( | ) | throws Exception [inline] |
| void com::cosylab::logging::CacheTest::testGetLastLog | ( | ) | throws Exception [inline] |
| void com::cosylab::logging::CacheTest::testGetLogs | ( | ) | throws Exception [inline] |
| void com::cosylab::logging::CacheTest::testKeySet | ( | ) | throws Exception [inline] |
Test the keys returned by keyset
| Exception |
References cache, com::cosylab::logging::client::cache::LogCache::getLog(), com::cosylab::logging::client::cache::LogMultiFileCache::getSize(), and com::cosylab::logging::client::cache::LogCache::keySet().
| void com::cosylab::logging::CacheTest::testLogExceedingTimeFrame | ( | ) | throws Exception [inline] |
Check if the method returning the logs exceeding the time frame is working as expected.
| Exception |
References com::cosylab::logging::client::cache::LogCache::add(), cache, com::cosylab::logging::client::cache::LogCache::clear(), com::cosylab::logging::engine::log::ILogEntry::getField(), com::cosylab::logging::client::cache::LogCache::getLog(), com::cosylab::logging::client::cache::LogCache::getLogExceedingTimeFrame(), com::cosylab::logging::client::cache::LogMultiFileCache::getSize(), and alma::acs::logging::engine::parser::ACSLogParser::parse().
| void com::cosylab::logging::CacheTest::testMemoryCache | ( | ) | throws Exception [inline] |
It is deifficult to test LogCache... This is better then nothing
The test is done by reading all the cache sequentially. The first, middle and last logs acquired in the beginning are compared with those retrieved with the sequential scan.
References cache, com::cosylab::logging::engine::log::ILogEntry::getField(), com::cosylab::logging::client::cache::LogCache::getLog(), and com::cosylab::logging::client::cache::LogMultiFileCache::getSize().
| void com::cosylab::logging::CacheTest::testReplace | ( | ) | throws Exception [inline] |
Test the replacement of a log
References cache, com::cosylab::logging::engine::log::ILogEntry::getField(), com::cosylab::logging::client::cache::LogCache::getLog(), com::cosylab::logging::client::cache::LogMultiFileCache::getSize(), alma::acs::logging::engine::parser::ACSLogParser::parse(), and com::cosylab::logging::client::cache::LogMultiFileCache::replaceLog().
| void com::cosylab::logging::CacheTest::testSize | ( | ) | throws Exception [inline] |
It checks if all the logs in the file are in the cache
| Exception |
References cache, com::cosylab::logging::client::cache::LogMultiFileCache::getSize(), and logsGenerated.
| void com::cosylab::logging::CacheTest::testTimeFrameCalc | ( | ) | throws Exception [inline] |
Check the calculation of the time frame
| Exception |
References com::cosylab::logging::client::cache::LogCache::add(), cache, com::cosylab::logging::client::cache::LogCache::clear(), com::cosylab::logging::client::cache::LogCache::getTimeFrame(), and alma::acs::logging::engine::parser::ACSLogParser::parse().
long com::cosylab::logging::CacheTest::logsGenerated [private] |
Referenced by setUp(), testGetLastLog(), and testSize().
1.6.2