當前位置: 首頁>>代碼示例>>Java>>正文


Java After類代碼示例

本文整理匯總了Java中org.junit.After的典型用法代碼示例。如果您正苦於以下問題:Java After類的具體用法?Java After怎麽用?Java After使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


After類屬於org.junit包,在下文中一共展示了After類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: after

import org.junit.After; //導入依賴的package包/類
@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();
        }
    }
}
 
開發者ID:followwwind,項目名稱:apache,代碼行數:24,代碼來源:AnalyzerTest.java

示例2: tearDown

import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws InterruptedException {
  ds.disconnect();
  if (manager != null) {
    manager.close(false);
  }
  background.shutdownNow();
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:9,代碼來源:ConnectionManagerJUnitTest.java

示例3: shutDown

import org.junit.After; //導入依賴的package包/類
@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);
    }
}
 
開發者ID:HewlettPackard,項目名稱:loom,代碼行數:11,代碼來源:DeltaAdapterTest.java

示例4: restoreSettings

import org.junit.After; //導入依賴的package包/類
/**
 * Restore all settings after the testcase.
 */
@After
public void restoreSettings() {
    Settings settings = new Settings(settingsActivityRule.getActivity());
    settings.silenceDuringPresentation(silenceDuringPresentation);
    settings.useVolumeKeysForNavigation(useVolumeKeysForNavigation);
}
 
開發者ID:FelixWohlfrom,項目名稱:Presenter-Client-Android,代碼行數:10,代碼來源:SettingsActivityTest.java

示例5: tearDown

import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws Exception {
  if (zooKeeper != null) {
    zooKeeper.delete(testRootNode + Thread.currentThread().getId(), -1);
  }

  super.tearDown();
}
 
開發者ID:didichuxing2,項目名稱:https-github.com-apache-zookeeper,代碼行數:9,代碼來源:LeaderElectionSupportTest.java

示例6: after

import org.junit.After; //導入依賴的package包/類
@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();
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:12,代碼來源:TestMetaTableLocator.java

示例7: tearDown

import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws IOException {
  dirsHandler.stop();
  dirsHandler.close();
  dispatcher.await();
  dispatcher.stop();
  dispatcher.close();
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:9,代碼來源:TestNonAggregatingLogHandler.java

示例8: shutDown

import org.junit.After; //導入依賴的package包/類
@After
public void shutDown() throws Exception {
    LOG.info("shutDown test");
    adapterManager.userDisconnected(session, prov, null);
    aggregationManager.deleteSession(session);
    stitcher.deleteSession(session);
}
 
開發者ID:HewlettPackard,項目名稱:loom,代碼行數:8,代碼來源:DiscoverAdapterTest.java

示例9: tearDown

import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws Exception {
    shoppingCart.destroy();
    orders.destroy();
    payments.destroy();

    Runtime.getRuntime().exec("rm -rf tmp").waitFor();
}
 
開發者ID:pivotal-cf,項目名稱:pcf-metrics-trace-example-spring,代碼行數:9,代碼來源:TraceTest.java

示例10: tearDown

import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws Exception {
    ospfPacketHeader = null;
    ospfPacketHeader = null;
    channelBuffer = null;
    result2 = null;
    result1 = null;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:9,代碼來源:OspfPacketHeaderTest.java

示例11: afterTest

import org.junit.After; //導入依賴的package包/類
@After
public void afterTest() {
    DebugContext cached = cachedDebug.get();
    if (cached != null) {
        cached.closeDumpHandlers(true);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:8,代碼來源:GraphTest.java

示例12: tearDown

import org.junit.After; //導入依賴的package包/類
@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);
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:16,代碼來源:TestWALFactory.java

示例13: after

import org.junit.After; //導入依賴的package包/類
@After
public void after()
{
    AuthenticationUtil.clearCurrentSecurityContext();
    childApplicationContextManager.destroy();
    childApplicationContextManager = null;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:8,代碼來源:LocalAuthenticationServiceTest.java

示例14: stop

import org.junit.After; //導入依賴的package包/類
@After
public void stop() throws Exception {
  try{
    LOG.info("stop local cluster");
    angelClient.stop();
  } catch (Exception x) {
    LOG.error("stop failed ", x);
    throw x;
  }
}
 
開發者ID:Tencent,項目名稱:angel,代碼行數:11,代碼來源:AlgoMetricsTest.java

示例15: end

import org.junit.After; //導入依賴的package包/類
@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("結束");
}
 
開發者ID:aliyun,項目名稱:HiTSDB-Client,代碼行數:14,代碼來源:TestWritePerformance.java


注:本文中的org.junit.After類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。