本文整理汇总了Java中com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil.createAndAttachConsole方法的典型用法代码示例。如果您正苦于以下问题:Java SMTestRunnerConnectionUtil.createAndAttachConsole方法的具体用法?Java SMTestRunnerConnectionUtil.createAndAttachConsole怎么用?Java SMTestRunnerConnectionUtil.createAndAttachConsole使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil
的用法示例。
在下文中一共展示了SMTestRunnerConnectionUtil.createAndAttachConsole方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
if (GaugeVersion.isGreaterOrEqual(GaugeRunConfiguration.TEST_RUNNER_SUPPORT_VERSION, false)
&& GaugeSettingsService.getSettings().useIntelliJTestRunner()) {
ProcessHandler handler = startProcess();
GaugeConsoleProperties properties = new GaugeConsoleProperties(config, "Gauge", executor, handler);
ConsoleView console = SMTestRunnerConnectionUtil.createAndAttachConsole("Gauge", handler, properties);
DefaultExecutionResult result = new DefaultExecutionResult(console, handler, createActions(console, handler));
if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(console);
if (action != null) {
action.setModelProvider(((SMTRunnerConsoleView) console)::getResultsViewer);
result.setRestartActions(action);
}
}
return result;
}
return super.execute(executor, runner);
}
示例2: showMavenToolWindow
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
public void showMavenToolWindow() {
ConfigurationType configurationType = new JUnitConfigurationType();
ConfigurationFactory configurationFactory = new ConfigurationFactoryEx<JUnitConfiguration>(configurationType) {
@NotNull
@Override
public RunConfiguration createTemplateConfiguration(@NotNull Project project) {
return new JUnitConfiguration(project.getName(), project, this);
}
};
JUnitConfiguration configuration = new JUnitConfiguration(project.getName(), project, configurationFactory);
Executor executor = new DefaultRunExecutor();
ProcessHandler processHandler = new NopProcessHandler();
TestConsoleProperties consoleProperties = new MavenTestConsoleProperties(mavenProject, project, executor, configuration, processHandler);
BaseTestsOutputConsoleView consoleView;
try {
consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(TOOL_WINDOW_ID, processHandler, consoleProperties);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
showInToolWindow(consoleView, mavenProject.getFinalName());
processHandler.startNotify();
}
示例3: attachConsole
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected ConsoleView attachConsole(AndroidRunningState state, Executor executor) throws ExecutionException {
AndroidTestConsoleProperties properties = new AndroidTestConsoleProperties(this, executor);
ConsoleView consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole("Android", state.getProcessHandler(), properties);
Disposer.register(state.getFacet().getModule().getProject(), consoleView);
return consoleView;
}
示例4: attachExecutionConsole
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
@NotNull
@Override
public ExecutionConsole attachExecutionConsole(@NotNull final ExternalSystemTask task,
@NotNull final Project project,
@NotNull final ExternalSystemRunConfiguration configuration,
@NotNull final Executor executor,
@NotNull final ExecutionEnvironment env,
@NotNull final ProcessHandler processHandler) throws ExecutionException {
final GradleConsoleProperties properties = new GradleConsoleProperties(configuration, executor);
myExecutionConsole = (SMTRunnerConsoleView)SMTestRunnerConnectionUtil.createAndAttachConsole(
configuration.getSettings().getExternalSystemId().getReadableName(), processHandler, properties);
TestTreeRenderer originalRenderer =
ObjectUtils.tryCast(myExecutionConsole.getResultsViewer().getTreeView().getCellRenderer(), TestTreeRenderer.class);
if (originalRenderer != null) {
originalRenderer.setAdditionalRootFormatter(new SMRootTestProxyFormatter() {
@Override
public void format(@NotNull SMTestProxy.SMRootTestProxy testProxy, @NotNull TestTreeRenderer renderer) {
final TestStateInfo.Magnitude magnitude = testProxy.getMagnitudeInfo();
if (magnitude == TestStateInfo.Magnitude.RUNNING_INDEX) {
renderer.clear();
renderer.append(GradleBundle.message(
"gradle.test.runner.ui.tests.tree.presentation.labels.waiting.tests"),
SimpleTextAttributes.REGULAR_ATTRIBUTES
);
}
else if (!testProxy.isInProgress() && testProxy.isEmptySuite()) {
renderer.clear();
renderer.append(GradleBundle.message(
"gradle.test.runner.ui.tests.tree.presentation.labels.no.tests.were.found"),
SimpleTextAttributes.REGULAR_ATTRIBUTES
);
}
}
});
}
return myExecutionConsole;
}
示例5: getStockConsoleProvider
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
private ConsoleProvider getStockConsoleProvider() {
return (parent, handler, executor) -> {
AndroidTestConsoleProperties properties =
new AndroidTestConsoleProperties(runConfiguration, executor);
ConsoleView consoleView =
SMTestRunnerConnectionUtil.createAndAttachConsole("Android", handler, properties);
Disposer.register(parent, consoleView);
return consoleView;
};
}
示例6: execute
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil; //导入方法依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner)
throws ExecutionException {
final ProcessHandler processHandler = runBuildCommand(executor);
final TestConsoleProperties properties =
new BuckTestConsoleProperties(
processHandler, mProject, mConfiguration, "Buck test", executor);
final ConsoleView console =
SMTestRunnerConnectionUtil.createAndAttachConsole("buck test", processHandler, properties);
return new DefaultExecutionResult(console, processHandler, AnAction.EMPTY_ARRAY);
}