use of org.testng.annotations.AfterMethod in project atlas by apache.
the class AbstractGraphDatabaseTest method removeVertices.
@AfterMethod
public void removeVertices() {
for (AtlasVertex vertex : newVertices) {
if (vertex.exists()) {
getGraph().removeVertex(vertex);
}
}
getGraph().commit();
newVertices.clear();
}
use of org.testng.annotations.AfterMethod in project presto by prestodb.
the class TestResourceGroupPerQueryLimitEnforcement method cancelAllQueriesAfterTest.
@AfterMethod
public void cancelAllQueriesAfterTest() {
DispatchManager dispatchManager = queryRunner.getCoordinator().getDispatchManager();
ImmutableList.copyOf(dispatchManager.getQueries()).forEach(queryInfo -> dispatchManager.cancelQuery(queryInfo.getQueryId()));
}
use of org.testng.annotations.AfterMethod in project presto by prestodb.
the class TestQueryManager method cancelAllQueriesAfterTest.
@AfterMethod
public void cancelAllQueriesAfterTest() {
DispatchManager dispatchManager = queryRunner.getCoordinator().getDispatchManager();
ImmutableList.copyOf(dispatchManager.getQueries()).forEach(queryInfo -> dispatchManager.cancelQuery(queryInfo.getQueryId()));
}
use of org.testng.annotations.AfterMethod in project killbill by killbill.
the class GuicyKillbillTestSuite method afterMethodAlwaysRun.
@AfterMethod(alwaysRun = true)
public void afterMethodAlwaysRun(final Method method, final ITestResult result) throws Exception {
if (hasFailed()) {
return;
}
final String tag;
switch(result.getStatus()) {
case SUCCESS:
tag = "SUCCESS";
break;
case FAILURE:
tag = "!!! FAILURE !!!";
break;
case SKIP:
tag = "SKIP";
break;
case SUCCESS_PERCENTAGE_FAILURE:
tag = "SUCCESS WITHIN PERCENTAGE";
break;
case STARTED:
tag = "STARTED";
break;
case CREATED:
tag = "CREATED";
break;
default:
tag = "UNKNOWN";
break;
}
log.info("***************************************************************************************************");
log.info("*** Ending test {}:{} {} ({} s.)", new Object[] { method.getDeclaringClass().getName(), method.getName(), tag, (result.getEndMillis() - result.getStartMillis()) / 1000 });
log.info("***************************************************************************************************");
if (!hasFailed && !result.isSuccess()) {
// Ignore if the current test method is flaky
final ITestNGMethod testNGMethod = result.getMethod();
final boolean isFlakyTest = testNGMethod != null && testNGMethod.getRetryAnalyzer(result) != null && testNGMethod.getRetryAnalyzer(result) instanceof FlakyRetryAnalyzer;
if (!isFlakyTest) {
hasFailed = true;
}
}
}
use of org.testng.annotations.AfterMethod in project atmosphere by Atmosphere.
the class BroadcasterTest method unSetUp.
@AfterMethod
public void unSetUp() throws Exception {
broadcaster.destroy();
atmosphereHandler.value.set(new HashSet());
config.getBroadcasterFactory().destroy();
ExecutorsFactory.reset(config);
}
Aggregations