use of com.intellij.execution.ExecutionResult in project Intellij-Plugin by getgauge.
the class GaugeTestRunner method doExecute.
protected RunContentDescriptor doExecute(RunProfileState state, ExecutionEnvironment env) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();
ExecutionResult executionResult = state.execute(env.getExecutor(), this);
return executionResult == null ? null : new RunContentBuilder(executionResult, env).showRunContent(env.getContentToReuse());
}
use of com.intellij.execution.ExecutionResult in project intellij-plugins by JetBrains.
the class FlexRunner method standardLaunch.
@Nullable
private RunContentDescriptor standardLaunch(final Project project, final RunProfileState state, final RunContentDescriptor contentToReuse, final ExecutionEnvironment environment) throws ExecutionException {
final ExecutionResult executionResult = state.execute(environment.getExecutor(), this);
if (executionResult == null)
return null;
final RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, environment);
return contentBuilder.showRunContent(contentToReuse);
}
use of com.intellij.execution.ExecutionResult in project intellij-plugins by JetBrains.
the class FlexRunner method launchAirFlexUnit.
@Nullable
protected RunContentDescriptor launchAirFlexUnit(final Project project, final RunProfileState state, final RunContentDescriptor contentToReuse, final ExecutionEnvironment env, final FlexUnitRunnerParameters params) throws ExecutionException {
final ExecutionResult executionResult;
final SwfPolicyFileConnection policyFileConnection = new SwfPolicyFileConnection();
policyFileConnection.open(params.getSocketPolicyPort());
final FlexUnitConnection flexUnitConnection = new FlexUnitConnection();
flexUnitConnection.open(params.getPort());
executionResult = state.execute(env.getExecutor(), this);
if (executionResult == null) {
flexUnitConnection.close();
policyFileConnection.close();
return null;
}
flexUnitConnection.addListener(new FlexUnitListener(executionResult.getProcessHandler()));
executionResult.getProcessHandler().addProcessListener(new ProcessAdapter() {
@Override
public void processWillTerminate(ProcessEvent event, boolean willBeDestroyed) {
flexUnitConnection.write("Finish");
}
@Override
public void processTerminated(ProcessEvent event) {
flexUnitConnection.close();
policyFileConnection.close();
}
});
final RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, env);
return contentBuilder.showRunContent(contentToReuse);
}
use of com.intellij.execution.ExecutionResult in project intellij-community by JetBrains.
the class DebugProcessImpl method attachVirtualMachine.
@Nullable
public ExecutionResult attachVirtualMachine(final DebugEnvironment environment, final DebuggerSession session) throws ExecutionException {
mySession = session;
myWaitFor.down();
ApplicationManager.getApplication().assertIsDispatchThread();
LOG.assertTrue(isInInitialState());
myConnection = environment.getRemoteConnection();
createVirtualMachine(environment);
ExecutionResult executionResult;
try {
synchronized (myProcessListeners) {
executionResult = environment.createExecutionResult();
myExecutionResult = executionResult;
if (executionResult == null) {
fail();
return null;
}
for (ProcessListener processListener : myProcessListeners) {
executionResult.getProcessHandler().addProcessListener(processListener);
}
myProcessListeners.clear();
}
} catch (ExecutionException e) {
fail();
throw e;
}
if (ApplicationManager.getApplication().isUnitTestMode()) {
return executionResult;
}
return executionResult;
}
use of com.intellij.execution.ExecutionResult in project intellij-community by JetBrains.
the class RemoteProcessSupport method startProcess.
private void startProcess(Target target, Parameters configuration, @NotNull Pair<Target, Parameters> key) {
ProgramRunner runner = new DefaultProgramRunner() {
@Override
@NotNull
public String getRunnerId() {
return "MyRunner";
}
@Override
public boolean canRun(@NotNull String executorId, @NotNull RunProfile profile) {
return true;
}
};
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
ProcessHandler processHandler;
try {
RunProfileState state = getRunProfileState(target, configuration, executor);
ExecutionResult result = state.execute(executor, runner);
//noinspection ConstantConditions
processHandler = result.getProcessHandler();
} catch (Exception e) {
dropProcessInfo(key, e instanceof ExecutionException ? e.getMessage() : ExceptionUtil.getUserStackTrace(e, LOG), null);
return;
}
processHandler.addProcessListener(getProcessListener(key));
processHandler.startNotify();
}
Aggregations