|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
ctf.evaluation.TestCase
public class TestCase
A JUnit test case, with a couple of extra methods. Normally, I wouldn't use inheritance for this sort of thing. Inheritance, however, is exactly how the JUnit people do it, so I'll follow their convention.
Constructor Summary | |
---|---|
TestCase()
|
Method Summary | |
---|---|
static void |
assertClose(double expected,
double actual)
Ensure that two floats are "close" to each other (using the default tolerance). |
static void |
assertClose(double expected,
double actual,
double tolerance)
Ensure that two floats are "close" to each other. |
static void |
assertClose(Point expected,
Point actual)
Ensure that two points are "close" to each other. |
static void |
assertClose(java.lang.String message,
double expected,
double actual)
Ensure that two floats are "close" to each other (using the default tolerance). |
static void |
assertClose(java.lang.String message,
double expected,
double actual,
double tolerance)
Ensure that two floats are within some % tolerance of each other. |
static void |
assertClose(java.lang.String message,
Point expected,
Point actual)
Ensure that two points are "close" to each other. |
static void |
assertClose(java.lang.String message,
Point expected,
Point actual,
double tolerance)
Ensure that two points are "close" to each other. |
static void |
assertCloseAbsolute(java.lang.String message,
Point expected,
Point actual,
double diff)
Ensure that two points are "close" to each other. |
void |
setUp()
|
protected void |
sleep(int milliseconds)
Wait for a number of milliseconds (no InterruptedException). |
void |
tearDown()
|
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, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TestCase()
Method Detail |
---|
public void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
public void tearDown() throws java.lang.Exception
tearDown
in class junit.framework.TestCase
java.lang.Exception
protected void sleep(int milliseconds)
public static void assertClose(double expected, double actual)
expected
- the expected valueactual
- the actual valuepublic static void assertClose(double expected, double actual, double tolerance)
expected
- the expected valueactual
- the actual valuetolerance
- how close they should be (e.g. .01 => 1% tol.)public static void assertClose(java.lang.String message, double expected, double actual)
message
- what to say if they're not close enoughexpected
- the expected valueactual
- the actual valuepublic static void assertClose(java.lang.String message, double expected, double actual, double tolerance) throws junit.framework.AssertionFailedError
message
- what to say if they're not close enoughexpected
- the expected valueactual
- the actual valuetolerance
- how close they should be (e.g. .01 => 1% tol.)
junit.framework.AssertionFailedError
public static void assertClose(Point expected, Point actual)
expected
- the expected valueactual
- the actual valuepublic static void assertClose(java.lang.String message, Point expected, Point actual)
message
- what to say if they're not close enoughexpected
- the expected valueactual
- the actual valuepublic static void assertClose(java.lang.String message, Point expected, Point actual, double tolerance)
message
- what to say if they're not close enoughexpected
- the expected valueactual
- the actual valuetolerance
- how close they should be (e.g. .01 => 1% tol.)public static void assertCloseAbsolute(java.lang.String message, Point expected, Point actual, double diff)
message
- what to say if they're not close enoughexpected
- the expected valueactual
- the actual valuediff
- maximum difference between values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |