To run test case by own ordered way other than TestNG having depunit.
download depunit jar file from the below link:
https://code.google.com/p/depunit/downloads/list
See the below sample code
public class DepUnitTestEX {
@BeforeClass
public void setUP(){
System.out.println("---in before");
}
@Test(softDependencyOn={"testC"})
public void testB(){
System.out.println("----in testB---");
}
@AfterClass
public void tearDown(){
System.out.println("---in after---");
}
@Test
public void testC(){
System.out.println("----in testC---");
Assert.fail("test fail");
}
}
download depunit jar file from the below link:
https://code.google.com/p/depunit/downloads/list
See the below sample code
public class DepUnitTestEX {
@BeforeClass
public void setUP(){
System.out.println("---in before");
}
@Test(softDependencyOn={"testC"})
public void testB(){
System.out.println("----in testB---");
}
@AfterClass
public void tearDown(){
System.out.println("---in after---");
}
@Test
public void testC(){
System.out.println("----in testC---");
Assert.fail("test fail");
}
}
No comments:
Post a Comment