/**** * * TestNG (or Junit) manual test driver. * */ import java.util.Collection; import java.util.LinkedList; import org.testng.*; import org.testng.annotations.*; @Test public class CoverageExampleTest { final CoverageExample ce = new CoverageExample(); /** * Test the method f with the following plan: * * Test * Case Input Output Remarks * ===================================================== * 1 i=1, j=2 return = 4 Cover branch 1 * 2 i=100, j=101 return = 202 Cover branch 2 * 3 i=100, j=100 return = 202 Cover branch 3 * 4 i=1, j=1 return = 9 Cover branch 4 */ public void testF() {} /** * testF case */ @Test public void testFCase1() { Assert.assertEquals(4, ce.f(1,2)); } /** * testF Case 2. */ @Test public void testFCase2() { Assert.assertEquals(202, ce.f(100,101)); } /** * testF Case 3. */ @Test public void testFCase3() { Assert.assertEquals(202, ce.f(100,100)); } /** * testF Case 4. */ @Test public void testFCase4() { Assert.assertEquals(9, ce.f(2,1)); } }