Home | History | Annotate | Download | only in hook
      1 package test.hook;
      2 
      3 import org.testng.IConfigurable;
      4 import org.testng.IConfigureCallBack;
      5 import org.testng.ITestResult;
      6 import org.testng.annotations.Test;
      7 
      8 import java.lang.reflect.Method;
      9 
     10 
     11 /**
     12  * Test harness for {@link IConfigurable}
     13  */
     14 public class ConfigurableSuccessTest extends BaseConfigurable {
     15   @Override
     16   public void run(IConfigureCallBack callBack, ITestResult testResult) {
     17     m_hookCount++;
     18     Object[] parameters = callBack.getParameters();
     19     if (parameters.length > 0) {
     20       m_methodName = ((Method) parameters[0]).getName();
     21     }
     22     callBack.runConfigurationMethod(testResult);
     23   }
     24 
     25   @Test
     26   public void hookWasRun() {
     27 //    Assert.assertEquals(m_hookCount, 2);
     28 //    Assert.assertTrue(m_bc);
     29 //    Assert.assertTrue(m_bm);
     30   }
     31 }
     32