mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
junit: allow debug in fork mode (IDEA-121566)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.execution;
|
||||
|
||||
import com.intellij.ExtensionPoints;
|
||||
import com.intellij.debugger.impl.GenericDebuggerRunnerSettings;
|
||||
import com.intellij.execution.configurations.*;
|
||||
import com.intellij.execution.process.OSProcessHandler;
|
||||
import com.intellij.execution.process.ProcessAdapter;
|
||||
@@ -205,7 +206,7 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
|
||||
|
||||
@Nullable
|
||||
public ServerSocket getForkSocket() {
|
||||
if (myForkSocket == null && (!Comparing.strEqual(getForkMode(), "none") || forkPerModule()) && getRunnerSettings() != null) {
|
||||
if (myForkSocket == null && (!Comparing.strEqual(getForkMode(), "none") || forkPerModule())) {
|
||||
try {
|
||||
myForkSocket = new ServerSocket(0, 0, InetAddress.getByName("127.0.0.1"));
|
||||
}
|
||||
@@ -216,11 +217,16 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
|
||||
return myForkSocket;
|
||||
}
|
||||
|
||||
private boolean isExecutorDisabledInForkedMode() {
|
||||
final RunnerSettings settings = getRunnerSettings();
|
||||
return settings != null && !(settings instanceof GenericDebuggerRunnerSettings);
|
||||
}
|
||||
|
||||
protected void appendForkInfo(Executor executor) throws ExecutionException {
|
||||
final String forkMode = getForkMode();
|
||||
if (Comparing.strEqual(forkMode, "none")) {
|
||||
if (forkPerModule()) {
|
||||
if (getRunnerSettings() != null) {
|
||||
if (isExecutorDisabledInForkedMode()) {
|
||||
final String actionName = UIUtil.removeMnemonic(executor.getStartActionText());
|
||||
throw new CantRunException("'" + actionName + "' is disabled when per-module working directory is configured.<br/>" +
|
||||
"Please specify single working directory, or change test scope to single module.");
|
||||
@@ -228,7 +234,7 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else if (getRunnerSettings() != null) {
|
||||
} else if (isExecutorDisabledInForkedMode()) {
|
||||
final String actionName = executor.getActionName();
|
||||
throw new CantRunException(actionName + " is disabled in fork mode.<br/>Please change fork mode to <none> to " + actionName.toLowerCase(
|
||||
Locale.ENGLISH) + ".");
|
||||
|
||||
Reference in New Issue
Block a user