|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
com.marringtons.util.TestCase
When using junit, use this class as a wrapper around the junit version to provide additional functionality.
| Constructor Summary | |
TestCase()
Default constructer - used when calling test cases directly. |
|
TestCase(String testName)
Constructor with package name |
|
| Method Summary | |
void |
check(boolean test)
A simpler and more readable way of saying assertTrue(); |
void |
check(boolean test,
Object message)
A simpler and more readable way of saying assertTrue(); |
void |
garbageCollect()
When testing it is sometimes necessary to garbage collect |
int |
random(int range)
Retrieve a random number given a minimum value and a range. |
int |
random(int from,
int range)
Retrieve a random number given a minimum value and a range. |
void |
testTest()
Empty test in case this is picked up by test suite |
| Methods inherited from class junit.framework.TestCase |
countTestCases, getName, run, run, runBare, 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 |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TestCase()
public TestCase(String testName)
testName - name of the test case being run.| Method Detail |
public void garbageCollect()
public void check(boolean test)
test - false causes a junit exception to be logged.
public void check(boolean test,
Object message)
test - false causes a junit exception to be logged.message - Message to display if test failed.
public int random(int from,
int range)
afternoonHour = random( 12, 12);
from - Base value (can be returned)range - Range above base possible (but not including range)
public int random(int range)
hour = random( 24); // returns 0 to 23
range - Range above base possible (but not including range)
public void testTest()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||