下面列出了怎么用org.junit.AfterClass的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Close OzoneClient and shutdown MiniOzoneCluster.
*/
@AfterClass
public static void shutdown() throws IOException {
if(ozClient != null) {
ozClient.close();
}
if (storageContainerLocationClient != null) {
storageContainerLocationClient.close();
}
if (cluster != null) {
cluster.shutdown();
}
if (miniKMS != null) {
miniKMS.stop();
}
}
@AfterClass
public static void teardown() throws Exception {
if (zkServer != null) {
zkServer.stop();
zkServer = null;
}
}
@AfterClass
public static void tearDown() throws InterpreterException {
if (null != pythonInterpreterForCancel) {
pythonInterpreterForCancel.close();
}
if (null != pythonInterpreterForClose) {
pythonInterpreterForClose.close();
}
}
/**
* close resource.
*/
@AfterClass
public static void close() {
if (client != null) {
client.close();
}
}
@AfterClass
public static void shutdown() throws InterruptedException, ExecutionException, TimeoutException {
final CompletableFuture<Void> rpcTerminationFuture = akkaRpcService.stopService();
final CompletableFuture<Terminated> actorSystemTerminationFuture = FutureUtils.toJava(actorSystem.terminate());
FutureUtils
.waitForAll(Arrays.asList(rpcTerminationFuture, actorSystemTerminationFuture))
.get(TIMEOUT.toMilliseconds(), TimeUnit.MILLISECONDS);
actorSystem = null;
akkaRpcService = null;
}
@AfterClass
public static void shutdown() throws InterruptedException, ExecutionException, TimeoutException {
final CompletableFuture<Void> rpcTerminationFuture = akkaRpcService.stopService();
final CompletableFuture<Terminated> actorSystemTerminationFuture = FutureUtils.toJava(actorSystem.terminate());
FutureUtils
.waitForAll(Arrays.asList(rpcTerminationFuture, actorSystemTerminationFuture))
.get(timeout.toMilliseconds(), TimeUnit.MILLISECONDS);
}
@AfterClass
public static void afterClass() {
if (context != null) {
context.close();
context = null;
}
}
@AfterClass
public static void destroyHDFS() {
if (hdfsCluster != null) {
hdfsCluster.shutdown();
hdfsCluster = null;
}
}
@AfterClass
public static void tearDown() throws Exception {
fisrtServer.stop();
secondServer.stop();
if (zkService != null) {
zkService.releaseRegistry();
}
TestProjectPropertyUtils.recoverUserDir();
}
@AfterClass
public static void clear() {
isShutdown = true;
if (!shardingDataSources.isEmpty()) {
for (ShardingDataSource each : shardingDataSources.values()) {
each.close();
}
}
}
@AfterClass
public static void cleanUp() {
List<com.amazonaws.services.glue.model.Table> table_to_delete = new ArrayList<>();
String token = null;
do {
GetTablesResult result = glueClient.getTables(new GetTablesRequest().withDatabaseName(
catalogDB.getName()).withNextToken(token));
table_to_delete.addAll(result.getTableList());
token = result.getNextToken();
} while(token != null);
for(com.amazonaws.services.glue.model.Table table : table_to_delete) {
glueClient.deleteTable(new DeleteTableRequest().withDatabaseName(catalogDB.getName()).withName(table.getName()));
}
glueClient.deleteDatabase(new DeleteDatabaseRequest().withName(catalogDB.getName()));
}
@AfterClass
public static void tearDown() throws Exception {
if (NIO_GROUP != null) {
// note: no "quiet period" to not trigger Netty#4357
NIO_GROUP.shutdownGracefully(0, 10, TimeUnit.SECONDS);
}
}
@AfterClass
static public void after() {
Grib.setDebugFlags(new DebugFlagsImpl());
Formatter out = new Formatter(System.out);
FileCacheIF cache = GribCdmIndex.gribCollectionCache;
if (show && cache != null) {
cache.showTracking(out);
cache.showCache(out);
cache.clearCache(false);
}
FileCacheIF rafCache = RandomAccessFile.getGlobalFileCache();
if (show && rafCache != null) {
rafCache.showCache(out);
}
System.out.printf(" countGC=%7d%n", GribCollectionImmutable.countGC);
System.out.printf(" countPC=%7d%n", PartitionCollectionImmutable.countPC);
System.out.printf(" countDataAccess=%7d%n", GribIosp.debugIndexOnlyCount);
System.out.printf(" total files needed=%7d%n",
GribCollectionImmutable.countGC + PartitionCollectionImmutable.countPC + GribIosp.debugIndexOnlyCount);
FileCache.shutdown();
RandomAccessFile.setGlobalFileCache(null);
TestDir.checkLeaks();
RandomAccessFile.setDebugLeaks(false);
}
@AfterClass
public static void afterClass() throws Exception {
if (IO_MANAGER != null) {
IO_MANAGER.close();
IO_MANAGER = null;
}
}
@AfterClass
public static void tearDown() throws Exception {
fisrtServer.stop();
secondServer.stop();
if (zkService != null) {
zkService.releaseRegistry();
}
TestProjectPropertyUtils.recoverUserDir();
}
/**
* Shutdown MiniDFSCluster.
*/
@AfterClass
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
}
}
/**
* Shutdown MiniDFSCluster.
*/
@AfterClass
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
}
}
/**
* Shutdown MiniDFSCluster.
*/
@AfterClass
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
}
}
@AfterClass
public static void tearDown() throws InterruptedException, TimeoutException {
if (actorSystem1 != null) {
actorSystem1.terminate();
Await.ready(actorSystem1.whenTerminated(), Duration.Inf());
}
}
/**
* Shutdown MiniDFSCluster.
*/
@AfterClass
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
}
}
@AfterClass
public static void terminate() {
defaultMQAdminExt.shutdown();
}
@AfterClass
public static void afterClass() {
GROUP.shutdownGracefully();
}
@AfterClass
public static void cleanup() {
AbstractAirsonicHomeTest.cleanup(cleanupId);
cleanupId = null;
}
@AfterClass
public static void terminate() {
defaultMQAdminExt.shutdown();
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@AfterClass
public static void stopServers() {
for (ProxyServer p: allProxies) {
p.stop();
}
}
@AfterClass
public static void terminateGCloudEmulator() throws DockerException, InterruptedException {
GCloudEmulatorManager.terminateDocker();
}
@AfterClass
public static void after() throws Exception {
staticCleanupTestMetadata();
}
@AfterClass
public static void stopJettyServer() throws Exception {
if (jettyServer != null) {
jettyServer.stop();
}
}
@AfterClass
public static void tearDown() throws Exception {
if (ZOOKEEPER != null) {
ZOOKEEPER.shutdown();
}
}