本文整理匯總了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();
}
}
}
示例2: tearDown
import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws InterruptedException {
ds.disconnect();
if (manager != null) {
manager.close(false);
}
background.shutdownNow();
}
示例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);
}
}
示例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);
}
示例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();
}
示例7: tearDown
import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws IOException {
dirsHandler.stop();
dirsHandler.close();
dispatcher.await();
dispatcher.stop();
dispatcher.close();
}
示例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);
}
示例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();
}
示例10: tearDown
import org.junit.After; //導入依賴的package包/類
@After
public void tearDown() throws Exception {
ospfPacketHeader = null;
ospfPacketHeader = null;
channelBuffer = null;
result2 = null;
result1 = null;
}
示例11: afterTest
import org.junit.After; //導入依賴的package包/類
@After
public void afterTest() {
DebugContext cached = cachedDebug.get();
if (cached != null) {
cached.closeDumpHandlers(true);
}
}
示例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);
}
}
示例13: after
import org.junit.After; //導入依賴的package包/類
@After
public void after()
{
AuthenticationUtil.clearCurrentSecurityContext();
childApplicationContextManager.destroy();
childApplicationContextManager = null;
}
示例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;
}
}
示例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("結束");
}