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