1 package test.dependent;
2 
3 import org.testng.annotations.Test;
4 
5 import test.BaseTest;
6 
7 public class DependentAlwaysRunTest extends BaseTest {
8   @Test
verifyDependsOnMethodsAlwaysRun()9   public void verifyDependsOnMethodsAlwaysRun() {
10     addClass("test.dependent.DependentOnMethod1AlwaysRunSampleTest");
11 
12     run();
13     String[] passed = {
14         "b", "verify"
15      };
16     String[] failed = {
17        "a"
18     };
19     String[] skipped = {
20     };
21     verifyTests("Failed", failed, getFailedTests());
22     verifyTests("Passed", passed, getPassedTests());
23     verifyTests("Skipped", skipped, getSkippedTests());
24   }
25 
26   @Test
verifyDependsOnGroups1AlwaysRun()27   public void verifyDependsOnGroups1AlwaysRun() {
28     addClass("test.dependent.DependentOnGroup1AlwaysRunSampleTest");
29 
30     run();
31     String[] passed = {
32         "b", "verify"
33      };
34     String[] failed = {
35        "a"
36     };
37     String[] skipped = {
38     };
39     verifyTests("Failed", failed, getFailedTests());
40     verifyTests("Passed", passed, getPassedTests());
41     verifyTests("Skipped", skipped, getSkippedTests());
42   }
43 
44   @Test
verifyDependsOnGroups2AlwaysRun()45   public void verifyDependsOnGroups2AlwaysRun() {
46     addClass("test.dependent.DependentOnGroup2AlwaysRunSampleTest");
47 
48     run();
49     String[] passed = {
50         "a2", "b", "verify"
51      };
52     String[] failed = {
53        "a"
54     };
55     String[] skipped = {
56     };
57     verifyTests("Failed", failed, getFailedTests());
58     verifyTests("Passed", passed, getPassedTests());
59     verifyTests("Skipped", skipped, getSkippedTests());
60   }
61 
62 }
63