Java Code Examples for org.junit.After

The following are top voted examples for showing how to use org.junit.After. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: apache   File: AnalyzerTest.java   View source code 6 votes vote down vote up
@After
public void after(){

    if(analyzer != null){
        try {
            TokenStream ts = analyzer.tokenStream("field", text);
            CharTermAttribute ch = ts.addAttribute(CharTermAttribute.class);
            ts.reset();
            int i = 0;
            while (ts.incrementToken()) {
                i++;
                System.out.print(ch.toString() + "\t");
                if(i % 7 == 0){
                    System.out.println();
                }
            }
            ts.end();
            ts.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 
Example 2
Project: monarch   File: ConnectionManagerJUnitTest.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws InterruptedException {
  ds.disconnect();
  if (manager != null) {
    manager.close(false);
  }
  background.shutdownNow();
}
 
Example 3
Project: loom   File: DeltaAdapterTest.java   View source code 5 votes vote down vote up
@After
public void shutDown() throws Exception {
    LOG.info("shutDown test");
    if (session != null) {
        adapterManager.userDisconnected(session, prov, null);
        aggregationManager.deleteSession(session);
        stitcher.deleteSession(session);
        tam.clearAggregationUpdatesMap(session);
    }
}
 
Example 4
Project: Presenter-Client-Android   File: SettingsActivityTest.java   View source code 5 votes vote down vote up
/**
 * Restore all settings after the testcase.
 */
@After
public void restoreSettings() {
    Settings settings = new Settings(settingsActivityRule.getActivity());
    settings.silenceDuringPresentation(silenceDuringPresentation);
    settings.useVolumeKeysForNavigation(useVolumeKeysForNavigation);
}
 
Example 5
Project: https-github.com-apache-zookeeper   File: LeaderElectionSupportTest.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws Exception {
  if (zooKeeper != null) {
    zooKeeper.delete(testRootNode + Thread.currentThread().getId(), -1);
  }

  super.tearDown();
}
 
Example 6
Project: ditb   File: TestMetaTableLocator.java   View source code 5 votes vote down vote up
@After public void after() {
  try {
    // Clean out meta location or later tests will be confused... they presume
    // start fresh in zk.
    new MetaTableLocator().deleteMetaLocation(this.watcher);
  } catch (KeeperException e) {
    LOG.warn("Unable to delete hbase:meta location", e);
  }

  this.watcher.close();
}
 
Example 7
Project: hadoop   File: TestNonAggregatingLogHandler.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws IOException {
  dirsHandler.stop();
  dirsHandler.close();
  dispatcher.await();
  dispatcher.stop();
  dispatcher.close();
}
 
Example 8
Project: loom   File: DiscoverAdapterTest.java   View source code 5 votes vote down vote up
@After
public void shutDown() throws Exception {
    LOG.info("shutDown test");
    adapterManager.userDisconnected(session, prov, null);
    aggregationManager.deleteSession(session);
    stitcher.deleteSession(session);
}
 
Example 9
Project: pcf-metrics-trace-example-spring   File: TraceTest.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws Exception {
    shoppingCart.destroy();
    orders.destroy();
    payments.destroy();

    Runtime.getRuntime().exec("rm -rf tmp").waitFor();
}
 
Example 10
Project: athena   File: OspfPacketHeaderTest.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws Exception {
    ospfPacketHeader = null;
    ospfPacketHeader = null;
    channelBuffer = null;
    result2 = null;
    result1 = null;
}
 
Example 11
Project: openjdk-jdk10   File: GraphTest.java   View source code 5 votes vote down vote up
@After
public void afterTest() {
    DebugContext cached = cachedDebug.get();
    if (cached != null) {
        cached.closeDumpHandlers(true);
    }
}
 
Example 12
Project: ditb   File: TestWALFactory.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws Exception {
  // testAppendClose closes the FileSystem, which will prevent us from closing cleanly here.
  try {
    wals.close();
  } catch (IOException exception) {
    LOG.warn("Encountered exception while closing wal factory. If you have other errors, this" +
        " may be the cause. Message: " + exception);
    LOG.debug("Exception details for failure to close wal factory.", exception);
  }
  FileStatus[] entries = fs.listStatus(new Path("/"));
  for (FileStatus dir : entries) {
    fs.delete(dir.getPath(), true);
  }
}
 
Example 13
Project: alfresco-repository   File: LocalAuthenticationServiceTest.java   View source code 5 votes vote down vote up
@After
public void after()
{
    AuthenticationUtil.clearCurrentSecurityContext();
    childApplicationContextManager.destroy();
    childApplicationContextManager = null;
}
 
Example 14
Project: angel   File: AlgoMetricsTest.java   View source code 5 votes vote down vote up
@After
public void stop() throws Exception {
  try{
    LOG.info("stop local cluster");
    angelClient.stop();
  } catch (Exception x) {
    LOG.error("stop failed ", x);
    throw x;
  }
}
 
Example 15
Project: HiTSDB-Client   File: TestWritePerformance.java   View source code 5 votes vote down vote up
@After
public void end() throws IOException {
	// 优雅关闭
	System.err.println("关闭客户端!!!");
	tsdb.close();
	t1.compareAndSet(0, System.currentTimeMillis());

	double dt = t1.get() - t0.get();
	System.out.println("处理:" + num);
	System.out.println("时间:" + (dt));
	System.out.println("消耗速率" + SIZE * P_NUM / dt + "K/s");
	System.out.println("结束");
}
 
Example 16
Project: monarch   File: WriteAheadLogJUnitTest.java   View source code 5 votes vote down vote up
@After
public void cleanUp() {
  Exception e = null;
  try {
    writeAheadLog.deinit();
  } catch (IOException e1) {
    e = e1;
  }
  assertNull(e);
  // cleanDir("/tmp/WALDIR");
}
 
Example 17
Project: server-vot   File: EditPersonRouterTest.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws Exception {
    service = null;
    serviceResponse = null;
    protector = null;
    router = null;
    payload = null;
    requester = null;
    person = null;
    stringifiedPerson = null;
}
 
Example 18
Project: server-vot   File: AssignMaintainerServiceTest.java   View source code 5 votes vote down vote up
@After
public void tearDown() throws Exception {
    personRepository = null;
    machineRepository = null;
    authProvider = null;

    assignMaintainerService = null;

    machine = null;
    technician = null;
    supervisor = null;

    assignMaintainerData = null;
}
 
Example 19
Project: lambdora   File: IntegrationTestBase.java   View source code 5 votes vote down vote up
/**
 * teardown
 */
@After
public void tearDown() {
    // Shutdown the thread pools in DynamoDB Local / Embedded
    if (dynamodbClient != null) {
        dynamodbClient.shutdown();
    }
}
 
Example 20
Project: gradle-auto-version   File: VersionFileTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() throws Exception {
    System.out.printf("Removing tmpfile: %s%n", tmpFileName);
    new File(tmpFileName).delete();
}
 
Example 21
Project: empiria.player   File: StyleLinkManagerTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
    verifyNoMoreInteractions(styleLinkAppender);
}
 
Example 22
Project: alfresco-remote-api   File: Cleanup.java   View source code 4 votes vote down vote up
@After
	public void after() throws Exception
	{
//		PublicApiTestFixture fixture = PublicApiTestFixture.getInstance();
//		fixture.shutdown();
	}
 
Example 23
Project: FireBaseTest   File: ContentScreenTest.java   View source code 4 votes vote down vote up
@After
public void unregisterIdlingResource() {
    IdlingRegistry.getInstance().unregister(EspressoIdlingResource.getIdlingResource());
}
 
Example 24
Project: JInsight   File: JedisPoolInstrumentationTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() throws Exception {
  pool.close();
}
 
Example 25
Project: BEAST   File: CElectionDescriptionEditorBuilderTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
}
 
Example 26
Project: incubator-netbeans   File: ClusteredIndexablesTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
}
 
Example 27
Project: monarch   File: ReplaceWithOverflowJUnitTest.java   View source code 4 votes vote down vote up
@After
public void destroyRegion() {
  if (region != null) {
    region.destroyRegion();
  }
}
 
Example 28
Project: WLT3Serial   File: CommonsCollectionsLinuxTests.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
	try {
		ws.stop();
	} catch(Exception e) {
		//don't care
	}
}
 
Example 29
Project: fresco_floodlight   File: OFSwitchHandlerTestBase.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
	verifyAll();
}
 
Example 30
Project: java-metrics-prototype   File: PrometheusMetricsReporterTest.java   View source code 4 votes vote down vote up
@After
public void close() {
    collectorRegistry.clear();
}
 
Example 31
Project: rskj   File: LocalBasicTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
    ConfigHelper.CONFIG.setBlockchainConfig(originalBlockchainConfig);
}
 
Example 32
Project: incubator-servicecomb-java-chassis   File: TestAppManager.java   View source code 4 votes vote down vote up
@After
public void tearDown() throws Exception {
  findInstancesResponse = null;
  microserviceInstances = null;
}
 
Example 33
Project: hashsdn-controller   File: QuarantinedMonitorActorTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() throws Exception {
    JavaTestKit.shutdownActorSystem(system);
}
 
Example 34
Project: spring-security-oauth2-boot   File: ResourceServerTokenServicesConfigurationTests.java   View source code 4 votes vote down vote up
@After
public void close() {
	if (this.context != null) {
		this.context.close();
	}
}
 
Example 35
Project: verify-hub   File: EidasAttributeQueryRequestDtoBuilderTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
    DateTimeUtils.setCurrentMillisSystem();
}
 
Example 36
Project: Recordian   File: SupervisorMapperTest.java   View source code 4 votes vote down vote up
@After
public void deleteDatabase() {
    DatabaseHelper.deleteDatabase();
}
 
Example 37
Project: oscm   File: EnterpriseLandingpageCtrlTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() {
    ctrl = null;
}
 
Example 38
Project: dubbox-hystrix   File: FailSafeClusterInvokerTest.java   View source code 4 votes vote down vote up
@After
public void tearDown(){
    EasyMock.verify(invoker,dic);
    
}
 
Example 39
Project: matrix-toolkits-java   File: BandLUTest.java   View source code 4 votes vote down vote up
@After
public void tearDown() throws Exception {
    A = null;
    I = null;
}
 
Example 40
Project: sling-org-apache-sling-launchpad-integration-tests   File: RedirectOnLogoutTest.java   View source code 4 votes vote down vote up
@After
public void cleanup() throws Exception {
    H.tearDown();
}