1 package test.parameters; 2 3 import org.testng.Assert; 4 import org.testng.annotations.Optional; 5 import org.testng.annotations.Parameters; 6 import org.testng.annotations.Test; 7 8 /** 9 * Checks to see if the parameters from parent suite are passed onto the 10 * child suite (referred by <suite-file>) 11 * @author nullin 12 * 13 */ 14 public class InheritFromSuiteChild1 15 { 16 @Test 17 @Parameters({"parameter1", "parameter2", "parameter3", "parameter4"}) inheritedparameter(String p1, String p2, @Optional("foobar")String p3, String p4)18 public void inheritedparameter(String p1, String p2, @Optional("foobar")String p3, String p4) { 19 Assert.assertEquals(p1, "p1"); 20 Assert.assertEquals(p2, "c1p2"); 21 Assert.assertEquals(p3, "foobar"); 22 Assert.assertEquals(p4, "c1p4"); 23 } 24 } 25