1 package test.configuration; 2 3 import org.testng.TestNG; 4 import org.testng.annotations.Test; 5 6 import test.SimpleBaseTest; 7 import junit.framework.Assert; 8 9 public class SuiteFactoryOnceTest extends SimpleBaseTest { 10 11 @Test suiteMethodsShouldOnlyRunOnce()12 public void suiteMethodsShouldOnlyRunOnce() { 13 TestNG tng = create(SuiteFactoryOnceSample2Test.class); 14 SuiteFactoryOnceSample1Test.m_before = 0; 15 SuiteFactoryOnceSample1Test.m_after = 0; 16 tng.run(); 17 18 Assert.assertEquals(1, SuiteFactoryOnceSample1Test.m_before); 19 Assert.assertEquals(1, SuiteFactoryOnceSample1Test.m_after); 20 } 21 22 } 23