
Static Public Member Functions | |
| static Collection< Integer > | generateKeys (int size, boolean exact, int minValue, int maxValue, Collection< Integer > common) |
| static Collection< ILogEntry > | generateLogs (int numOfLogs) throws Exception |
| static Collection< ILogEntry > | generateLogsType (int numOfLogs, LogTypeHelper logType) throws Exception |
| static void | populateCache (ILogMap cache, int numOfLogs) throws Exception |
| static ILogMap | getCache (int type, Integer opt) throws Exception |
| static Collection< Integer > | generateKeys (int size, boolean exact, int minValue, int maxValue, Collection< Integer > common) |
| static Collection< ILogEntry > | generateLogs (int numOfLogs) throws Exception |
| static Collection< ILogEntry > | generateLogsType (int numOfLogs, LogTypeHelper logType) throws Exception |
Static Public Attributes | |
| static final String | logHeaderStr = " TimeStamp=\"" |
| static final String | logBodyStr = "\" Routine=\"CacheTest::testGet\" Host=\"this\" Process=\"test\" Thread=\"main\" Context=\"\"><![CDATA[" |
| static final String | logFooterStr = "]]></" |
| static final int | LOGFILECACHE_TYPE = 0 |
| static final int | LOGBUFFEREDFILECACHE_TYPE = 1 |
| static final int | LOGCACHE_TYPE = 2 |
| static final int | NUMOFCACHETYPES = 3 |
Static Private Attributes | |
| static ACSLogParser | parser |
A collection of methods to be used in the tests
| static Collection<Integer> alma::acs::jlog::test::CacheUtils::generateKeys | ( | int | size, | |
| boolean | exact, | |||
| int | minValue, | |||
| int | maxValue, | |||
| Collection< Integer > | common | |||
| ) | [inline, static] |
Generate a random collection of keys.
The size of the collection can be random or fixed. If it is random then the exact parameter must be false; in that case the number of elements returned is limited by size (inclusive) The number of elements in the collection is fixed if the exact parameter is true; in that case the number of elements returned is specified in size.
If the size is random, the returned collection can be empty.
If common is not null, each generated key must also be present in common. For this to work, the size of common is an upper limit for the size of the returned collection.
| size | The upper limit of the number of elements in the collection or the number of elements in the returned collection depending on the value of the exact parameter | |
| exact | If true the size of the returned collection is equal to size otherwise size is the maximum limit | |
| minValue | The minimum allowed value of the keys in the collection (inclusive) | |
| maxValue | The maximum allowed value of the keys in the collection (inclusive) | |
| common | A collection of keys They key in the returned collection must be present in common too If common is null the keys are generated without constraints |
| static Collection<Integer> alma::acs::jlog::test::CacheUtils::generateKeys | ( | int | size, | |
| boolean | exact, | |||
| int | minValue, | |||
| int | maxValue, | |||
| Collection< Integer > | common | |||
| ) | [inline, static] |
Generate a random collection of keys.
The size of the collection can be random or fixed. If it is random then the exact parameter must be false; in that case the number of elements returned is limited by size (inclusive) The number of elements in the collection is fixed if the exact parameter is true; in that case the number of elements returned is specified in size.
If the size is random, the returned collection can be empty.
If common is not null, each generated key must also be present in common. For this to work, the size of common is an upper limit for the size of the returned collection.
| size | The upper limit of the number of elements in the collection or the number of elements in the returned collection depending on the value of the exact parameter | |
| exact | If true the size of the returned collection is equal to size otherwise size is the maximum limit | |
| minValue | The minimum allowed value of the keys in the collection (inclusive) | |
| maxValue | The maximum allowed value of the keys in the collection (inclusive) | |
| common | A collection of keys They key in the returned collection must be present in common too If common is null the keys are generated without constraints |
| static Collection<ILogEntry> alma::acs::jlog::test::CacheUtils::generateLogs | ( | int | numOfLogs | ) | throws Exception [inline, static] |
Generate a set of logs to be used for testing Each log has
| numOfLogs | The number of logs to put in the collection |
References logBodyStr, logFooterStr, logHeaderStr, alma::acs::logging::engine::parser::ACSLogParser::parse(), and parser.
| static Collection<ILogEntry> alma::acs::jlog::test::CacheUtils::generateLogs | ( | int | numOfLogs | ) | throws Exception [inline, static] |
Generate a set of logs to be used for testing Each log has
| numOfLogs | The number of logs to put in the collection |
References logBodyStr, logFooterStr, logHeaderStr, alma::acs::logging::engine::parser::ACSLogParser::parse(), and parser.
Referenced by populateCache().
| static Collection<ILogEntry> alma::acs::jlog::test::CacheUtils::generateLogsType | ( | int | numOfLogs, | |
| LogTypeHelper | logType | |||
| ) | throws Exception [inline, static] |
Generate a set of logs of a given type Each log has
| numOfLogs | The number of logs to put in the collection |
References logBodyStr, logFooterStr, logHeaderStr, alma::acs::logging::engine::parser::ACSLogParser::parse(), and parser.
| static Collection<ILogEntry> alma::acs::jlog::test::CacheUtils::generateLogsType | ( | int | numOfLogs, | |
| LogTypeHelper | logType | |||
| ) | throws Exception [inline, static] |
Generate a set of logs of a given type Each log has
| numOfLogs | The number of logs to put in the collection |
References logBodyStr, logFooterStr, logHeaderStr, alma::acs::logging::engine::parser::ACSLogParser::parse(), and parser.
| static ILogMap alma::acs::jlog::test::CacheUtils::getCache | ( | int | type, | |
| Integer | opt | |||
| ) | throws Exception [inline, static] |
Create a cache of the given type. The cache is created with the empty constructor if the opt param is null. If opt is not null the cache is created passing opt in the constructor. LogFileCache has only the empty constructor: for this class opt is ignored.
| type | The type of the cache | |
| opt | The optional integer argument (if it is null, the cache is created with the empty constructor) |
References LOGBUFFEREDFILECACHE_TYPE, LOGCACHE_TYPE, and LOGFILECACHE_TYPE.
| static void alma::acs::jlog::test::CacheUtils::populateCache | ( | ILogMap | cache, | |
| int | numOfLogs | |||
| ) | throws Exception [inline, static] |
Add numOfLogs log to the cache.
| cache | The cache to fill with logs | |
| numOfLogs | The number of logs to insert in cache |
References generateLogs().
static final String alma::acs::jlog::test::CacheUtils::logBodyStr = "\" Routine=\"CacheTest::testGet\" Host=\"this\" Process=\"test\" Thread=\"main\" Context=\"\"><![CDATA[" [static] |
Referenced by generateLogs(), and generateLogsType().
final int alma::acs::jlog::test::CacheUtils::LOGBUFFEREDFILECACHE_TYPE = 1 [static] |
Referenced by getCache().
final int alma::acs::jlog::test::CacheUtils::LOGCACHE_TYPE = 2 [static] |
Referenced by getCache().
final int alma::acs::jlog::test::CacheUtils::LOGFILECACHE_TYPE = 0 [static] |
Referenced by getCache().
static final String alma::acs::jlog::test::CacheUtils::logFooterStr = "]]></" [static] |
Referenced by generateLogs(), and generateLogsType().
static final String alma::acs::jlog::test::CacheUtils::logHeaderStr = " TimeStamp=\"" [static] |
Referenced by generateLogs(), and generateLogsType().
final int alma::acs::jlog::test::CacheUtils::NUMOFCACHETYPES = 3 [static] |
static ACSLogParser alma::acs::jlog::test::CacheUtils::parser [static, private] |
Referenced by generateLogs(), and generateLogsType().
1.6.2