本文整理汇总了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();
}
示例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
}
}
示例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);
}
});
}
示例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;
}
示例5: shutdown
import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public static void shutdown() throws IOException {
executorShutdown();
if (listener != null) {
listener.close();
}
}
示例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);
}
}
示例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();
}
示例8: tearDownClass
import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public void tearDownClass() {
factory = null;
if (null != context) {
context.close();
}
context = null;
}
示例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"));
}
示例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);
}
}
}
示例11: finalize_me
import org.testng.annotations.AfterClass; //导入依赖的package包/类
@AfterClass
public void finalize_me()
{
logger.info ("Removing tmp files.");
FileUtils.deleteQuietly (tmp);
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
}