lin
2025-08-01 633231e833e21d5b8b1c00cb15aedb62b3b78e8f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package test;
 
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
 
/**
 * Test that if an individual method is specified on testng.xml, the @Configuration
 * method still runs.
 *
 * Created on Aug 1, 2005
 * @author cbeust
 */
public class IndividualMethodsTest
{
    private boolean m_setUpCalled = false;
 
    @BeforeMethod
    public void setUp()
    {
        m_setUpCalled = true;
    }
 
    @Test
    public void testMethod()
    {
        // this line causes the test to fail, showing that setUp() hadn't been run
        Assert.assertTrue(m_setUpCalled);
    }
}