本文整理匯總了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);
}