• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package test.sample;
2 
3 import org.testng.Assert;
4 import org.testng.annotations.BeforeClass;
5 import org.testng.annotations.Test;
6 
7 /**
8  * This class tests groups that are partially defined at the class level
9  * and then augmented at the method level.
10  *
11  * @author cbeust
12  */
13 
14 @Test(groups = { "classGroup" })
15 public class PartialGroupTest {
16   public static boolean m_successMethod = false;
17   public static boolean m_successClass = false;
18 
19   @BeforeClass
init()20   public void init() {
21     m_successMethod = false;
22     m_successClass = false;
23   }
24 
25   @Test(groups = { "methodGroup" })
testMethodGroup()26   public void testMethodGroup() {
27     m_successMethod = true;
28   }
29 
30   @Test
testClassGroupShouldFail()31   public void testClassGroupShouldFail() {
32     Assert.assertTrue(false);
33   }
34 
35   @Test(groups = { "methodGroup" })
testMethodGroupShouldFail()36   public void testMethodGroupShouldFail() {
37     Assert.assertTrue(false);
38   }
39 
40   @Test
testClassGroup()41   public void testClassGroup() {
42     m_successClass = true;
43   }
44 
45 }
46