|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.jcs.JCSThrashTest
public class JCSThrashTest
This is based on a test that was posted to the user's list:
http://www.opensubscriber.com/message/jcs-users@jakarta.apache.org/2435965.html
| Nested Class Summary | |
|---|---|
protected static interface |
JCSThrashTest.Executable
A runnable, that can throw an exception. |
| Field Summary | |
|---|---|
protected JCS<String,Serializable> |
jcs
the cache instance |
| Constructor Summary | |
|---|---|
JCSThrashTest(String arg0)
|
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
|
protected long |
measureMemoryUse()
Measure memory used by the VM. |
protected void |
runThreads(List<JCSThrashTest.Executable> executables)
Runs a set of threads, for a fixed amount of time. |
protected void |
setUp()
Sets up the test |
protected void |
tearDown()
|
void |
testForMemoryLeaks()
This does a bunch of work and then verifies that the memory has not grown by much. |
void |
testPut()
Tests adding an entry. |
void |
testRemove()
Test elements can be removed from the store |
protected long |
thrashCache()
|
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected JCS<String,Serializable> jcs
| Constructor Detail |
|---|
public JCSThrashTest(String arg0)
arg0 - | Method Detail |
|---|
public static void main(String[] args)
args -
protected void setUp()
throws Exception
setUp in class junit.framework.TestCaseException
protected void tearDown()
throws Exception
tearDown in class junit.framework.TestCaseException
public void testPut()
throws Exception
Exception
public void testRemove()
throws Exception
Exception
public void testForMemoryLeaks()
throws Exception
Exception
protected long thrashCache()
throws Exception
Exception
protected void runThreads(List<JCSThrashTest.Executable> executables)
throws Exception
executables -
Exception
protected long measureMemoryUse()
throws InterruptedException
InterruptedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||