mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't allow griffon's debugger runner to override the generic one in the test
This commit is contained in:
+5
-6
@@ -211,29 +211,28 @@ public abstract class GroovyCompilerTestCase extends JavaCodeInsightFixtureTestC
|
||||
|
||||
protected void assertOutput(String className, String expected, final Module module) throws ExecutionException {
|
||||
final StringBuffer sb = new StringBuffer();
|
||||
ProcessHandler process = runProcess(className, module, DefaultRunExecutor.class, DefaultJavaProgramRunner.class, new ProcessAdapter() {
|
||||
ProcessHandler process = runProcess(className, module, DefaultRunExecutor.class, new ProcessAdapter() {
|
||||
@Override
|
||||
public void onTextAvailable(ProcessEvent event, Key outputType) {
|
||||
if (ProcessOutputTypes.SYSTEM != outputType) {
|
||||
sb.append(event.getText());
|
||||
}
|
||||
}
|
||||
});
|
||||
}, ProgramRunner.PROGRAM_RUNNER_EP.findExtension(DefaultJavaProgramRunner.class));
|
||||
process.waitFor();
|
||||
assertEquals(expected.trim(), StringUtil.convertLineSeparators(sb.toString().trim()));
|
||||
}
|
||||
|
||||
protected ProcessHandler runProcess(String className,
|
||||
Module module,
|
||||
final Class<? extends Executor> executorClass,
|
||||
final Class<? extends ProgramRunner> runnerClass, final ProcessListener listener) throws ExecutionException {
|
||||
Module module,
|
||||
final Class<? extends Executor> executorClass,
|
||||
final ProcessListener listener, final ProgramRunner runner) throws ExecutionException {
|
||||
final ApplicationConfiguration configuration = new ApplicationConfiguration("app", getProject(), ApplicationConfigurationType.getInstance());
|
||||
configuration.setModule(module);
|
||||
configuration.setMainClassName(className);
|
||||
final Executor executor = Executor.EXECUTOR_EXTENSION_NAME.findExtension(executorClass);
|
||||
final ExecutionEnvironment environment = new ExecutionEnvironment(configuration, getProject(),
|
||||
new RunnerSettings<JDOMExternalizable>(null, null), null, null);
|
||||
final ProgramRunner runner = ProgramRunner.PROGRAM_RUNNER_EP.findExtension(runnerClass);
|
||||
final Semaphore semaphore = new Semaphore();
|
||||
semaphore.down();
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.intellij.execution.process.ProcessAdapter
|
||||
import com.intellij.testFramework.builders.JavaModuleFixtureBuilder
|
||||
import com.intellij.util.concurrency.Semaphore
|
||||
import org.jetbrains.plugins.groovy.debugger.GroovyPositionManager
|
||||
import com.intellij.execution.runners.ProgramRunner
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
@@ -75,7 +76,8 @@ class GroovyDebuggerTest extends GroovyCompilerTestCase {
|
||||
private void runDebugger(Closure cl) {
|
||||
make()
|
||||
edt {
|
||||
runProcess('Foo', myModule, DefaultDebugExecutor, GenericDebuggerRunner, [onTextAvailable:{ evt, type -> /*print evt.text*/}] as ProcessAdapter)
|
||||
ProgramRunner runner = ProgramRunner.PROGRAM_RUNNER_EP.extensions.find { it.class == GenericDebuggerRunner }
|
||||
runProcess('Foo', myModule, DefaultDebugExecutor, [onTextAvailable: { evt, type -> print evt.text}] as ProcessAdapter, runner)
|
||||
}
|
||||
cl.call()
|
||||
resume()
|
||||
@@ -108,7 +110,7 @@ class GroovyDebuggerTest extends GroovyCompilerTestCase {
|
||||
}
|
||||
|
||||
def context = suspendManager.pausedContext
|
||||
assert context : 'too long process'
|
||||
assert context : "too long process, terminated=$debugProcess.executionResult.processHandler.processTerminated"
|
||||
return context
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user