1 package test.dependent; 2 3 import org.testng.annotations.Test; 4 5 import test.BaseTest; 6 7 public class ImplicitGroupInclusionTest extends BaseTest { 8 9 @Test verifyImplicitGroupInclusion()10 public void verifyImplicitGroupInclusion() { 11 addClass("test.dependent.ImplicitGroupInclusionSampleTest"); 12 addIncludedGroup("b"); 13 14 run(); 15 String[] passed = { 16 "a", "b", "z" 17 }; 18 String[] failed = { 19 }; 20 String[] skipped = { 21 }; 22 verifyTests("Failed", failed, getFailedTests()); 23 verifyTests("Passed", passed, getPassedTests()); 24 verifyTests("Skipped", skipped, getSkippedTests()); 25 } 26 27 @Test verifyImplicitGroupInclusion2()28 public void verifyImplicitGroupInclusion2() { 29 addClass("test.dependent.ImplicitGroupInclusion2SampleTest"); 30 addIncludedGroup("g2"); 31 32 run(); 33 String[] passed = { 34 "m3" 35 }; 36 String[] failed = { 37 }; 38 String[] skipped = { 39 }; 40 verifyTests("Failed", failed, getFailedTests()); 41 verifyTests("Passed", passed, getPassedTests()); 42 verifyTests("Skipped", skipped, getSkippedTests()); 43 } 44 45 @Test verifyImplicitGroupInclusion4()46 public void verifyImplicitGroupInclusion4() { 47 addClass("test.dependent.ImplicitGroupInclusion4SampleTest"); 48 addIncludedGroup("g2"); 49 50 run(); 51 String[] passed = { 52 "m3", "m4" 53 }; 54 String[] failed = { 55 }; 56 String[] skipped = { 57 }; 58 verifyTests("Failed", failed, getFailedTests()); 59 verifyTests("Passed", passed, getPassedTests()); 60 verifyTests("Skipped", skipped, getSkippedTests()); 61 } 62 63 @Test verifyImplicitGroupInclusion3()64 public void verifyImplicitGroupInclusion3() { 65 addClass("test.dependent.ImplicitGroupInclusion3SampleTest"); 66 addIncludedGroup("inc"); 67 addExcludedGroup("exc"); 68 69 run(); 70 String[] passed = { 71 "test1" 72 }; 73 String[] failed = { 74 }; 75 String[] skipped = { 76 }; 77 verifyTests("Failed", failed, getFailedTests()); 78 verifyTests("Passed", passed, getPassedTests()); 79 verifyTests("Skipped", skipped, getSkippedTests()); 80 } 81 82 @Test verifyImplicitMethodInclusion()83 public void verifyImplicitMethodInclusion() { 84 addClass("test.dependent.ImplicitMethodInclusionSampleTest"); 85 addIncludedGroup("windows"); 86 87 run(); 88 String[] passed = { 89 "a", "b" 90 }; 91 String[] failed = { 92 }; 93 String[] skipped = { 94 }; 95 verifyTests("Failed", failed, getFailedTests()); 96 verifyTests("Passed", passed, getPassedTests()); 97 verifyTests("Skipped", skipped, getSkippedTests()); 98 } 99 100 } 101