本文整理汇总了Java中org.testng.IInvokedMethod.getTestMethod方法的典型用法代码示例。如果您正苦于以下问题:Java IInvokedMethod.getTestMethod方法的具体用法?Java IInvokedMethod.getTestMethod怎么用?Java IInvokedMethod.getTestMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.testng.IInvokedMethod
的用法示例。
在下文中一共展示了IInvokedMethod.getTestMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterInvocation
import org.testng.IInvokedMethod; //导入方法依赖的package包/类
@Override
public void afterInvocation(final IInvokedMethod method, final ITestResult testResult,
final ITestContext context) {
final ITestNGMethod testMethod = method.getTestMethod();
if (isSupportedConfigurationFixture(testMethod)) {
final String executableUuid = currentExecutable.get();
currentExecutable.remove();
if (testResult.isSuccess()) {
getLifecycle().updateFixture(executableUuid, result -> result.withStatus(Status.PASSED));
} else {
getLifecycle().updateFixture(executableUuid, result -> result
.withStatus(getStatus(testResult.getThrowable()))
.withStatusDetails(getStatusDetails(testResult.getThrowable()).orElse(null)));
}
getLifecycle().stopFixture(executableUuid);
if (testMethod.isBeforeMethodConfiguration() || testMethod.isAfterMethodConfiguration()) {
final String containerUuid = currentTestContainer.get();
validateContainerExists(getQualifiedName(testMethod), containerUuid);
currentTestContainer.remove();
getLifecycle().stopTestContainer(containerUuid);
getLifecycle().writeTestContainer(containerUuid);
}
}
}
示例2: beforeInvocation
import org.testng.IInvokedMethod; //导入方法依赖的package包/类
@Override
public void beforeInvocation(final IInvokedMethod method, final ITestResult testResult,
final ITestContext context) {
final ITestNGMethod testMethod = method.getTestMethod();
if (isSupportedConfigurationFixture(testMethod)) {
ifSuiteFixtureStarted(context.getSuite(), testMethod);
ifTestFixtureStarted(context, testMethod);
ifClassFixtureStarted(testMethod);
ifMethodFixtureStarted(testMethod);
}
}
示例3: logInvocation
import org.testng.IInvokedMethod; //导入方法依赖的package包/类
protected static void logInvocation(final TestStatus testStatus, final IInvokedMethod method) {
ITestNGMethod iTestNGMethod = method.getTestMethod();
String methodName = iTestNGMethod.getTestClass().getName() + '#' + iTestNGMethod.getMethodName();
String methodType = "test";
if (method.isConfigurationMethod()) {
methodType = "configuration";
}
LOGGER.info("{} {} {} method: {}", (testStatus == TestStatus.ERRORED_OUT ? "!!!" : "==="), testStatus,
methodType, methodName);
}