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 File: TestOzoneAtRestEncryption.java    From hadoop-ozone with 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 File: MetastoreClientIndexIntegrationTest.java    From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 5 votes vote down vote up
@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 #3
Source File: TestBlockOutputStream.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example #4
Source File: YARNHighAvailabilityITCase.java    From Flink-CEPplus with 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 #5
Source File: QuarantineMonitorTest.java    From Flink-CEPplus with 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 #6
Source File: TestOmAcls.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example #7
Source File: TestDeleteWithSlowFollower.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example #8
Source File: TestCloseContainerHandlingByClient.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown MiniDFSCluster.
 */
@AfterClass
public static void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
}
 
Example #9
Source File: PythonInterpreterTest.java    From submarine with 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 #10
Source File: AkkaRpcServiceTest.java    From flink with 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 #11
Source File: MultiFrameIntegrationTest.java    From data-highway with Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void afterClass() {
  if (context != null) {
    context.close();
    context = null;
  }
}
 
Example #12
Source File: MetadataClientTest.java    From Quicksql with MIT License 5 votes vote down vote up
/**
 * close resource.
 */
@AfterClass
public static void close() {
    if (client != null) {
        client.close();
    }
}
 
Example #13
Source File: KvStateServerTest.java    From flink with 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 #14
Source File: ShardingDatabaseOnlyTest.java    From sharding-jdbc-1.5.1 with 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 #15
Source File: LoadBalanceTest.java    From grpc-nebula-java with 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 File: TestGribIndexCreation.java    From netcdf-java with 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 #17
Source File: UnboundedFeedbackLoggerTest.java    From stateful-functions with 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 #18
Source File: StringWriterTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void destroyHDFS() {
	if (hdfsCluster != null) {
		hdfsCluster.shutdown();
		hdfsCluster = null;
	}
}
 
Example #19
Source File: LoadBalanceModeTest.java    From grpc-nebula-java with 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 #20
Source File: AsyncCallsTest.java    From Flink-CEPplus with 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 #21
Source File: DefaultHttp2ConnectionTest.java    From netty-4.1.22 with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void afterClass() {
    group.shutdownGracefully();
}
 
Example #22
Source File: ITestRootedOzoneContractSeek.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void teardownCluster() {
  RootedOzoneContract.destroyCluster();
}
 
Example #23
Source File: DefaultMQAdminExtTest.java    From DDMQ with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void terminate() throws Exception {
    if (defaultMQAdminExtImpl != null)
        defaultMQAdminExt.shutdown();
}
 
Example #24
Source File: BoundedBlockingSubpartitionTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void shutdown() throws Exception {
	fileChannelManager.close();
}
 
Example #25
Source File: JobManagerHAProcessFailureRecoveryITCase.java    From flink with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
	if (zooKeeper != null) {
		zooKeeper.shutdown();
	}
}
 
Example #26
Source File: QuarkusModelRegistryTest.java    From intellij-quarkus with Eclipse Public License 2.0 4 votes vote down vote up
@AfterClass
public static void tearDown() throws Exception {
    myFixture.tearDown();
}
 
Example #27
Source File: LegacySchedulerBatchSchedulingTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void teardownClass() {
	if (singleThreadScheduledExecutorService != null) {
		singleThreadScheduledExecutorService.shutdownNow();
	}
}
 
Example #28
Source File: PeripheralScannerTest.java    From bitgatt with Mozilla Public License 2.0 4 votes vote down vote up
@AfterClass
public static void afterClass() {
    delayHandlerThread.quit();
    otherDelayHandlerThread.quit();
    appContext.unregisterReceiver(handleIntentBasedScanResult);
}
 
Example #29
Source File: ITestOzoneContractSeek.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void teardownCluster() throws IOException {
  OzoneContract.destroyCluster();
}
 
Example #30
Source File: CalculatorBackwardCompatibilityUnitTest.java    From hop with Apache License 2.0 4 votes vote down vote up
@AfterClass
public static void restore() throws Exception {
  setRound2Mode( DEFAULT_ROUND_2_MODE );
  assertEquals( DEFAULT_ROUND_2_MODE, getRound2Mode() );
}