01: package test;
02:
03: import org.testng.Assert;
04: import org.testng.annotations.BeforeMethod;
05: import org.testng.annotations.Test;
06:
07: /**
08: * Test that if an individual method is specified on testng.xml, the @Configuration
09: * method still runs.
10: *
11: * Created on Aug 1, 2005
12: * @author cbeust
13: */
14: public class IndividualMethodsTest {
15: private boolean m_setUpCalled = false;
16:
17: @BeforeMethod
18: public void setUp() {
19: m_setUpCalled = true;
20: }
21:
22: @Test
23: public void testMethod() {
24: // this line causes the test to fail, showing that setUp() hadn't been run
25: Assert.assertTrue(m_setUpCalled);
26: }
27: }
|