alma::acs::jlog::test::EngineCacheTest Class Reference

Inheritance diagram for alma::acs::jlog::test::EngineCacheTest:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::jlog::test::EngineCacheTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EngineCacheTest ()
void testPushPopSingleFile () throws Exception
void testPushPopSeveralFiles () throws Exception
void testCacheEntryTranslation () throws Exception

Protected Member Functions

void setUp () throws Exception
void tearDown () throws Exception

Private Member Functions

Vector< String > generateStrings (int size)

Private Attributes

EngineCache cache

Static Private Attributes

static final int CACHE_SIZE = 30000

Detailed Description

A class to test EngineCache.

Author:
acaproni

Constructor & Destructor Documentation

alma::acs::jlog::test::EngineCacheTest::EngineCacheTest (  )  [inline]

Member Function Documentation

Vector<String> alma::acs::jlog::test::EngineCacheTest::generateStrings ( int  size  )  [inline, private]

Generate the strings to put in the cache.

The number of strings to put in the vector depends by the passed parameter. The sum of the length of all the strings in the vector is equal or greater to the passed parameter. In this way it is possible to check if the cache creates/deletes a file in the right moment.

Parameters:
size The length of all the strings in the vector
Returns:
A vector of strings

Referenced by testPushPopSeveralFiles(), and testPushPopSingleFile().

void alma::acs::jlog::test::EngineCacheTest::setUp (  )  throws Exception [inline, protected]
void alma::acs::jlog::test::EngineCacheTest::tearDown (  )  throws Exception [inline, protected]
void alma::acs::jlog::test::EngineCacheTest::testCacheEntryTranslation (  )  throws Exception [inline]

Check the conversion in CacheEntry between the key, start and end position and their representations as an hexadecimal string.

References com::cosylab::logging::engine::cache::CacheEntry::end, com::cosylab::logging::engine::cache::CacheEntry::key, com::cosylab::logging::engine::cache::CacheEntry::start, and com::cosylab::logging::engine::cache::CacheEntry::toHexadecimal().

void alma::acs::jlog::test::EngineCacheTest::testPushPopSeveralFiles (  )  throws Exception [inline]
void alma::acs::jlog::test::EngineCacheTest::testPushPopSingleFile (  )  throws Exception [inline]

Test the normal behavior of the cache by pushing and getting strings into the cache without involving the creation of more then on file.

Exceptions:
Exception 

References cache, CACHE_SIZE, generateStrings(), com::cosylab::logging::engine::cache::EngineCache::getActiveFilesSize(), com::cosylab::logging::engine::cache::EngineCache::pop(), com::cosylab::logging::engine::cache::EngineCache::push(), and com::cosylab::logging::engine::cache::EngineCache::size().


Member Data Documentation

final int alma::acs::jlog::test::EngineCacheTest::CACHE_SIZE = 30000 [static, private]

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

Generated by  doxygen 1.6.2