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 |
|
|
|
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.
|
|
This execute for each test and we want to have a cache with some logs
|
|
|
|
Check the add method by inserting and reading a log |
|
test if a cleared cache contains exactly 0 logs
|
|
Get all the logs in cache to check the get method
|
|
|
|
|
|
|
|
Test the keys returned by keyset
|
|
Check if the method returning the logs exceeding the time frame is working as expected.
|
|
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. |
|
Test the replacement of a log |
|
It checks if all the logs in the file are in the cache
|
|
Check the calculation of the time frame
|
|
|
|
|