Java Code Examples for org.testng.annotations.AfterClass

The following are top voted examples for showing how to use org.testng.annotations.AfterClass. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: aws-photosharing-example   File: TokenFacadeTest.java   View source code 6 votes vote down vote up
@AfterClass
public void cleanUp() {

    Query query = _em.createQuery("select t from Token t where t.userName='testToken'");
    testToken = (Token)query.getSingleResult();

    query = _em.createQuery("select t from Token t where t.userName='" + USER_NAME + "'");
    token = (Token)query.getSingleResult();

    _em.getTransaction().begin();
    _em.remove(token);
    _em.remove(testToken);
    _em.getTransaction().commit();

    query = _em.createQuery("select t from Token t where t.id='" + valToken.getId() + "'");
    valToken = (Token)query.getSingleResult();

    _em.getTransaction().begin();
    _em.remove(valToken);
    _em.getTransaction().commit();
}
 
Example 2
Project: openjdk-jdk10   File: TestVersionedStream.java   View source code 6 votes vote down vote up
@AfterClass
public void close() throws IOException {
    Files.walk(userdir, 1)
            .filter(p -> !p.equals(userdir))
            .forEach(p -> {
                try {
                    if (Files.isDirectory(p)) {
                        FileUtils.deleteFileTreeWithRetry(p);
                    } else {
                        FileUtils.deleteFileIfExistsWithRetry(p);
                    }
                } catch (IOException x) {
                    throw new UncheckedIOException(x);
                }
            });
}
 
Example 3
Project: reactive-grpc   File: RxGrpcPublisherOneToManyVerificationTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
 
Example 4
Project: reactive-grpc   File: RxGrpcPublisherManyToOneVerificationTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
 
Example 5
Project: reactive-grpc   File: RxGrpcPublisherOneToOneVerificationTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
 
Example 6
Project: reactive-grpc   File: RxGrpcPublisherManyToManyVerificationTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
 
Example 7
Project: reactive-grpc   File: ReactorGrpcPublisherManyToOneVerificationTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
 
Example 8
Project: reactive-grpc   File: ReactorGrpcPublisherOneToOneVerificationTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
 
Example 9
Project: openjdk-jdk10   File: ExternalEditorTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void shutdown() throws IOException {
    executorShutdown();
    if (listener != null) {
        listener.close();
    }
}
 
Example 10
Project: openjdk-jdk10   File: RowSetProviderTests.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDownClass() throws Exception {
    if (origFactoryProperty != null) {
        System.setProperty("javax.sql.rowset.RowSetFactory",
                origFactoryProperty);
    }
}
 
Example 11
Project: openjdk-jdk10   File: MultiReleaseJarHttpProperties.java   View source code 5 votes vote down vote up
@AfterClass
public void close() throws IOException {
    // Windows requires server to stop before file is deleted
    if (server != null)
        server.stop();
    super.close();
}
 
Example 12
Project: martini-core   File: DefaultMixologyTest.java   View source code 5 votes vote down vote up
@AfterClass
public void tearDownClass() {
	factory = null;
	if (null != context) {
		context.close();
	}
	context = null;
}
 
Example 13
Project: jdk8u-jdk   File: LogGeneratedClassesTest.java   View source code 5 votes vote down vote up
@AfterClass
public void cleanup() throws IOException {
    Files.delete(Paths.get("TestLambda.java"));
    Files.delete(Paths.get("LongPackageName.java"));
    Files.delete(Paths.get("file"));
    TestUtil.removeAll(Paths.get("com"));
    TestUtil.removeAll(Paths.get("dump"));
    TestUtil.removeAll(Paths.get("dumpLong"));
}
 
Example 14
Project: morpheus-core   File: DbTests.java   View source code 5 votes vote down vote up
@AfterClass
public void dispose() {
    for (String key : dataSourceMap.keySet()) {
        try {
            final DataSource source = dataSourceMap.get(key);
            try (final Connection conn = source.getConnection()) {
                final Statement stmt = conn.createStatement();
                stmt.execute("shutdown");
            }
        } catch (Throwable t) {
            System.out.println("Failed to dispose connection for " + key);
        }
    }
}
 
Example 15
Project: jdk8u-jdk   File: RowSetProviderTests.java   View source code 5 votes vote down vote up
@AfterClass
public static void tearDownClass() throws Exception {
    if (origFactoryProperty != null) {
        System.setProperty("javax.sql.rowset.RowSetFactory",
                origFactoryProperty);
    }
}
 
Example 16
Project: karate   File: KarateRunner.java   View source code 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception {
    RuntimeOptions ro = runtimeOptions.getRuntimeOptions();
    Formatter formatter = ro.formatter(runtimeOptions.getClassLoader());        
    formatter.done();
    formatter.close();
}
 
Example 17
Project: keti   File: PolicyManagementServiceTest.java   View source code 5 votes vote down vote up
@AfterClass
public void afterClass() {

    this.zoneRepository.delete(this.defaultZone);
    this.zoneRepository.delete(this.zone1);
    this.zoneRepository.delete(this.zone2);
}
 
Example 18
Project: strongbox   File: DefaultSecretsGroupManagerIntegrationTest.java   View source code 5 votes vote down vote up
@AfterClass
public static void after() {
    tearDownSecrets();
    detachAdmin(secretsGroupManager, adminContext.principal);
    detachReadonly(secretsGroupManager, readOnlyContext.principal);
    IntegrationTestHelper.cleanupGroup(secretsGroupManager, identifier);
    readOnlyContext.teardown();
    adminContext.teardown();
    otherContext.teardown();

    // Also cleanup anything left over from a previous test run that was not deleted properly.
    IntegrationTestHelper.cleanUpFromPreviousRuns(Regions.fromName(TEST_REGION.getName()), GROUP_PREFIX);
}
 
Example 19
Project: Equella   File: AbstractTest.java   View source code 5 votes vote down vote up
@AfterClass(alwaysRun = true)
public void finishedClass(ITestContext testContext) throws Exception
{
	if( context == null )
	{
		return;
	}
	String delValue = testConfig.getProperty("test.deleteitems");
	if( delValue == null || Boolean.parseBoolean(delValue) )
	{
		cleanupAfterClass();
	}
}
 
Example 20
Project: hbase-client   File: BatchIt.java   View source code 5 votes vote down vote up
/**
 * Tear down test
 * @throws Exception
 */
@AfterClass
public void tearDown() throws Exception {
    System.out.println("Close HBase test table");
    admin.disableTable(tableName);
    admin.deleteTable(tableName);
    testTable.close();
}
 
Example 21
Project: openjdk-jdk10   File: LogGeneratedClassesTest.java   View source code 5 votes vote down vote up
@AfterClass
public void cleanup() throws IOException {
    Files.delete(Paths.get("TestLambda.java"));
    Files.delete(Paths.get("LongPackageName.java"));
    Files.delete(Paths.get("file"));
    TestUtil.removeAll(Paths.get("com"));
    TestUtil.removeAll(Paths.get("dump"));
    TestUtil.removeAll(Paths.get("dumpLong"));
}
 
Example 22
Project: otter-G   File: BaseStageTest.java   View source code 5 votes vote down vote up
@AfterClass
public void destory() {
    ArbitrateFactory.destory(pipelineId);
    // 删除mainStem节点
    String path = pipelinePath + "/" + ArbitrateConstants.NODE_MAINSTEM;

    zookeeper.delete(path);

    pipelineEvent.destory(channelId, pipelineId);
    channelEvent.destory(channelId);
}
 
Example 23
Project: aws-photosharing-example   File: AlbumFacadeTest.java   View source code 5 votes vote down vote up
@AfterClass
public void cleanUp() throws Exception {

    // Delete User

    _em.getTransaction().begin();
    _em.remove(testUser);
    _em.flush();
    _em.getTransaction().commit();
    _em.close();
}
 
Example 24
Project: ExtendNG   File: OrderByGroupsSpecialCasesTest.java   View source code 5 votes vote down vote up
@AfterClass
public void actualTest(ITestContext result){
    long testsRunInClass = Stream.of(result.getAllTestMethods())
            .filter(iTestNGMethod -> iTestNGMethod.getTestClass().getRealClass().equals(OrderByGroupsSpecialCasesTest.class))
            .count();
    Assert.assertEquals(testsRunInClass, 2L, "intended tests were'nt run");
}
 
Example 25
Project: jfrog-idea-plugin   File: NpmScanManagerTests.java   View source code 5 votes vote down vote up
@AfterClass
public void cleanProject() {
    try {
        Path installationDirectory = Paths.get(getProjectBasePath(project), ".idea");
        if (Files.exists(installationDirectory)) {
            FileUtils.forceDelete(installationDirectory.toFile());
        }
    } catch (IOException e) {
        // Ignore
    }
}
 
Example 26
Project: kerberos-connector   File: KerberosConnectorTests.java   View source code 5 votes vote down vote up
@AfterClass
public void tearDown() {
	//
	// clean up resources
	//
	if (connectorFacade instanceof LocalConnectorFacadeImpl) {
		((LocalConnectorFacadeImpl) connectorFacade).dispose();
	}
}
 
Example 27
Project: kerberos-connector   File: KerberosConnectorBadPasswordTests.java   View source code 5 votes vote down vote up
@AfterClass
public void tearDown() {
	//
	// clean up resources
	//
	if (connectorFacade instanceof LocalConnectorFacadeImpl) {
		((LocalConnectorFacadeImpl) connectorFacade).dispose();
	}
}
 
Example 28
Project: keti   File: AccessControlServiceIT.java   View source code 5 votes vote down vote up
@AfterClass
public void cleanup() throws Exception {
    this.privilegeHelper.deleteResources(this.acsitSetUpFactory.getAcsZoneAdminRestTemplate(),
            this.acsitSetUpFactory.getAcsUrl(), this.acsitSetUpFactory.getZone1Headers());
    this.privilegeHelper.deleteSubjects(this.acsitSetUpFactory.getAcsZoneAdminRestTemplate(),
            this.acsitSetUpFactory.getAcsUrl(), this.acsitSetUpFactory.getZone1Headers());
    this.policyHelper.deletePolicySets(this.acsitSetUpFactory.getAcsZoneAdminRestTemplate(),
            this.acsitSetUpFactory.getAcsUrl(), this.acsitSetUpFactory.getZone1Headers());
    this.acsitSetUpFactory.destroy();
}
 
Example 29
Project: Reer   File: Test2.java   View source code 4 votes vote down vote up
@AfterClass
public void afterClass() {
    System.out.println("Test2.afterClass()");
}
 
Example 30
Project: Reer   File: Test1.java   View source code 4 votes vote down vote up
@AfterClass
public void afterClass() {
    System.out.println("Test1.afterClass()");
}
 
Example 31
Project: Reer   File: TestFactory.java   View source code 4 votes vote down vote up
@AfterClass
public void afterClass() {
    System.out.println("TestFactory[" + data + "].afterClass()");
}
 
Example 32
Project: shibboleth-idp-oidc-extension   File: ReloadClientResolverServiceConfigurationTest.java   View source code 4 votes vote down vote up
@AfterClass public void teardown() {
    ComponentSupport.destroy(service);
}
 
Example 33
Project: shibboleth-idp-oidc-extension   File: ReloadProviderResolverServiceConfigurationTest.java   View source code 4 votes vote down vote up
@AfterClass public void teardown() {
    ComponentSupport.destroy(service);
}
 
Example 34
Project: incubator-netbeans   File: PassSkipTest.java   View source code 4 votes vote down vote up
@AfterClass
public void cleanUp() {
    // code that will be invoked after this test ends
}
 
Example 35
Project: gold   File: OrderByTest.java   View source code 4 votes vote down vote up
@AfterClass
private void clearMemory() {
    inMemorySchemaRepository.clearForInstanceTesting();
    inMemorySchemaRepository.clearForSchemaTesting();
}
 
Example 36
Project: incubator-netbeans   File: NewTestNGTest.java   View source code 4 votes vote down vote up
@AfterClass
public void cleanUp() {
}
 
Example 37
Project: incubator-netbeans   File: CleanUpTest.java   View source code 4 votes vote down vote up
@AfterClass
public void cleanUp() {
    assert false : "some message";
}
 
Example 38
Project: openjdk-jdk10   File: MethodAccessTest.java   View source code 4 votes vote down vote up
@AfterClass
public static void tearDownClass() {
    e = null;
    o = null;
}
 
Example 39
Project: openjdk-jdk10   File: DriverManagerTests.java   View source code 4 votes vote down vote up
@AfterClass
public static void tearDownClass() throws Exception {
}
 
Example 40
Project: gold   File: MemberFieldNameValidationTest.java   View source code 4 votes vote down vote up
@AfterClass
void clearSchemaRepo() {
    inMemorySchemaRepository.clearForSchemaTesting();
}