Java Code Examples for org.junit.AfterClass

The following examples show how to use org.junit.AfterClass. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hadoop-ozone   Source File: TestOzoneAtRestEncryption.java    License: Apache License 2.0 6 votes vote down vote up
/**
   * 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();
  }
}
 
Example 2
Source Project: Flink-CEPplus   Source File: YARNHighAvailabilityITCase.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void teardown() throws Exception {
	if (zkServer != null) {
		zkServer.stop();
		zkServer = null;
	}
}
 
Example 3
Source Project: submarine   Source File: PythonInterpreterTest.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void tearDown() throws InterpreterException {
  if (null != pythonInterpreterForCancel) {
    pythonInterpreterForCancel.close();
  }
  if (null != pythonInterpreterForClose) {
    pythonInterpreterForClose.close();
  }
}
 
Example 4
Source Project: Quicksql   Source File: MetadataClientTest.java    License: MIT License 5 votes vote down vote up
/**
 * close resource.
 */
@AfterClass
public static void close() {
    if (client != null) {
        client.close();
    }
}
 
Example 5
Source Project: flink   Source File: AkkaRpcServiceTest.java    License: Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 6
Source Project: Flink-CEPplus   Source File: AsyncCallsTest.java    License: Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 7
Source Project: data-highway   Source File: MultiFrameIntegrationTest.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void afterClass() {
  if (context != null) {
    context.close();
    context = null;
  }
}
 
Example 8
Source Project: flink   Source File: StringWriterTest.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void destroyHDFS() {
	if (hdfsCluster != null) {
		hdfsCluster.shutdown();
		hdfsCluster = null;
	}
}
 
Example 9
Source Project: grpc-nebula-java   Source File: LoadBalanceTest.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
  fisrtServer.stop();
  secondServer.stop();
  if (zkService != null) {
    zkService.releaseRegistry();
  }

  TestProjectPropertyUtils.recoverUserDir();
}
 
Example 10
@AfterClass
public static void clear() {
    isShutdown = true;
    if (!shardingDataSources.isEmpty()) {
        for (ShardingDataSource each : shardingDataSources.values()) {
            each.close();
        }
    }
}
 
Example 11
@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()));
}
 
Example 12
Source Project: flink   Source File: KvStateServerTest.java    License: Apache License 2.0 5 votes vote down vote up
@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);
	}
}
 
Example 13
@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);
}
 
Example 14
@AfterClass
public static void afterClass() throws Exception {
  if (IO_MANAGER != null) {
    IO_MANAGER.close();
    IO_MANAGER = null;
  }
}
 
Example 15
Source Project: grpc-nebula-java   Source File: LoadBalanceModeTest.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
  fisrtServer.stop();
  secondServer.stop();
  if (zkService != null) {
    zkService.releaseRegistry();
  }
  TestProjectPropertyUtils.recoverUserDir();
}
 
Example 16
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example 17
Source Project: hadoop-ozone   Source File: TestBlockOutputStream.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example 18
Source Project: hadoop-ozone   Source File: TestDeleteWithSlowFollower.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example 19
Source Project: Flink-CEPplus   Source File: QuarantineMonitorTest.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void tearDown() throws InterruptedException, TimeoutException {
	if (actorSystem1 != null) {
		actorSystem1.terminate();
		Await.ready(actorSystem1.whenTerminated(), Duration.Inf());
	}
}
 
Example 20
Source Project: hadoop-ozone   Source File: TestOmAcls.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example 21
@AfterClass
public static void terminate() {
    defaultMQAdminExt.shutdown();
}
 
Example 22
Source Project: netty-4.1.22   Source File: EpollSocketTcpMd5Test.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void afterClass() {
    GROUP.shutdownGracefully();
}
 
Example 23
@AfterClass
public static void cleanup() {
    AbstractAirsonicHomeTest.cleanup(cleanupId);
    cleanupId = null;
}
 
Example 24
Source Project: rocketmq-read   Source File: WipeWritePermSubCommandTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void terminate() {
    defaultMQAdminExt.shutdown();
}
 
Example 25
Source Project: hop   Source File: ZipCompressionProviderTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
 
Example 26
Source Project: netty-4.1.22   Source File: ProxyHandlerTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void stopServers() {
    for (ProxyServer p: allProxies) {
        p.stop();
    }
}
 
Example 27
Source Project: flink   Source File: GCloudUnitTestBase.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void terminateGCloudEmulator() throws DockerException, InterruptedException {
	GCloudEmulatorManager.terminateDocker();
}
 
Example 28
Source Project: kylin-on-parquet-v2   Source File: TupleExpressionTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void after() throws Exception {
    staticCleanupTestMetadata();
}
 
Example 29
@AfterClass
public static void stopJettyServer() throws Exception {
	if (jettyServer != null) {
		jettyServer.stop();
	}
}
 
Example 30
@AfterClass
public static void tearDown() throws Exception {
	if (ZOOKEEPER != null) {
		ZOOKEEPER.shutdown();
	}
}