You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Such as, in a Factory, will generate three classes with two test methods. The first class passed, and the second one failed, then the third class will skipped. Test result look like:
Test 1.1 pass
Test 1.2 pass
beforeClass 2 fail
Test 2.1 skip
Test 2.2 skip
beforeClass 3 skip
Test 3.1 skip
Test 3.2 skip
Please see the attachment source code to repro this issue.
The text was updated successfully, but these errors were encountered:
@test(suiteName = "com.juan.test", testName = "Factory Test")
public class FactoryTest {
/**
* Generate 3 test in this factory
*
* @return
*/ @factory
public static Object[] createInstances() {
return new Object[] { new FactoryTest(1), new FactoryTest(2),
new FactoryTest(3) };
}
private final int instanceIndex;
public FactoryTest(int instanceIndex) {
this.instanceIndex = instanceIndex;
}
@BeforeTest()
public void before() throws InterruptedException {
System.out.println("Before Test " + this.instanceIndex);
}
@BeforeClass(timeOut = 1000)
public void beforeClass() throws InterruptedException {
System.out.println("Before Class " + this.instanceIndex);
if (this.instanceIndex >= 2) {
fail("Before class failed.");
}
}
@Test(description = "Doing the test 1.", timeOut = 1000)
public void timeOutTest1() throws InterruptedException {
System.out.println(String.format("Test %s.%s", this.instanceIndex, 1));
}
@Test(description = "Doing the test 2.", timeOut = 1000)
public void timeOutTest2() throws InterruptedException {
System.out.println(String.format("Test %s.%s", this.instanceIndex, 2));
}
@AfterClass(timeOut = 1000, alwaysRun = true)
public void afterClass() throws InterruptedException {
System.out.println("After class " + this.instanceIndex);
}
@AfterTest(alwaysRun = true)
public void after() throws InterruptedException {
System.out.println("After Test " + this.instanceIndex);
}
Such as, in a Factory, will generate three classes with two test methods. The first class passed, and the second one failed, then the third class will skipped. Test result look like:
Test 1.1 pass
Test 1.2 pass
beforeClass 2 fail
Test 2.1 skip
Test 2.2 skip
beforeClass 3 skip
Test 3.1 skip
Test 3.2 skip
Please see the attachment source code to repro this issue.
The text was updated successfully, but these errors were encountered: