2010 FRC Java API


edu.wpi.first.testing
Class TestClass.Test

java.lang.Object
  extended by edu.wpi.first.testing.TestClass.Test
Enclosing class:
TestClass

public abstract class TestClass.Test
extends Object

This class should be extended within subclasses of each TestClass to add a test. In the constructor for the TestClass you could put : new Test() { public String getName() { return "Sample"; } public void run() { //your test here assertFail("I don't work"); } };


Constructor Summary
TestClass.Test(String name)
          Create a new Test and add it to the master classes table of tests
 
Method Summary
 String getName()
          Get the name of this test, should be unique within this test class.
abstract  void run()
          The code to test.
 void setup()
          Setup code to run before this test is run
 void teardown()
          Teardown code to run after the test is run
 String toString()
          Return a string representing this Test.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestClass.Test

public TestClass.Test(String name)
Create a new Test and add it to the master classes table of tests

Parameters:
name - The name for this test, This should be unique for this TestClass.
Method Detail

getName

public String getName()
Get the name of this test, should be unique within this test class.

Returns:
the name of the test

run

public abstract void run()
The code to test. Failure is triggered using one of the assert methods


setup

public void setup()
Setup code to run before this test is run


teardown

public void teardown()
Teardown code to run after the test is run


toString

public String toString()
Return a string representing this Test.

Overrides:
toString in class Object
Returns:
The name of the Test.

2010 FRC Java API


Copyright © 2006-2009 Sun Microsystems, Inc. All Rights Reserved.