当前位置: 首页>>代码示例>>Java>>正文


Java AfterClass类代码示例

本文整理汇总了Java中org.testng.annotations.AfterClass的典型用法代码示例。如果您正苦于以下问题:Java AfterClass类的具体用法?Java AfterClass怎么用?Java AfterClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AfterClass类属于org.testng.annotations包,在下文中一共展示了AfterClass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanUp

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@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();
}
 
开发者ID:awslabs,项目名称:aws-photosharing-example,代码行数:22,代码来源:TokenFacadeTest.java

示例2: cleanProject

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public void cleanProject() {
    try {
        Path installationDirectory = Paths.get(getProjectBasePath(project), ".idea");
        if (Files.exists(installationDirectory)) {
            FileUtils.forceDelete(installationDirectory.toFile());
        }
    } catch (IOException e) {
        // Ignore
    }
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:12,代码来源:NpmScanManagerTests.java

示例3: close

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@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);
                }
            });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:TestVersionedStream.java

示例4: tearDown

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public static void tearDown() throws Exception {
    server.shutdown();
    server.awaitTermination();
    channel.shutdown();

    server = null;
    channel = null;
}
 
开发者ID:salesforce,项目名称:reactive-grpc,代码行数:10,代码来源:RxGrpcPublisherOneToManyVerificationTest.java

示例5: shutdown

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public static void shutdown() throws IOException {
    executorShutdown();
    if (listener != null) {
        listener.close();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ExternalEditorTest.java

示例6: tearDownClass

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public static void tearDownClass() throws Exception {
    if (origFactoryProperty != null) {
        System.setProperty("javax.sql.rowset.RowSetFactory",
                origFactoryProperty);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:RowSetProviderTests.java

示例7: close

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public void close() throws IOException {
    // Windows requires server to stop before file is deleted
    if (server != null)
        server.stop();
    super.close();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:MultiReleaseJarHttpProperties.java

示例8: tearDownClass

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public void tearDownClass() {
	factory = null;
	if (null != context) {
		context.close();
	}
	context = null;
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:9,代码来源:DefaultMixologyTest.java

示例9: cleanup

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@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"));
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:LogGeneratedClassesTest.java

示例10: dispose

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@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);
        }
    }
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:15,代码来源:DbTests.java

示例11: finalize_me

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public void finalize_me()
{
   logger.info ("Removing tmp files.");
   FileUtils.deleteQuietly (tmp);
}
 
开发者ID:SentinelDataHub,项目名称:dhus-core,代码行数:7,代码来源:HierarchicalDirectoryBuilderTest.java

示例12: tearDownClass

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass(alwaysRun = true)
public void tearDownClass() throws Exception {
    RuntimeOptions ro = runtimeOptions.getRuntimeOptions();
    Formatter formatter = ro.formatter(runtimeOptions.getClassLoader());        
    formatter.done();
    formatter.close();
}
 
开发者ID:intuit,项目名称:karate,代码行数:8,代码来源:KarateRunner.java

示例13: afterClass

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public void afterClass() {

    this.zoneRepository.delete(this.defaultZone);
    this.zoneRepository.delete(this.zone1);
    this.zoneRepository.delete(this.zone2);
}
 
开发者ID:eclipse,项目名称:keti,代码行数:8,代码来源:PolicyManagementServiceTest.java

示例14: after

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@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);
}
 
开发者ID:schibsted,项目名称:strongbox,代码行数:14,代码来源:DefaultSecretsGroupManagerIntegrationTest.java

示例15: finishedClass

import org.testng.annotations.AfterClass; //导入依赖的package包/类
@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();
	}
}
 
开发者ID:equella,项目名称:Equella,代码行数:14,代码来源:AbstractTest.java


注:本文中的org.testng.annotations.AfterClass类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。