org.junit.AfterClass Java Examples

The following examples show how to use org.junit.AfterClass. 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   Author: apache   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   Author: ljygz   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   Author: apache   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   Author: Qihoo360   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   Author: flink-tpc-ds   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   Author: ljygz   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   Author: HotelsDotCom   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   Author: flink-tpc-ds   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   Author: grpc-nebula   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
Source Project: sharding-jdbc-1.5.1   Author: tianheframe   File: ShardingDatabaseOnlyTest.java    License: Apache License 2.0 5 votes vote down vote up
@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   Author: flink-tpc-ds   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
Source Project: netcdf-java   Author: Unidata   File: TestGribIndexCreation.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@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
Source Project: stateful-functions   Author: ververica   File: UnboundedFeedbackLoggerTest.java    License: Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void afterClass() throws Exception {
  if (IO_MANAGER != null) {
    IO_MANAGER.close();
    IO_MANAGER = null;
  }
}
 
Example #15
Source Project: grpc-nebula-java   Author: grpc-nebula   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
Source Project: hadoop-ozone   Author: apache   File: TestCloseContainerHandlingByClient.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 #17
Source Project: hadoop-ozone   Author: apache   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   Author: apache   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   Author: ljygz   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   Author: apache   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
Source Project: rocketmq-read   Author: chenhaiyangs   File: ConsumerStatusSubCommandTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void terminate() {
    defaultMQAdminExt.shutdown();
}
 
Example #22
Source Project: netty-4.1.22   Author: tianheframe   File: EpollSocketTcpMd5Test.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void afterClass() {
    GROUP.shutdownGracefully();
}
 
Example #23
Source Project: airsonic-advanced   Author: airsonic-advanced   File: SearchServiceTestCase.java    License: GNU General Public License v3.0 4 votes vote down vote up
@AfterClass
public static void cleanup() {
    AbstractAirsonicHomeTest.cleanup(cleanupId);
    cleanupId = null;
}
 
Example #24
Source Project: rocketmq-read   Author: chenhaiyangs   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   Author: project-hop   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   Author: tianheframe   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   Author: flink-tpc-ds   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   Author: Kyligence   File: TupleExpressionTest.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void after() throws Exception {
    staticCleanupTestMetadata();
}
 
Example #29
Source Project: java-technology-stack   Author: codeEngraver   File: WebRequestDataBinderIntegrationTests.java    License: MIT License 4 votes vote down vote up
@AfterClass
public static void stopJettyServer() throws Exception {
	if (jettyServer != null) {
		jettyServer.stop();
	}
}
 
Example #30
Source Project: Flink-CEPplus   Author: ljygz   File: ZooKeeperCompletedCheckpointStoreITCase.java    License: Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
	if (ZOOKEEPER != null) {
		ZOOKEEPER.shutdown();
	}
}