• Calls the test case’s setUp() method
• Calls the test method
• Calls the test case’s tearDown() method.
This process repeats for each of the test methods in the test case.
Sample Code :
import java.io.IOException;
import junit.framework.TestCase;
public class HtmlDocumentTest extends DocumentTestCase
{
public HtmlDocumentTest (String name) {
super(name);
}
HtmlDocument doc;
public void setUp() throws IOException {
doc = new HtmlDocument(getFile("test.html"));
}
public void testDoc() {
assertEquals("Title", "Test Title", doc.getTitle());
assertEquals("Body", "This is some test", doc.getBodyText());
}
public void tearDown() {
doc = null;
}
}