本文整理汇总了Java中org.testng.IHookCallBack.runTestMethod方法的典型用法代码示例。如果您正苦于以下问题:Java IHookCallBack.runTestMethod方法的具体用法?Java IHookCallBack.runTestMethod怎么用?Java IHookCallBack.runTestMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.testng.IHookCallBack
的用法示例。
在下文中一共展示了IHookCallBack.runTestMethod方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.testng.IHookCallBack; //导入方法依赖的package包/类
/**
* Delegates to the {@link IHookCallBack#runTestMethod(ITestResult) test
* method} in the supplied {@code callback} to execute the actual test
* and then tracks the exception thrown during test execution, if any.
*
* @see org.testng.IHookable#run(org.testng.IHookCallBack,
* org.testng.ITestResult)
*/
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {
callBack.runTestMethod(testResult);
Throwable testResultException = testResult.getThrowable();
if (testResultException instanceof InvocationTargetException) {
testResultException = ((InvocationTargetException) testResultException).getCause();
}
this.testException = testResultException;
}
示例2: run
import org.testng.IHookCallBack; //导入方法依赖的package包/类
/**
* 测试方法拦截器、所有测试方法在执行开始、执行中、执行完成都会在此方法中完成
* @param callBack
* @param testResult
*/
@Override
public void run(IHookCallBack callBack, ITestResult testResult) {
// 如果测试方法上有@Ignore注解,则跳过测试框架直接执行测试方法
if (isIgnoreAnnotation(getTestMethod(testResult))) {
callBack.runTestMethod(testResult);
}
}
示例3: run
import org.testng.IHookCallBack; //导入方法依赖的package包/类
/**
* Delegates to the {@link IHookCallBack#runTestMethod(ITestResult) test
* method} in the supplied {@code callback} to execute the actual test
* and then tracks the exception thrown during test execution, if any.
*
* @see org.testng.IHookable#run(org.testng.IHookCallBack,
* org.testng.ITestResult)
*/
public void run(IHookCallBack callBack, ITestResult testResult) {
callBack.runTestMethod(testResult);
Throwable testResultException = testResult.getThrowable();
if (testResultException instanceof InvocationTargetException) {
testResultException = ((InvocationTargetException) testResultException).getCause();
}
this.testException = testResultException;
}
示例4: run
import org.testng.IHookCallBack; //导入方法依赖的package包/类
@Override
public void run(final IHookCallBack callBack,
final ITestResult testResult) {
try {
injectTestResult(testResult);
} catch (final ReflectiveOperationException roe) {
testResult.setThrowable(roe);
return;
}
callBack.runTestMethod(testResult);
}
示例5: run
import org.testng.IHookCallBack; //导入方法依赖的package包/类
@Override
public void run(IHookCallBack callback, ITestResult res) {
System.out.println("Starting " + res.getName());
callback.runTestMethod(res);
if (res.getThrowable() != null) {
res.setThrowable(null);
System.out.println("Second attempt " + res.getName());
callback.runTestMethod(res);
}
}
示例6: run
import org.testng.IHookCallBack; //导入方法依赖的package包/类
@Override
public void run(IHookCallBack iHookCallBack, ITestResult iTestResult) {
iHookCallBack.runTestMethod(iTestResult);
this.tearDownStack.runTearDown();
}