concept TestCase in category ant

appears as: TestCase, TestCase
Ant in Action

This is an excerpt from Manning's book Ant in Action.

Figure 4.2 shows the UML model of the JUnit 3.8.2 library. The abstract TestCase class is of most interest to us.

Figure 4.2. JUnit UML diagram depicting the composite pattern utilized by TestCase and TestSuite. A TestSuite contains a collection of tests, which could be either more TestSuites or TestCases, or even classes simply implementing the test interface. The Assert class provides a set of static assertions you can make about your program.

The TestCase class represents a test to run. The Assert class provides a set of assertions that methods in a test case can make, assertions that verify that the program is doing what we expect. Test case classes are what developers write to test their applications.

You can add any number of test methods to a TestCase, all beginning with the prefix test. Methods without this prefix are ignored. You can use this trick to turn off tests or to write helper methods to simplify testing. JUnit 4.0 and TestNG let you use Java 5 annotations to mark the tests to run, but JUnit 3.8.x simply tests every method beginning with the word test.

public abstract class WebTestBase extends TestCase {
    protected String url;
    protected WebConversation session;

    public WebTestBase(String name) {
        super(name);
    }
}