use of com.intellij.execution.testframework.autotest.ToggleAutoTestAction in project intellij-community by JetBrains.
the class PythonTestCommandLineStateBase method execute.
@Override
public ExecutionResult execute(Executor executor, PythonProcessStarter processStarter, CommandLinePatcher... patchers) throws ExecutionException {
final ProcessHandler processHandler = startProcess(processStarter, patchers);
final ConsoleView console = createAndAttachConsole(myConfiguration.getProject(), processHandler, executor);
DefaultExecutionResult executionResult = new DefaultExecutionResult(console, processHandler, createActions(console, processHandler));
PyRerunFailedTestsAction rerunFailedTestsAction = new PyRerunFailedTestsAction(console);
if (console instanceof SMTRunnerConsoleView) {
rerunFailedTestsAction.init(((BaseTestsOutputConsoleView) console).getProperties());
rerunFailedTestsAction.setModelProvider(() -> ((SMTRunnerConsoleView) console).getResultsViewer());
}
executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
return executionResult;
}
use of com.intellij.execution.testframework.autotest.ToggleAutoTestAction in project intellij-community by JetBrains.
the class JavaTestFrameworkRunnableState method execute.
@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final RunnerSettings runnerSettings = getRunnerSettings();
final SMTRunnerConsoleProperties testConsoleProperties = getConfiguration().createTestConsoleProperties(executor);
testConsoleProperties.setIfUndefined(TestConsoleProperties.HIDE_PASSED_TESTS, false);
final BaseTestsOutputConsoleView consoleView = SMTestRunnerConnectionUtil.createConsole(getFrameworkName(), testConsoleProperties);
final SMTestRunnerResultsForm viewer = ((SMTRunnerConsoleView) consoleView).getResultsViewer();
Disposer.register(getConfiguration().getProject(), consoleView);
final OSProcessHandler handler = createHandler(executor);
consoleView.attachToProcess(handler);
final AbstractTestProxy root = viewer.getRoot();
if (root instanceof TestProxyRoot) {
((TestProxyRoot) root).setHandler(handler);
}
handler.addProcessListener(new ProcessAdapter() {
@Override
public void startNotified(ProcessEvent event) {
if (getConfiguration().isSaveOutputToFile()) {
final File file = OutputFileUtil.getOutputFile(getConfiguration());
root.setOutputFilePath(file != null ? file.getAbsolutePath() : null);
}
}
@Override
public void processTerminated(ProcessEvent event) {
Runnable runnable = () -> {
root.flushOutputFile();
deleteTempFiles();
clear();
};
UIUtil.invokeLaterIfNeeded(runnable);
handler.removeProcessListener(this);
}
});
AbstractRerunFailedTestsAction rerunFailedTestsAction = testConsoleProperties.createRerunFailedTestsAction(consoleView);
LOG.assertTrue(rerunFailedTestsAction != null);
rerunFailedTestsAction.setModelProvider(() -> viewer);
final DefaultExecutionResult result = new DefaultExecutionResult(consoleView, handler);
result.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction() {
@Override
public boolean isDelayApplicable() {
return false;
}
@Override
public AbstractAutoTestManager getAutoTestManager(Project project) {
return JavaAutoRunManager.getInstance(project);
}
});
JavaRunConfigurationExtensionManager.getInstance().attachExtensionsToProcess(getConfiguration(), handler, runnerSettings);
return result;
}
use of com.intellij.execution.testframework.autotest.ToggleAutoTestAction in project intellij-plugins by JetBrains.
the class JstdRunProfileState method executeWithServer.
@NotNull
public ExecutionResult executeWithServer(@Nullable JstdServer ideServer) throws ExecutionException {
if (!myRunSettings.isExternalServerType() && ideServer == null) {
throw new ExecutionException("[Internal error] Local JsTestDriver server running in IDE not found");
}
ProcessHandler processHandler = createProcessHandler(ideServer);
ConsoleView consoleView = createSMTRunnerConsoleView(ideServer);
consoleView.attachToProcess(processHandler);
DefaultExecutionResult executionResult = new DefaultExecutionResult(consoleView, processHandler);
executionResult.setRestartActions(new ToggleAutoTestAction());
return executionResult;
}
use of com.intellij.execution.testframework.autotest.ToggleAutoTestAction in project intellij-plugins by JetBrains.
the class DartTestRunningState method execute.
@Override
@NotNull
public ExecutionResult execute(@NotNull final Executor executor, @NotNull final ProgramRunner runner) throws ExecutionException {
final ProcessHandler processHandler = startProcess();
final ConsoleView consoleView = createConsole(getEnvironment());
consoleView.attachToProcess(processHandler);
final DefaultExecutionResult executionResult = new DefaultExecutionResult(consoleView, processHandler, createActions(consoleView, processHandler, executor));
if (ActionManager.getInstance().getAction("RerunFailedTests") != null) {
DartConsoleProperties properties = (DartConsoleProperties) ((SMTRunnerConsoleView) consoleView).getProperties();
AbstractRerunFailedTestsAction rerunFailedTestsAction = properties.createRerunFailedTestsAction(consoleView);
assert rerunFailedTestsAction != null;
rerunFailedTestsAction.setModelProvider(((SMTRunnerConsoleView) consoleView)::getResultsViewer);
executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
} else {
executionResult.setRestartActions(new ToggleAutoTestAction());
}
return executionResult;
}
use of com.intellij.execution.testframework.autotest.ToggleAutoTestAction in project intellij-plugins by JetBrains.
the class KarmaRunProfileState method executeWithServer.
@NotNull
public ExecutionResult executeWithServer(@NotNull Executor executor, @NotNull KarmaServer server) throws ExecutionException {
server.getWatcher().flush();
KarmaExecutionSession session = new KarmaExecutionSession(myProject, myRunConfiguration, executor, server, myRunSettings, myExecutionType);
SMTRunnerConsoleView smtRunnerConsoleView = session.getSmtConsoleView();
ProcessHandler processHandler = session.getProcessHandler();
// TODO make smtRunnerConsoleView instance of LanguageConsoleView to make it more usage for debugging
DefaultExecutionResult executionResult = new DefaultExecutionResult(smtRunnerConsoleView, processHandler);
executionResult.setRestartActions(new ToggleAutoTestAction());
return executionResult;
}
Aggregations