类org.junit.After源码实例Demo

下面列出了怎么用org.junit.After的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Tomcat8-Source-Read   文件: TomcatBaseTest.java
@After
@Override
public void tearDown() throws Exception {
    try {
        // Some tests may call tomcat.destroy(), some tests may just call
        // tomcat.stop(), some not call either method. Make sure that stop()
        // & destroy() are called as necessary.
        if (tomcat.server != null
                && tomcat.server.getState() != LifecycleState.DESTROYED) {
            if (tomcat.server.getState() != LifecycleState.STOPPED) {
                tomcat.stop();
            }
            tomcat.destroy();
        }
    } finally {
        super.tearDown();
    }
}
 
源代码2 项目: netty-4.1.22   文件: DataCompressionHttp2Test.java
@After
public void teardown() throws InterruptedException {
    if (clientChannel != null) {
        clientChannel.close().sync();
        clientChannel = null;
    }
    if (serverChannel != null) {
        serverChannel.close().sync();
        serverChannel = null;
    }
    final Channel serverConnectedChannel = this.serverConnectedChannel;
    if (serverConnectedChannel != null) {
        serverConnectedChannel.close().sync();
        this.serverConnectedChannel = null;
    }
    Future<?> serverGroup = sb.config().group().shutdownGracefully(0, 0, MILLISECONDS);
    Future<?> serverChildGroup = sb.config().childGroup().shutdownGracefully(0, 0, MILLISECONDS);
    Future<?> clientGroup = cb.config().group().shutdownGracefully(0, 0, MILLISECONDS);
    serverGroup.sync();
    serverChildGroup.sync();
    clientGroup.sync();
}
 
源代码3 项目: Flink-CEPplus   文件: HashVsSortMiniBenchmark.java
@After
public void afterTest() {
	if (this.memoryManager != null) {
		Assert.assertTrue("Memory Leak: Not all memory has been returned to the memory manager.",
			this.memoryManager.verifyEmpty());
		this.memoryManager.shutdown();
		this.memoryManager = null;
	}
	
	if (this.ioManager != null) {
		this.ioManager.shutdown();
		if (!this.ioManager.isProperlyShutDown()) {
			Assert.fail("I/O manager failed to properly shut down.");
		}
		this.ioManager = null;
	}
}
 
源代码4 项目: hadoop-ozone   文件: TestSecureOzoneManager.java
/**
 * Shutdown MiniDFSCluster.
 */
@After
public void shutdown() {
  if (cluster != null) {
    cluster.shutdown();
  }
  FileUtils.deleteQuietly(metaDir.toFile());
}
 
@After
public void after() {
    System.clearProperty("noBuild");
    System.clearProperty("isDeveloperMode");
    System.clearProperty("spark.local");
    super.after();
}
 
源代码6 项目: sofa-jraft   文件: RouteTableTest.java
@After
public void teardown() throws Exception {
    cliClientService.shutdown();
    cluster.stopAll();
    if (NodeImpl.GLOBAL_NUM_NODES.get() > 0) {
        Thread.sleep(1000);
        assertEquals(NodeImpl.GLOBAL_NUM_NODES.get(), 0);
    }
    FileUtils.deleteDirectory(new File(this.dataPath));
    NodeManager.getInstance().clear();
    RouteTable.getInstance().reset();
}
 
源代码7 项目: arcusplatform   文件: TestAddPlaceHandler.java
@After
@Override
public void tearDown() throws Exception
{
   super.tearDown();

   verify();

   reset();
}
 
@After
@Override
public void shutdownBlobServer() throws IOException {
	if (blobServer != null) {
		blobServer.close();
	}
}
 
@After
public final void afterTest() throws Exception {
  completeStrayTransaction();

  if ( isCleanupTestDataRequired() ) {
    cleanupTestData();
  }
  cleanupTest();

  cleanupSession();

  assertAllDataRemoved();

}
 
@After
public void tearDown()
        throws Exception
{
    allocator.close();
    logger.info("{}: exit ", testName.getMethodName());
}
 
源代码11 项目: hop   文件: ReadAllCacheTest.java
@After
public void tearDown() {
  transformData = null;
  keysMeta = null;
  keys = null;
  data = null;
}
 
源代码12 项目: grpc-nebula-java   文件: TlsTest.java
@After
public void tearDown() {
  if (server != null) {
    server.shutdown();
  }
  if (channel != null) {
    channel.shutdown();
  }
  MoreExecutors.shutdownAndAwaitTermination(executor, 5, TimeUnit.SECONDS);
}
 
源代码13 项目: flink   文件: JDBCFullTest.java
@After
public void clearOutputTable() throws Exception {
	Class.forName(DRIVER_CLASS);
	try (
		Connection conn = DriverManager.getConnection(DB_URL);
		Statement stat = conn.createStatement()) {
		stat.execute("DELETE FROM " + OUTPUT_TABLE);

		stat.close();
		conn.close();
	}
}
 
源代码14 项目: gcp-token-broker   文件: CloudDatastoreCacheTest.java
@After
public void teardown() {
    // Delete all records
    Datastore datastore = getService();
    Query<Entity> query = Query.newEntityQueryBuilder().setKind(CACHE_KIND).build();
    QueryResults<Entity> entities = datastore.run(query);
    while (entities.hasNext()) {
        Entity entity = entities.next();
        datastore.delete(entity.getKey());
    }
}
 
源代码15 项目: flink   文件: ResourceManagerTaskExecutorTest.java
@After
public void teardown() throws Exception {
	if (resourceManager != null) {
		RpcUtils.terminateRpcEndpoint(resourceManager, TIMEOUT);
	}

	if (testingFatalErrorHandler != null && testingFatalErrorHandler.hasExceptionOccurred()) {
		testingFatalErrorHandler.rethrowError();
	}
}
 
源代码16 项目: submarine   文件: SysUserServiceTest.java
@After
public void removeAllRecord() throws Exception {
  SysUserService userService = new SysUserService();

  List<SysUser> userList = userService.queryPageList("", null, null, null, null, 0, 10);
  assertTrue(userList.size() > 0);
  for (SysUser user : userList) {
    userService.delete(user.getId());
  }
}
 
@After
public void destroyHDFS() {
	try {
		if (baseDir != null) {
			FileUtil.fullyDelete(baseDir);
		}
	} catch (Throwable t) {
		throw new RuntimeException(t);
	}
}
 
源代码18 项目: singer   文件: TestPodLogCycle.java
@After
public void after() {
    LogStreamManager.getInstance().getSingerLogPaths().clear();
    SingerSettings.getFsMonitorMap().clear();
    delete(new File(podLogPath));
    LogStreamManager.reset();
    KubeService.reset();
    SingerSettings.reset();
}
 
源代码19 项目: hibernate-reactive   文件: HQLQueryTest.java
@After
public void cleanDb(TestContext context) {
	test( context, openSession()
			.thenCompose( s -> s.remove( spelt ) )
			.thenCompose( s -> s.remove( rye ) )
			.thenCompose( s -> s.remove( almond ) )
			.thenCompose( s -> s.flush() ) );
}
 
源代码20 项目: Flink-CEPplus   文件: NormalizedKeySorterTest.java
@After
public void afterTest() {
	if (!this.memoryManager.verifyEmpty()) {
		Assert.fail("Memory Leak: Some memory has not been returned to the memory manager.");
	}
	
	if (this.memoryManager != null) {
		this.memoryManager.shutdown();
		this.memoryManager = null;
	}
}
 
源代码21 项目: ghidra   文件: AbstractDockingTest.java
@After
// named differently than tearDown(), so subclasses do not override it
public void dockingTearDown() {
	// Disable error reporting from non-test threads found during tearDown().  The idea is
	// that odd issue find while coming down are not important, as they are usually
	// timing issues.

	// Note: this doesn't quite work as intended.  This should be run before each other
	//       tearDown() method, but junit offers no way to do that.   If you can figure 
	//       out how to make that work, then update this code.
	ConcurrentTestExceptionHandler.disable();
}
 
源代码22 项目: hadoop-ozone   文件: TestOzoneContainer.java
@After
public void cleanUp() throws Exception {
  if (volumeSet != null) {
    volumeSet.shutdown();
    volumeSet = null;
  }
}
 
@After
public void clearResource() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    stringRedisCommands.del(ruleKey);
    client.shutdown();
    server.stop();
    server = null;
}
 
源代码24 项目: flink   文件: AbstractRecoverableWriterTest.java
@After
public void cleanup() throws Exception {
	getFileSystem().delete(basePathForTest, true);
}
 
源代码25 项目: staffjoy   文件: TeamControllerTest.java
@After
public void destroy() {
    teamRepo.deleteAll();
}
 
源代码26 项目: rocketmq-4.3.0   文件: NormalMsgStaticBalanceIT.java
@After
public void tearDown() {
    super.shutdown();
}
 
源代码27 项目: sofa-jraft   文件: BaseLogStorageTest.java
@Override
@After
public void teardown() throws Exception {
    this.logStorage.shutdown();
    super.teardown();
}
 
@After
public void verifyRestoredRequestAttributes() {
	assertRequestAttributes(false);
}
 
源代码29 项目: grpc-nebula-java   文件: URLTest.java
@After
public void tearDown() throws Exception {
}
 
源代码30 项目: hadoop-ozone   文件: TestDBConfigFromFile.java
@After
public void tearDown() throws Exception {
}
 
 类所在包
 类方法
 同包方法