|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.testcase.TestCacheThreaded
Simple class (JUnit agnostic) to test cache implementation. This implementation creates multiple threads, each with a different template to retrieve, and counts how many templates were retrieved in a given period. In addition, it also collects statistics of the various events that were fired during the test, and outputs them at the end.
CacheThread
,
CacheThread2
,
CacheThread3
,
CacheThread4
,
CacheThread5
Constructor Summary | |
TestCacheThreaded()
Creates new TestCacheThreaded |
Method Summary | |
void |
cacheUnavailable(CacheEvent e)
Called when a cache cannot be updated. |
void |
elementRemoved(CacheEvent e)
Called when an element is removed from the cache. |
void |
elementUpdated(CacheEvent e)
Called when a cache element updates successfully. |
void |
elementUpdateFailed(CacheEvent e)
Called when a cache element fails to update. |
protected java.lang.String |
getTestcasePath()
Retrieve the root path of the FM-Classic distribution from a properties file. |
static void |
main(java.lang.String[] args)
Main code for running the test. |
void |
test()
Performs the test. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TestCacheThreaded()
Method Detail |
public void test() throws java.lang.Exception
System.out
.public void elementRemoved(CacheEvent e)
elementRemoved
in interface CacheListener
e
- the CacheEvent
fired.public void elementUpdateFailed(CacheEvent e)
Exception
object.elementUpdateFailed
in interface CacheListener
e
- the CacheEvent
fired.public void cacheUnavailable(CacheEvent e)
Exception
object.cacheUnavailable
in interface CacheListener
e
- the CacheEvent
fired.public void elementUpdated(CacheEvent e)
elementUpdated
in interface CacheListener
e
- the CacheEvent
fired.protected java.lang.String getTestcasePath() throws java.io.IOException
public static void main(java.lang.String[] args) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |