本文整理汇总了Java中com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView类的典型用法代码示例。如果您正苦于以下问题:Java SMTRunnerConsoleView类的具体用法?Java SMTRunnerConsoleView怎么用?Java SMTRunnerConsoleView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMTRunnerConsoleView类属于com.intellij.execution.testframework.sm.runner.ui包,在下文中一共展示了SMTRunnerConsoleView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
@Override
public ExecutionResult execute(Executor executor, CommandLinePatcher... patchers) throws ExecutionException {
final ProcessHandler processHandler = startProcess(patchers);
final ConsoleView console = createAndAttachConsole(myConfiguration.getProject(), processHandler, executor);
List<AnAction> actions = Lists
.newArrayList(createActions(console, processHandler));
DefaultExecutionResult executionResult =
new DefaultExecutionResult(console, processHandler, actions.toArray(new AnAction[actions.size()]));
PyRerunFailedTestsAction rerunFailedTestsAction = new PyRerunFailedTestsAction(console);
if (console instanceof SMTRunnerConsoleView) {
rerunFailedTestsAction.init(((BaseTestsOutputConsoleView)console).getProperties());
rerunFailedTestsAction.setModelProvider(new Getter<TestFrameworkRunningModel>() {
@Override
public TestFrameworkRunningModel get() {
return ((SMTRunnerConsoleView)console).getResultsViewer();
}
});
}
executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
return executionResult;
}
示例2: getConsoleView
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
public static SMTRunnerConsoleView getConsoleView(
Project project,
BlazeCommandRunConfiguration configuration,
Executor executor,
BlazeTestUiSession testUiSession) {
SMTRunnerConsoleProperties properties =
new BlazeTestConsoleProperties(configuration, executor, testUiSession);
SMTRunnerConsoleView console =
(SMTRunnerConsoleView)
SMTestRunnerConnectionUtil.createConsole(BLAZE_FRAMEWORK, properties);
Disposer.register(project, console);
console
.getResultsViewer()
.getTreeView()
.getSelectionModel()
.setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
return console;
}
示例3: attachRerunFailedTestsAction
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
public static DefaultExecutionResult attachRerunFailedTestsAction(DefaultExecutionResult result) {
ExecutionConsole console = result.getExecutionConsole();
if (!(console instanceof SMTRunnerConsoleView)) {
return result;
}
SMTRunnerConsoleView smConsole = (SMTRunnerConsoleView) console;
TestConsoleProperties consoleProperties = smConsole.getProperties();
if (!(consoleProperties instanceof BlazeTestConsoleProperties)) {
return result;
}
BlazeTestConsoleProperties properties = (BlazeTestConsoleProperties) consoleProperties;
AbstractRerunFailedTestsAction action = properties.createRerunFailedTestsAction(smConsole);
if (action != null) {
action.init(properties);
action.setModelProvider(smConsole::getResultsViewer);
result.setRestartActions(action);
}
return result;
}
示例4: execute
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
@Override
public ExecutionResult execute(Executor executor, CommandLinePatcher... patchers) throws ExecutionException {
final ProcessHandler processHandler = startProcess(getDefaultPythonProcessStarter(), patchers);
final ConsoleView console = createAndAttachConsole(configuration.getProject(), processHandler, executor);
DefaultExecutionResult executionResult = new DefaultExecutionResult(console, processHandler, createActions(console, processHandler));
PTestRerunFailedTestsAction rerunFailedTestsAction = new PTestRerunFailedTestsAction(console);
if (console instanceof SMTRunnerConsoleView) {
rerunFailedTestsAction.init(((BaseTestsOutputConsoleView) console).getProperties());
rerunFailedTestsAction.setModelProvider(() -> ((SMTRunnerConsoleView) console).getResultsViewer());
}
executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
return executionResult;
}
示例5: execute
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的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);
}
示例6: execute
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
@Nullable
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final TestConsoleProperties testConsoleProperties =
new SMTRunnerConsoleProperties(jsTestDriverConfiguration, "jsTestDriver", executor);
final CountDownLatch receivingSocketOpen = new CountDownLatch(1);
Future<ProcessData> data = attachExecutor.submit(new Callable<ProcessData>() {
public ProcessData call() throws Exception {
// Let the receiver start before we write anything to it.
receivingSocketOpen.await();
ProcessHandler processHandler = startProcess();
BaseTestsOutputConsoleView consoleView =
attachRunner(project.getName(), processHandler, testConsoleProperties, getRunnerSettings(), getConfigurationSettings());
return new ProcessData((SMTRunnerConsoleView) consoleView, processHandler);
}
});
TestListenerContext context = new TestListenerContext(data);
final RemoteTestListener listener = new RemoteTestListener(context);
testResultReceiverExecutor.submit(
new RemoteTestResultReceiver(listener, testResultPort, receivingSocketOpen));
return new DefaultExecutionResult(context.consoleView(), context.processHandler(),
createActions(context.consoleView(), context.processHandler()));
}
示例7: initConsoleView
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView,
@Nonnull final String testFrameworkName,
@javax.annotation.Nullable final TestLocationProvider locator,
final ThriftTestHandlerFactory factory,
@javax.annotation.Nullable final TestProxyFilterProvider filterProvider) {
consoleView.addAttachToProcessListener(new AttachToProcessListener() {
@Override
public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {
TestProxyPrinterProvider printerProvider = null;
if (filterProvider != null) {
printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
}
SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
attachEventsProcessors(consoleView.getProperties(), resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, locator, factory,
printerProvider);
}
});
consoleView.setHelpId("reference.runToolWindow.testResultsTab");
consoleView.initUI();
}
示例8: initConsoleView
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
/**
* @deprecated use {@link #initConsoleView(SMTRunnerConsoleView, String)} (to be removed in IDEA 16)
*/
@SuppressWarnings({"unused", "deprecation"})
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView,
@Nonnull final String testFrameworkName,
@Nullable final TestLocationProvider locator,
final boolean idBasedTreeConstruction,
@javax.annotation.Nullable final TestProxyFilterProvider filterProvider) {
consoleView.addAttachToProcessListener(new AttachToProcessListener() {
@Override
public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {
TestConsoleProperties properties = consoleView.getProperties();
SMTestLocator testLocator = new CompositeTestLocationProvider(locator);
TestProxyPrinterProvider printerProvider = null;
if (filterProvider != null) {
printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
}
SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
attachEventsProcessors(properties, resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, testLocator, idBasedTreeConstruction, printerProvider);
}
});
consoleView.setHelpId("reference.runToolWindow.testResultsTab");
consoleView.initUI();
}
示例9: createConsole
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
@NotNull
public static BaseTestsOutputConsoleView createConsole(@NotNull String testFrameworkName,
@NotNull TestConsoleProperties consoleProperties) {
String splitterPropertyName = getSplitterPropertyName(testFrameworkName);
SMTRunnerConsoleView consoleView = new SMTRunnerConsoleView(consoleProperties, splitterPropertyName);
initConsoleView(consoleView, testFrameworkName);
return consoleView;
}
示例10: createConsoleWithCustomLocator
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
/** @deprecated use {@link #createConsole(String, TestConsoleProperties)} (to be removed in IDEA 16) */
@SuppressWarnings({"unused", "deprecation"})
public static SMTRunnerConsoleView createConsoleWithCustomLocator(@NotNull String testFrameworkName,
@NotNull TestConsoleProperties consoleProperties,
ExecutionEnvironment environment,
@Nullable TestLocationProvider locator,
boolean idBasedTreeConstruction,
@Nullable TestProxyFilterProvider filterProvider) {
String splitterPropertyName = getSplitterPropertyName(testFrameworkName);
SMTRunnerConsoleView consoleView = new SMTRunnerConsoleView(consoleProperties, splitterPropertyName);
initConsoleView(consoleView, testFrameworkName, locator, idBasedTreeConstruction, filterProvider);
return consoleView;
}
示例11: initConsoleView
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
/** @deprecated use {@link #initConsoleView(SMTRunnerConsoleView, String)} (to be removed in IDEA 16) */
@SuppressWarnings({"unused", "deprecation"})
public static void initConsoleView(@NotNull final SMTRunnerConsoleView consoleView,
@NotNull final String testFrameworkName,
@Nullable final TestLocationProvider locator,
final boolean idBasedTreeConstruction,
@Nullable final TestProxyFilterProvider filterProvider) {
consoleView.addAttachToProcessListener(new AttachToProcessListener() {
@Override
public void onAttachToProcess(@NotNull ProcessHandler processHandler) {
TestConsoleProperties properties = consoleView.getProperties();
SMTestLocator testLocator = new CompositeTestLocationProvider(locator);
TestProxyPrinterProvider printerProvider = null;
if (filterProvider != null) {
printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
}
SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
attachEventsProcessors(properties,
resultsForm,
resultsForm.getStatisticsPane(),
processHandler,
testFrameworkName,
testLocator,
idBasedTreeConstruction,
printerProvider);
}
});
consoleView.setHelpId("reference.runToolWindow.testResultsTab");
consoleView.initUI();
}
示例12: attachExecutionConsole
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的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;
}
示例13: useSmRunner
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
private ExecutionResult useSmRunner(Executor executor, JUnitProcessHandler handler) {
TestConsoleProperties testConsoleProperties = new SMTRunnerConsoleProperties(
new RuntimeConfigurationProducer.DelegatingRuntimeConfiguration<JUnitConfiguration>(
(JUnitConfiguration)myEnvironment.getRunProfile()),
JUNIT_TEST_FRAMEWORK_NAME,
executor
);
testConsoleProperties.setIfUndefined(TestConsoleProperties.HIDE_PASSED_TESTS, false);
BaseTestsOutputConsoleView smtConsoleView = SMTestRunnerConnectionUtil.createConsoleWithCustomLocator(
JUNIT_TEST_FRAMEWORK_NAME,
testConsoleProperties,
myEnvironment, null);
Disposer.register(myProject, smtConsoleView);
final ConsoleView consoleView = smtConsoleView;
consoleView.attachToProcess(handler);
final RerunFailedTestsAction rerunFailedTestsAction = new RerunFailedTestsAction(consoleView);
rerunFailedTestsAction.init(testConsoleProperties, myEnvironment);
rerunFailedTestsAction.setModelProvider(new Getter<TestFrameworkRunningModel>() {
@Override
public TestFrameworkRunningModel get() {
return ((SMTRunnerConsoleView)consoleView).getResultsViewer();
}
});
final DefaultExecutionResult result = new DefaultExecutionResult(consoleView, handler);
result.setRestartActions(rerunFailedTestsAction);
return result;
}
示例14: createConsoleWithCustomLocator
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
public static SMTRunnerConsoleView createConsoleWithCustomLocator(@Nonnull final String testFrameworkName,
@Nonnull final TestConsoleProperties consoleProperties,
ExecutionEnvironment environment,
@javax.annotation.Nullable final TestLocationProvider locator,
final ThriftTestHandlerFactory factory,
@javax.annotation.Nullable final TestProxyFilterProvider filterProvider) {
String splitterPropertyName = SMTestRunnerConnectionUtil.getSplitterPropertyName(testFrameworkName);
SMTRunnerConsoleView consoleView = new SMTRunnerConsoleView(consoleProperties, splitterPropertyName);
initConsoleView(consoleView, testFrameworkName, locator, factory, filterProvider);
return consoleView;
}
示例15: createConsole
import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView; //导入依赖的package包/类
@Nonnull
public static BaseTestsOutputConsoleView createConsole(@Nonnull String testFrameworkName, @Nonnull TestConsoleProperties consoleProperties) {
String splitterPropertyName = getSplitterPropertyName(testFrameworkName);
SMTRunnerConsoleView consoleView = new SMTRunnerConsoleView(consoleProperties, splitterPropertyName);
initConsoleView(consoleView, testFrameworkName);
return consoleView;
}