當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。