|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.testing.TestClass
public abstract class TestClass
This class should be extended by test classes. Make sure to call the constructor for each subclass once so that the class is added to the master hashtable
Nested Class Summary | |
---|---|
class |
TestClass.Test
This class should be extended within subclasses of each TestClass to add a test. |
Constructor Summary | |
---|---|
TestClass()
Create a new instance of the test class and add it to the master table of test classes |
Method Summary | |
---|---|
protected void |
assertEquals(double expected,
double actual)
Fail the test if the given items are not the same |
protected void |
assertEquals(double expected,
double actual,
double tolerance)
Fail the test if the given items are not the same |
protected void |
assertEquals(long expected,
long actual)
Fail the test if the given items are not the same |
protected void |
assertEquals(Object expected,
Object actual)
Fail the test if the given items are not the same |
protected void |
assertFail(String msg)
Fail the test. |
protected void |
assertFalse(boolean value)
Fail the test if the given value is false. |
protected void |
assertTrue(boolean value)
Fail the test if the given value is true. |
static Failure[] |
getFailures()
Get a list of all the failed tests. |
abstract String |
getName()
Get the name of this TestClass. |
static void |
run(String clas)
Run the tests within the class name given |
static void |
run(String clas,
String test)
Run the given test within the given class |
static void |
runAll()
Run all of the tests in all of the classes. |
void |
setup()
Setup code to run before the tests within this class are run |
void |
teardown()
Teardown code to run after the tests within this class are run |
String |
toString()
Get a string representing this TestClass. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TestClass()
Method Detail |
---|
public abstract String getName()
public void setup()
public void teardown()
public static Failure[] getFailures()
public String toString()
toString
in class Object
public static void run(String clas)
clas
- The name of the TestClass to runpublic static void run(String clas, String test)
clas
- The name of the class to run.test
- The name of the test to run.public static void runAll()
protected void assertFail(String msg)
msg
- A message descibing the failure.protected void assertEquals(Object expected, Object actual)
expected
- The expected value.actual
- The actual value.protected void assertEquals(long expected, long actual)
expected
- The expected value.actual
- The actual value.protected void assertEquals(double expected, double actual)
expected
- The expected value.actual
- The actual value.protected void assertEquals(double expected, double actual, double tolerance)
expected
- The expected value.actual
- The actual value.tolerance
- The amount by which the values must matchprotected void assertTrue(boolean value)
value
- Boolean value that must be true for successprotected void assertFalse(boolean value)
value
- Boolean value that must be false for success
|
2010 FRC Java API |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |