Search in sources :

Example 21 with AfterMethod

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();
}
Also used : AtlasVertex(org.apache.atlas.repository.graphdb.AtlasVertex) AfterMethod(org.testng.annotations.AfterMethod)

Example 22 with AfterMethod

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()));
}
Also used : DispatchManager(com.facebook.presto.dispatcher.DispatchManager) AfterMethod(org.testng.annotations.AfterMethod)

Example 23 with AfterMethod

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()));
}
Also used : DispatchManager(com.facebook.presto.dispatcher.DispatchManager) AfterMethod(org.testng.annotations.AfterMethod)

Example 24 with AfterMethod

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;
        }
    }
}
Also used : FlakyRetryAnalyzer(org.killbill.billing.api.FlakyRetryAnalyzer) ITestNGMethod(org.testng.ITestNGMethod) AfterMethod(org.testng.annotations.AfterMethod)

Example 25 with AfterMethod

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);
}
Also used : HashSet(java.util.HashSet) AfterMethod(org.testng.annotations.AfterMethod)

Aggregations

AfterMethod (org.testng.annotations.AfterMethod)74 File (java.io.File)16 MifosPage (org.mifos.test.acceptance.framework.MifosPage)10 DateTimeUpdaterRemoteTestingService (org.mifos.test.acceptance.remote.DateTimeUpdaterRemoteTestingService)8 ProtocolStack (org.jgroups.stack.ProtocolStack)6 IOException (java.io.IOException)5 HashSet (java.util.HashSet)4 AtlasVertex (org.apache.atlas.repository.graphdb.AtlasVertex)4 Connection (java.sql.Connection)3 SQLException (java.sql.SQLException)3 MockParticipantManager (org.apache.helix.integration.manager.MockParticipantManager)3 JdbcSession (com.evolveum.midpoint.repo.sqlbase.JdbcSession)2 DispatchManager (com.facebook.presto.dispatcher.DispatchManager)2 OServerAdmin (com.orientechnologies.orient.client.remote.OServerAdmin)2 OStorageProxy (com.orientechnologies.orient.core.storage.OStorageProxy)2 RandomAccessFile (java.io.RandomAccessFile)2 Date (java.util.Date)2 ExecutorService (java.util.concurrent.ExecutorService)2 DeleteIndexRequest (org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest)2 Parameters (org.testng.annotations.Parameters)2