本文整理汇总了Java中org.testng.ITestNGMethod.isAfterMethodConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java ITestNGMethod.isAfterMethodConfiguration方法的具体用法?Java ITestNGMethod.isAfterMethodConfiguration怎么用?Java ITestNGMethod.isAfterMethodConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.testng.ITestNGMethod
的用法示例。
在下文中一共展示了ITestNGMethod.isAfterMethodConfiguration方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ifMethodFixtureStarted
import org.testng.ITestNGMethod; //导入方法依赖的package包/类
private void ifMethodFixtureStarted(final ITestNGMethod testMethod) {
currentTestContainer.remove();
Current current = currentTestResult.get();
final FixtureResult fixture = getFixtureResult(testMethod);
final String uuid = currentExecutable.get();
if (testMethod.isBeforeMethodConfiguration()) {
if (current.isStarted()) {
currentTestResult.remove();
current = currentTestResult.get();
}
getLifecycle().startPrepareFixture(createFakeContainer(testMethod, current), uuid, fixture);
}
if (testMethod.isAfterMethodConfiguration()) {
getLifecycle().startTearDownFixture(createFakeContainer(testMethod, current), uuid, fixture);
}
}
示例2: afterInvocation
import org.testng.ITestNGMethod; //导入方法依赖的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);
}
}
}
示例3: isSupportedConfigurationFixture
import org.testng.ITestNGMethod; //导入方法依赖的package包/类
@SuppressWarnings("BooleanExpressionComplexity")
private boolean isSupportedConfigurationFixture(final ITestNGMethod testMethod) {
return testMethod.isBeforeMethodConfiguration() || testMethod.isAfterMethodConfiguration()
|| testMethod.isBeforeTestConfiguration() || testMethod.isAfterTestConfiguration()
|| testMethod.isBeforeClassConfiguration() || testMethod.isAfterClassConfiguration()
|| testMethod.isBeforeSuiteConfiguration() || testMethod.isAfterSuiteConfiguration();
}
示例4: onConfigurationFailure
import org.testng.ITestNGMethod; //导入方法依赖的package包/类
public synchronized void onConfigurationFailure(ITestResult result) {
ITestNGMethod method = result.getMethod();
if (method.isAfterMethodConfiguration()
&& parallelMode.equals("classes")) {
quitWebDriver();
}
log.info(LoggerUtil.testFormat() + "(FAIL) -> Config Name : {} ",
result.getMethod().getMethodName());
}
示例5: onConfigurationSkip
import org.testng.ITestNGMethod; //导入方法依赖的package包/类
public synchronized void onConfigurationSkip(ITestResult result) {
ITestNGMethod method = result.getMethod();
if (method.isAfterMethodConfiguration()
&& parallelMode.equals("classes")) {
quitWebDriver();
}
log.info(LoggerUtil.testFormat() + "(SKIPPED) -> Config Name : {} ",
result.getMethod().getMethodName());
}
示例6: onConfigurationSuccess
import org.testng.ITestNGMethod; //导入方法依赖的package包/类
public synchronized void onConfigurationSuccess(ITestResult result) {
ITestNGMethod method = result.getMethod();
if (method.isAfterMethodConfiguration()
&& parallelMode.equals("classes")) {
quitWebDriver();
}
log.info(LoggerUtil.testFormat() + "(SUCCESS) -> Config Name : {} ",
result.getMethod().getMethodName());
}