Java 类org.testng.annotations.AfterClass 实例源码

项目:aws-photosharing-example    文件:TokenFacadeTest.java   
@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();
}
项目:openjdk-jdk10    文件:TestVersionedStream.java   
@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);
                }
            });
}
项目:reactive-grpc    文件:RxGrpcPublisherOneToManyVerificationTest.java   
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
项目:reactive-grpc    文件:RxGrpcPublisherManyToOneVerificationTest.java   
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
项目:reactive-grpc    文件:RxGrpcPublisherOneToOneVerificationTest.java   
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
项目:reactive-grpc    文件:RxGrpcPublisherManyToManyVerificationTest.java   
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
项目:reactive-grpc    文件:ReactorGrpcPublisherManyToOneVerificationTest.java   
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
项目:reactive-grpc    文件:ReactorGrpcPublisherOneToOneVerificationTest.java   
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
项目:openjdk-jdk10    文件:ExternalEditorTest.java   
@AfterClass
public static void shutdown() throws IOException {
    executorShutdown();
    if (listener != null) {
        listener.close();
    }
}
项目:openjdk-jdk10    文件:RowSetProviderTests.java   
@AfterClass
public static void tearDownClass() throws Exception {
    if (origFactoryProperty != null) {
        System.setProperty("javax.sql.rowset.RowSetFactory",
                origFactoryProperty);
    }
}
项目:openjdk-jdk10    文件:MultiReleaseJarHttpProperties.java   
@AfterClass
public void close() throws IOException {
    // Windows requires server to stop before file is deleted
    if (server != null)
        server.stop();
    super.close();
}
项目:martini-core    文件:DefaultMixologyTest.java   
@AfterClass
public void tearDownClass() {
    factory = null;
    if (null != context) {
        context.close();
    }
    context = null;
}
项目:jdk8u-jdk    文件:LogGeneratedClassesTest.java   
@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"));
}
项目:morpheus-core    文件:DbTests.java   
@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);
        }
    }
}
项目:jdk8u-jdk    文件:RowSetProviderTests.java   
@AfterClass
public static void tearDownClass() throws Exception {
    if (origFactoryProperty != null) {
        System.setProperty("javax.sql.rowset.RowSetFactory",
                origFactoryProperty);
    }
}
项目:karate    文件:KarateRunner.java   
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception {
    RuntimeOptions ro = runtimeOptions.getRuntimeOptions();
    Formatter formatter = ro.formatter(runtimeOptions.getClassLoader());        
    formatter.done();
    formatter.close();
}
项目:keti    文件:PolicyManagementServiceTest.java   
@AfterClass
public void afterClass() {

    this.zoneRepository.delete(this.defaultZone);
    this.zoneRepository.delete(this.zone1);
    this.zoneRepository.delete(this.zone2);
}
项目:strongbox    文件:DefaultSecretsGroupManagerIntegrationTest.java   
@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);
}
项目:Equella    文件:AbstractTest.java   
@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();
    }
}
项目:hbase-client    文件:BatchIt.java   
/**
 * 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();
}
项目:openjdk-jdk10    文件:LogGeneratedClassesTest.java   
@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"));
}
项目:otter-G    文件:BaseStageTest.java   
@AfterClass
public void destory() {
    ArbitrateFactory.destory(pipelineId);
    // 删除mainStem节点
    String path = pipelinePath + "/" + ArbitrateConstants.NODE_MAINSTEM;

    zookeeper.delete(path);

    pipelineEvent.destory(channelId, pipelineId);
    channelEvent.destory(channelId);
}
项目:aws-photosharing-example    文件:AlbumFacadeTest.java   
@AfterClass
public void cleanUp() throws Exception {

    // Delete User

    _em.getTransaction().begin();
    _em.remove(testUser);
    _em.flush();
    _em.getTransaction().commit();
    _em.close();
}
项目:ExtendNG    文件:OrderByGroupsSpecialCasesTest.java   
@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");
}
项目:ExtendNG    文件:OrderByGroupsTest.java   
@AfterClass
public void finalAssert(){
    SoftAssert softAssert = new SoftAssert();

    softAssert.assertTrue(orderOfExecution.contains("test1 wayToName"), "group 'first' was not grouped");
    softAssert.assertTrue(orderOfExecution.contains("originalName thisOne"), "group 'third' was not grouped");
    softAssert.assertTrue(orderOfExecution.contains("coveredByTests treatThisRight"), "group 'second' was not grouped");

    softAssert.assertAll();
}
项目:jfrog-idea-plugin    文件:NpmScanManagerTests.java   
@AfterClass
public void cleanProject() {
    try {
        Path installationDirectory = Paths.get(getProjectBasePath(project), ".idea");
        if (Files.exists(installationDirectory)) {
            FileUtils.forceDelete(installationDirectory.toFile());
        }
    } catch (IOException e) {
        // Ignore
    }
}
项目:kerberos-connector    文件:KerberosConnectorTests.java   
@AfterClass
public void tearDown() {
    //
    // clean up resources
    //
    if (connectorFacade instanceof LocalConnectorFacadeImpl) {
        ((LocalConnectorFacadeImpl) connectorFacade).dispose();
    }
}
项目:kerberos-connector    文件:KerberosConnectorBadPasswordTests.java   
@AfterClass
public void tearDown() {
    //
    // clean up resources
    //
    if (connectorFacade instanceof LocalConnectorFacadeImpl) {
        ((LocalConnectorFacadeImpl) connectorFacade).dispose();
    }
}
项目:keti    文件:AccessControlServiceIT.java   
@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();
}
项目:Reer    文件:Test2.java   
@AfterClass
public void afterClass() {
    System.out.println("Test2.afterClass()");
}
项目:Reer    文件:Test1.java   
@AfterClass
public void afterClass() {
    System.out.println("Test1.afterClass()");
}
项目:Reer    文件:TestFactory.java   
@AfterClass
public void afterClass() {
    System.out.println("TestFactory[" + data + "].afterClass()");
}
项目:shibboleth-idp-oidc-extension    文件:ReloadClientResolverServiceConfigurationTest.java   
@AfterClass public void teardown() {
    ComponentSupport.destroy(service);
}
项目:shibboleth-idp-oidc-extension    文件:ReloadProviderResolverServiceConfigurationTest.java   
@AfterClass public void teardown() {
    ComponentSupport.destroy(service);
}
项目:incubator-netbeans    文件:PassSkipTest.java   
@AfterClass
public void cleanUp() {
    // code that will be invoked after this test ends
}
项目:gold    文件:OrderByTest.java   
@AfterClass
private void clearMemory() {
    inMemorySchemaRepository.clearForInstanceTesting();
    inMemorySchemaRepository.clearForSchemaTesting();
}
项目:incubator-netbeans    文件:NewTestNGTest.java   
@AfterClass
public void cleanUp() {
}
项目:incubator-netbeans    文件:CleanUpTest.java   
@AfterClass
public void cleanUp() {
    assert false : "some message";
}
项目:openjdk-jdk10    文件:MethodAccessTest.java   
@AfterClass
public static void tearDownClass() {
    e = null;
    o = null;
}
项目:openjdk-jdk10    文件:DriverManagerTests.java   
@AfterClass
public static void tearDownClass() throws Exception {
}