Search in sources :

Example 6 with RunContentBuilder

use of com.intellij.execution.runners.RunContentBuilder 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);
}
Also used : ExecutionResult(com.intellij.execution.ExecutionResult) DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) RunContentBuilder(com.intellij.execution.runners.RunContentBuilder) Nullable(org.jetbrains.annotations.Nullable)

Example 7 with RunContentBuilder

use of com.intellij.execution.runners.RunContentBuilder 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);
}
Also used : SwfPolicyFileConnection(com.intellij.lang.javascript.flex.flexunit.SwfPolicyFileConnection) FlexUnitConnection(com.intellij.lang.javascript.flex.flexunit.FlexUnitConnection) ProcessAdapter(com.intellij.execution.process.ProcessAdapter) ProcessEvent(com.intellij.execution.process.ProcessEvent) ExecutionResult(com.intellij.execution.ExecutionResult) DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) RunContentBuilder(com.intellij.execution.runners.RunContentBuilder) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

RunContentBuilder (com.intellij.execution.runners.RunContentBuilder)7 ExecutionResult (com.intellij.execution.ExecutionResult)6 Nullable (org.jetbrains.annotations.Nullable)4 DefaultExecutionResult (com.intellij.execution.DefaultExecutionResult)3 JstdBrowserInfo (com.google.jstestdriver.idea.server.JstdBrowserInfo)2 JstdServerLifeCycleAdapter (com.google.jstestdriver.idea.server.JstdServerLifeCycleAdapter)2 CoverageEnabledConfiguration (com.intellij.execution.configurations.coverage.CoverageEnabledConfiguration)2 NopProcessHandler (com.intellij.execution.process.NopProcessHandler)2 ProcessHandler (com.intellij.execution.process.ProcessHandler)2 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)2 FlexUnitConnection (com.intellij.lang.javascript.flex.flexunit.FlexUnitConnection)2 SwfPolicyFileConnection (com.intellij.lang.javascript.flex.flexunit.SwfPolicyFileConnection)2 GoTestRunConfiguration (com.goide.runconfig.testing.GoTestRunConfiguration)1 GoTestRunningState (com.goide.runconfig.testing.GoTestRunningState)1 JstdRunConfiguration (com.google.jstestdriver.idea.execution.JstdRunConfiguration)1 JstdRunProfileState (com.google.jstestdriver.idea.execution.JstdRunProfileState)1 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)1 ProcessEvent (com.intellij.execution.process.ProcessEvent)1 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)1 Alarm (com.intellij.util.Alarm)1