01: package test.testng56;
02:
03: import org.testng.annotations.AfterClass;
04: import org.testng.annotations.BeforeClass;
05: import org.testng.annotations.Test;
06:
07: /**
08: * This class/interface
09: */
10: public class ParallelTest {
11: @BeforeClass
12: public void setup() {
13: System.out.println(Thread.currentThread().getId() + ":setup");
14: }
15:
16: @AfterClass
17: public void teardown() {
18: System.out
19: .println(Thread.currentThread().getId() + ":teardown");
20: }
21:
22: @Test
23: public void test1() {
24: System.out.println(Thread.currentThread().getId() + ":test1");
25: }
26:
27: @Test(dependsOnMethods={"test1"})
28: public void test2() {
29: System.out.println(Thread.currentThread().getId() + ":test2");
30: }
31:
32: @Test
33: public void test3() {
34: System.out.println(Thread.currentThread().getId() + ":test3");
35: }
36:
37: @Test(dependsOnMethods={"test3"})
38: public void test4() {
39: System.out.println(Thread.currentThread().getId() + ":test4");
40: }
41:
42: @Test
43: public void test5() {
44: System.out.println(Thread.currentThread().getId() + ":test5");
45: }
46: }
|