1package test.configuration; 2 3import org.testng.Assert; 4import org.testng.annotations.BeforeGroups; 5import org.testng.annotations.Test; 6 7@Test( groups = "foo" ) 8public class MultipleBeforeGroupTest { 9 private int m_count = 0; 10 11 @BeforeGroups( "foo" ) 12 public void beforeGroups() { 13 m_count++; 14 } 15 16 @Test() 17 public void test() { 18 } 19 20 @Test(dependsOnMethods = "test") 21 public void verify() { 22 Assert.assertEquals(1, m_count); 23 } 24 25} 26