org.testng.annotations.AfterMethod Java Examples

The following examples show how to use org.testng.annotations.AfterMethod. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnnotationConfigTransactionalTestNGSpringContextTests.java    From java-technology-stack with MIT License 6 votes vote down vote up
@AfterMethod
void tearDown() throws Exception {
	numTearDownCalls++;
	if (inTransaction()) {
		numTearDownCallsInTransaction++;
	}
	assertNumRowsInPersonTable((inTransaction() ? 4 : 1), "after a test method");
}
 
Example #2
Source File: ConcreteTransactionalTestNGSpringContextTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@AfterMethod
void tearDown() {
	numTearDownCalls++;
	if (inTransaction()) {
		numTearDownCallsInTransaction++;
	}
	assertNumRowsInPersonTable((inTransaction() ? 4 : 1), "after a test method");
}
 
Example #3
Source File: TestBucketBalancer.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void teardown()
{
    if (dummyHandle != null) {
        dummyHandle.close();
    }
}
 
Example #4
Source File: TestCompletedEventWarnings.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void tearDown()
{
    queryRunner.close();
    queryRunner = null;
    generatedEvents = null;
}
 
Example #5
Source File: TestHarness.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@AfterMethod
public void printError(ITestResult result) {
    if (result.getStatus() == ITestResult.FAILURE) {
        String clsName = result.getTestClass().getName();
        clsName = clsName.substring(clsName.lastIndexOf(".") + 1);
        System.out.println("Test " + clsName + "." +
                           result.getName() + " FAILED");
    }
}
 
Example #6
Source File: SendIntegrationTestCase.java    From micro-integrator with Apache License 2.0 5 votes vote down vote up
@AfterMethod(groups = "wso2.esb")
public void startServersA() throws InterruptedException, IOException {
    if (!axis2Server1.isStarted()) {
        axis2Server1.start();
    }
    if (!axis2Server2.isStarted()) {
        axis2Server2.start();
    }
    if (!axis2Server3.isStarted()) {
        axis2Server3.start();
    }
    Thread.sleep(1000);
}
 
Example #7
Source File: TestMergeOperator.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void tearDown()
{
    serdeFactory = null;
    orderingCompiler = null;

    httpClient.close();
    httpClient = null;

    executor.shutdownNow();
    executor = null;

    exchangeClientFactory.stop();
    exchangeClientFactory = null;
}
 
Example #8
Source File: JavacTemplateTestBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@AfterMethod
public void copyErrors(ITestResult result) {
    if (!result.isSuccess()) {
        suiteErrors.addAll(diags.errorKeys());

        List<Object> list = new ArrayList<>();
        Collections.addAll(list, result.getParameters());
        list.add("Test case: " + getTestCaseDescription());
        for (Pair<String, Template> e : sourceFiles)
            list.add("Source file " + e.fst + ": " + e.snd);
        if (diags.errorsFound())
            list.add("Compile diagnostics: " + diags.toString());
        result.setParameters(list.toArray(new Object[list.size()]));
    }
}
 
Example #9
Source File: TestWindowOperator.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void tearDown()
{
    executor.shutdownNow();
    scheduledExecutor.shutdownNow();
    spillerFactory = null;
}
 
Example #10
Source File: TestBinaryFileSpiller.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void tearDown()
        throws Exception
{
    singleStreamSpillerFactory.destroy();
    deleteRecursively(spillPath.toPath(), ALLOW_INSECURE);
}
 
Example #11
Source File: TestRaptorSplitManager.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void teardown()
        throws IOException
{
    dummyHandle.close();
    deleteRecursively(temporary.toPath(), ALLOW_INSECURE);
}
 
Example #12
Source File: TestJdbcWarnings.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void teardown()
{
    closeQuietly(statement);
    closeQuietly(connection);
    executor.shutdownNow();
}
 
Example #13
Source File: GroupMetadataManagerTest.java    From kop with Apache License 2.0 5 votes vote down vote up
@AfterMethod
@Override
public void cleanup() throws Exception {
    if (groupMetadataManager != null) {
        groupMetadataManager.shutdown();
    }
    scheduler.shutdown();
    super.internalCleanup();
}
 
Example #14
Source File: AnnotationConfigTransactionalTestNGSpringContextTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@AfterMethod
void tearDown() throws Exception {
	numTearDownCalls++;
	if (inTransaction()) {
		numTearDownCallsInTransaction++;
	}
	assertNumRowsInPersonTable((inTransaction() ? 4 : 1), "after a test method");
}
 
Example #15
Source File: TestShardCleaner.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void teardown()
        throws IOException
{
    if (dummyHandle != null) {
        dummyHandle.close();
    }
    deleteRecursively(temporary.toPath(), ALLOW_INSECURE);
}
 
Example #16
Source File: TestDatabaseShardManager.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void teardown()
        throws IOException
{
    dummyHandle.close();
    deleteRecursively(dataDir.toPath(), ALLOW_INSECURE);
}
 
Example #17
Source File: TestShardCompactor.java    From presto with Apache License 2.0 5 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void tearDown()
        throws Exception
{
    if (dummyHandle != null) {
        dummyHandle.close();
    }
    deleteRecursively(temporary.toPath(), ALLOW_INSECURE);
}
 
Example #18
Source File: LoggingTestCase.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@AfterMethod
public void after(ITestResult result) {
    if (!result.isSuccess()) {
        List<Object> list = new ArrayList<>();
        Collections.addAll(list, result.getParameters());
        list.add(context.toString());
        result.setParameters(list.toArray(new Object[list.size()]));
    }
}
 
Example #19
Source File: ComponentsCountNGTest.java    From constellation with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void tearDownMethod() throws Exception {
    graph = null;
}
 
Example #20
Source File: TestExpressionCompiler.java    From presto with Apache License 2.0 4 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void tearDown(Method method)
{
    assertTrue(Futures.allAsList(futures).isDone(), "Expression test futures are not complete");
    log.info("FINISHED %s in %s verified %s expressions", method.getName(), Duration.nanosSince(start), futures.size());
}
 
Example #21
Source File: TestMetadataDao.java    From presto with Apache License 2.0 4 votes vote down vote up
@AfterMethod(alwaysRun = true)
public void tearDown()
{
    dummyHandle.close();
}
 
Example #22
Source File: JaccardIndexPluginNGTest.java    From constellation with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void tearDownMethod() throws Exception {
    graph = null;
}
 
Example #23
Source File: SubgraphUtilitiesNGTest.java    From constellation with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void tearDownMethod() throws Exception {
}
 
Example #24
Source File: MultiContextPropagationTest.java    From smallrye-mutiny with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void clearContext() {
    Infrastructure.clearInterceptors();
    MyContext.clear();
}
 
Example #25
Source File: KafkaApisTest.java    From kop with Apache License 2.0 4 votes vote down vote up
@AfterMethod
@Override
protected void cleanup() throws Exception {
    super.internalCleanup();
}
 
Example #26
Source File: WebServerNGTest.java    From constellation with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void tearDownMethod() throws Exception {
}
 
Example #27
Source File: CommonNeighboursPluginNGTest.java    From constellation with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void tearDownMethod() throws Exception {
    graph = null;
}
 
Example #28
Source File: TestHarness.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@AfterMethod
public void reset() {
    if (!this.verbose) {
        verboseLocal.set(Boolean.FALSE);
    }
}
 
Example #29
Source File: SchemaVertexTypeNGTest.java    From constellation with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void tearDownMethod() throws Exception {
}
 
Example #30
Source File: WeightActionNGTest.java    From constellation with Apache License 2.0 4 votes vote down vote up
@AfterMethod
public void tearDownMethod() throws Exception {
    graph = null;
}