IDEA-197127 Restart tests opens a new tab instead of reusing current tab

After-review refactoring
This commit is contained in:
Vassiliy.Kudryashov
2018-08-16 23:43:33 +03:00
parent 9eb47d0ffb
commit 88847465de
@@ -84,12 +84,12 @@ public abstract class ExecutionManagerImpl extends ExecutionManager implements D
return processHandler != null && !processHandler.isProcessTerminated();
}
private static void start(@NotNull ExecutionEnvironment environment) {
private static void restart(@NotNull ExecutionEnvironment environment) {
//start() can be called during restartRunProfile() after pretty long 'awaitTermination()' so we have to check if the project is still here
if (environment.getProject().isDisposed()) return;
RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings();
ProgramRunnerUtil.executeConfiguration(environment, settings != null && settings.isEditBeforeRun(), environment.getExecutionId() == 0);
ProgramRunnerUtil.executeConfiguration(environment, settings != null && settings.isEditBeforeRun(), true);
}
private static boolean userApprovesStopForSameTypeConfigurations(Project project, String configName, int instancesCount) {
@@ -418,8 +418,7 @@ public abstract class ExecutionManagerImpl extends ExecutionManager implements D
}
}
myAwaitingRunProfiles.remove(environment.getRunProfile());
environment.setExecutionId(0);// At restart we have to assign new execution ID and therefore reuse 'just stopped' contents if any
start(environment);
restart(environment);
}
}, 50);
}