extends TestCase : TestCase « JUnit « Java Tutorial






import junit.framework.*;

public class TestSimple extends TestCase {

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

  public void testAdd() {
    assertEquals(2, 1+1);
  }

}








39.2.TestCase
39.2.1.extends TestCase
39.2.2.Use assertEquals in a test method
39.2.3.JUnit Test Composition
39.2.4.Per-Test Setup and Tear-Down
39.2.5.Test Skeleton
39.2.6.Test your stack structure
39.2.7.Test algorithm
39.2.8.Init class being tested in test case method