@Override public void run(IConfigureCallBack callBack, ITestResult testResult) { m_hookCount++; Object[] parameters = callBack.getParameters(); if (parameters.length > 0) { m_methodName = ((Method) parameters[0]).getName(); } callBack.runConfigurationMethod(testResult); }
@Override public void run(IConfigureCallBack callBack, ITestResult testResult) { m_hookCount++; Object[] parameters = callBack.getParameters(); if (parameters.length > 0) { m_methodName = ((Method) parameters[0]).getName(); } callBack.runConfigurationMethod(testResult); } }
@Override public void run(IConfigureCallBack callBack, ITestResult testResult) { callBack.runConfigurationMethod(testResult); } }
public class SkipLoginMethodListener implements IConfigurable { private static final String SKIP_GROUP = "loginMethod"; @Override public void run(IConfigureCallBack callBack, ITestResult testResult) { ITestNGMethod method = testResult.getMethod(); if (method.isAfterMethodConfiguration() || method.isBeforeMethodConfiguration()) { for (String group : method.getGroups()) { if (group.equals(SKIP_GROUP)) { System.out.println("skipped " + method.getMethodName()); return; } } } callBack.runConfigurationMethod(testResult); } }
@Override public void run(IConfigureCallBack callBack, ITestResult testResult) { ITestNGMethod testMethod = testResult.getMethod(); System.out.println("Running " + testMethod.getDescription()); callBack.runConfigurationMethod(testResult); if (testMethod.isBeforeMethodConfiguration() || testMethod.isBeforeClassConfiguration() || testMethod.isBeforeTestConfiguration()) { throw new RuntimeException("Induced failure"); } } }