本文整理匯總了Java中org.junit.runner.notification.RunNotifier.removeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java RunNotifier.removeListener方法的具體用法?Java RunNotifier.removeListener怎麽用?Java RunNotifier.removeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.junit.runner.notification.RunNotifier
的用法示例。
在下文中一共展示了RunNotifier.removeListener方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addListener
import org.junit.runner.notification.RunNotifier; //導入方法依賴的package包/類
@After("execution(org.junit.runner.notification.RunNotifier.new())")
public void addListener(final JoinPoint point) {
final RunNotifier notifier = (RunNotifier) point.getThis();
notifier.removeListener(allure);
notifier.addListener(allure);
}
示例2: run
import org.junit.runner.notification.RunNotifier; //導入方法依賴的package包/類
@Override
public void run(RunNotifier notifier) {
// To avoid duplicates need to do N-1 times if there's N levels of these suites
// Note, in this notifier implementation it does not matter if we try to remove
// a listener if is not contained with the notifier
notifier.removeListener(listener);
notifier.addListener(listener);
super.run(notifier);
notifier.removeListener(listener);
}
示例3: run
import org.junit.runner.notification.RunNotifier; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
public void run(final RunNotifier notifier) {
try {
notifier.removeListener(testRunRecording); // remove existing listeners that could be added by suite or class runners
notifier.addListener(testRunRecording);
super.run(notifier);
} finally {
notifier.removeListener(testRunRecording);
}
}
示例4: execute
import org.junit.runner.notification.RunNotifier; //導入方法依賴的package包/類
/**
* Runs provided File in Engine. Returns output of execution.
*/
public void execute(ILaunch launch, XpectRunConfiguration runConfiguration) throws RuntimeException {
Job job = new Job(launch.getLaunchConfiguration().getName()) {
@Override
protected IStatus run(IProgressMonitor monitor) {
XpectRunner xr;
try {
xr = new XpectRunner(N4IDEXpectTestClass.class);
} catch (InitializationError e) {
N4IDEXpectUIPlugin.logError("cannot initialize xpect runner", e);
return Status.CANCEL_STATUS;
}
// TODO support multiple selection
/*
* if Project provided, or package files should be discovered there. Also multiple selected files
*/
String testFileLocation = runConfiguration.getXtFileToRun();
IXpectURIProvider uriprov = xr.getUriProvider();
if (uriprov instanceof N4IDEXpectTestURIProvider) {
((N4IDEXpectTestURIProvider) uriprov).addTestFileLocation(testFileLocation);
}
Result result = new Result();
RunNotifier notifier = new RunNotifier();
RunListener listener = result.createListener();
N4IDEXpectRunListener n4Listener = new N4IDEXpectRunListener();
notifier.addFirstListener(listener);
notifier.addListener(n4Listener);
try {
notifier.fireTestRunStarted(xr.getDescription());
xr.run(notifier);
notifier.fireTestRunFinished(result);
} finally {
notifier.removeListener(n4Listener);
notifier.removeListener(listener);
}
// Do something with test run result?
// return result;
return Status.OK_STATUS;
}
};
job.setUser(true);
job.schedule();
}
示例5: run
import org.junit.runner.notification.RunNotifier; //導入方法依賴的package包/類
@Override
public void run(RunNotifier notifier) {
notifier.addFirstListener(listener);
super.run(notifier);
notifier.removeListener(listener);
}
示例6: runChild
import org.junit.runner.notification.RunNotifier; //導入方法依賴的package包/類
@Override
protected void runChild(Runner runner, RunNotifier notifier) {
notifier.addListener(listener);
runner.run(notifier);
notifier.removeListener(listener);
}