use of com.intellij.execution.process.ProcessHandler in project android by JetBrains.
the class ProcessHandlerConsolePrinterTest method testSetProcessHandlerWhenConstructedWithOne.
public void testSetProcessHandlerWhenConstructedWithOne() {
ProcessHandlerConsolePrinter printer = new ProcessHandlerConsolePrinter(mock(ProcessHandler.class));
printer.stdout("stdout1");
ProcessHandler handler = mock(ProcessHandler.class);
printer.setProcessHandler(handler);
printer.stdout("stdout2");
// New messages are sent to the last-set process handler.
verify(handler).notifyTextAvailable("stdout2\n", STDOUT);
// Previous messages were not sent to the last-set process handler.
verifyNoMoreInteractions(handler);
}
use of com.intellij.execution.process.ProcessHandler in project intellij-plugins by JetBrains.
the class FlexUnitTestRunner method execute.
@Override
public void execute(@NotNull final ExecutionEnvironment env, @Nullable final Callback callback) throws ExecutionException {
final Project project = env.getProject();
final RunProfileState state = env.getState();
if (state == null) {
return;
}
Runnable startRunnable = () -> {
try {
if (project.isDisposed())
return;
final RunContentDescriptor descriptor = doExecute(state, env);
if (callback != null)
callback.processStarted(descriptor);
if (descriptor != null) {
ExecutionManager.getInstance(project).getContentManager().showRunContent(env.getExecutor(), descriptor);
final ProcessHandler processHandler = descriptor.getProcessHandler();
if (processHandler != null)
processHandler.startNotify();
}
} catch (ExecutionException e) {
ExecutionUtil.handleExecutionError(env, e);
}
};
ExecutionManager.getInstance(project).compileAndRun(startRunnable, env, state, null);
}
use of com.intellij.execution.process.ProcessHandler in project android by JetBrains.
the class ProcessHandlerConsolePrinterTest method testSetProcessHandlerRepeatedly.
public void testSetProcessHandlerRepeatedly() {
ProcessHandlerConsolePrinter printer = new ProcessHandlerConsolePrinter(null);
printer.stdout("stdout1");
printer.stderr("stderr1");
printer.setProcessHandler(mock(ProcessHandler.class));
printer.stdout("stdout2");
ProcessHandler handler = mock(ProcessHandler.class);
printer.setProcessHandler(handler);
printer.stdout("stdout3");
// New messages are sent to the last-set process handler.
verify(handler).notifyTextAvailable("stdout3\n", STDOUT);
// None of the earlier messages are sent to the last-set process handler.
verifyNoMoreInteractions(handler);
}
use of com.intellij.execution.process.ProcessHandler 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