Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::jlog::test::CacheUtils Class Reference

List of all members.

Static Public Member Functions

Collection< Integer > generateKeys (int size, boolean exact, int minValue, int maxValue, Collection< Integer > common)
Collection< ILogEntrygenerateLogs (int numOfLogs) throws Exception
Collection< ILogEntrygenerateLogsType (int numOfLogs, LogTypeHelper logType) throws Exception
void populateCache (ILogMap cache, int numOfLogs) throws Exception
ILogMap getCache (int type, Integer opt) throws Exception
Collection< Integer > generateKeys (int size, boolean exact, int minValue, int maxValue, Collection< Integer > common)
Collection< ILogEntrygenerateLogs (int numOfLogs) throws Exception
Collection< ILogEntrygenerateLogsType (int numOfLogs, LogTypeHelper logType) throws Exception

Static Public Attributes

final String logHeaderStr = " TimeStamp=\""
final String logBodyStr = "\" Routine=\"CacheTest::testGet\" Host=\"this\" Process=\"test\" Thread=\"main\" Context=\"\"><![CDATA["
final String logFooterStr = "]]></"
final int LOGFILECACHE_TYPE = 0
final int LOGBUFFEREDFILECACHE_TYPE = 1
final int LOGCACHE_TYPE = 2
final int NUMOFCACHETYPES = 3

Static Private Attributes

ACSLogParser parser

Detailed Description

A collection of methods to be used in the tests

Author:
acaproni


Member Function Documentation

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.

Parameters:
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
Returns:
A posible empty collection of keys

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.

Parameters:
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
Returns:
A posible empty collection of keys

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

  • a different time stamp.
  • the message contains the key of the log
  • the log type is random (all types but Trace because trace has no body)

Parameters:
numOfLogs The number of logs to put in the collection
Returns:
The collection with the logs

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

  • a different time stamp.
  • the message contains the key of the log
  • the log type is random (all types but Trace because trace has no body)

Parameters:
numOfLogs The number of logs to put in the collection
Returns:
The collection with the logs

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

  • a different time stamp.
  • the message contains the key of the log

Parameters:
numOfLogs The number of logs to put in the collection
Returns:
The collection with the logs

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

  • a different time stamp.
  • the message contains the key of the log

Parameters:
numOfLogs The number of logs to put in the collection
Returns:
The collection with the logs

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.

Parameters:
type The type of the cache
opt The optional integer argument (if it is null, the cache is created with the empty constructor)
Returns:
The cache implementing ILogMap

void alma::acs::jlog::test::CacheUtils::populateCache ILogMap  cache,
int  numOfLogs
throws Exception [inline, static]
 

Add numOfLogs log to the cache.

Parameters:
cache The cache to fill with logs
numOfLogs The number of logs to insert in cache


Member Data Documentation

final String alma::acs::jlog::test::CacheUtils::logBodyStr = "\" Routine=\"CacheTest::testGet\" Host=\"this\" Process=\"test\" Thread=\"main\" Context=\"\"><![CDATA[" [static]
 

final int alma::acs::jlog::test::CacheUtils::LOGBUFFEREDFILECACHE_TYPE = 1 [static]
 

final int alma::acs::jlog::test::CacheUtils::LOGCACHE_TYPE = 2 [static]
 

final int alma::acs::jlog::test::CacheUtils::LOGFILECACHE_TYPE = 0 [static]
 

final String alma::acs::jlog::test::CacheUtils::logFooterStr = "]]></" [static]
 

final String alma::acs::jlog::test::CacheUtils::logHeaderStr = " TimeStamp=\"" [static]
 

final int alma::acs::jlog::test::CacheUtils::NUMOFCACHETYPES = 3 [static]
 

ACSLogParser alma::acs::jlog::test::CacheUtils::parser [static, private]
 


The documentation for this class was generated from the following files:
Generated on Thu Apr 30 02:53:35 2009 for ACS Java API by doxygen 1.3.8