Test case method should start with test : Introduction « JUnit « Java Tutorial






import junit.framework.TestCase;

public class TestSimple extends TestCase {

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

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

  public void testAdds() {
    assertEquals(2, 1 + 1);
    assertEquals(4, 2 + 2);
    assertEquals(-8, -12 + 4);
  }

}








39.1.Introduction
39.1.1.How To Run A JUnit Test
39.1.2.Test case method should start with test