fix: Set working directory for TestNG project (#1100)

This commit is contained in:
Sheng Chen 2020-11-12 07:51:00 +08:00 коммит произвёл GitHub
Родитель e787e41a9b
Коммит a288922e44
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -23,6 +23,7 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
@ -228,6 +229,11 @@ public class JUnitLaunchUtils {
launchArguments.classpath = classpaths.toArray(new String[classpaths.size()]);
launchArguments.modulepath = modulepaths.toArray(new String[modulepaths.size()]);
final IPath projectLocation = javaProject.getProject().getLocation();
if (projectLocation != null) {
launchArguments.workingDirectory = projectLocation.toFile().getAbsolutePath();
}
final List<String> vmArgs = new ArrayList<>();
vmArgs.add("-ea");