|
62 | 62 | import org.eclipse.jdt.core.IType; |
63 | 63 | import org.eclipse.jdt.core.JavaCore; |
64 | 64 | import org.eclipse.jdt.core.JavaModelException; |
| 65 | +import org.eclipse.jdt.internal.junit.buildpath.BuildPathSupport; |
65 | 66 | import org.eclipse.jdt.internal.junit.launcher.ITestKind; |
66 | 67 | import org.eclipse.jdt.internal.junit.launcher.JUnitLaunchConfigurationConstants; |
67 | 68 | import org.eclipse.jdt.internal.junit.launcher.JUnitRuntimeClasspathEntry; |
@@ -156,6 +157,7 @@ public String showCommandLine(ILaunchConfiguration configuration, String mode, I |
156 | 157 | } |
157 | 158 | } |
158 | 159 |
|
| 160 | + @SuppressWarnings("restriction") |
159 | 161 | private VMRunnerConfiguration getVMRunnerConfiguration(ILaunchConfiguration configuration, ILaunch launch, |
160 | 162 | String mode, IProgressMonitor monitor) throws CoreException { |
161 | 163 | VMRunnerConfiguration runConfig = null; |
@@ -238,10 +240,10 @@ private VMRunnerConfiguration getVMRunnerConfiguration(ILaunchConfiguration conf |
238 | 240 | if (!configuration.getAttribute( |
239 | 241 | JUnitLaunchConfigurationConstants.ATTR_DONT_ADD_MISSING_JUNIT5_DEPENDENCY, false)) { |
240 | 242 | if (!Arrays.stream(classpath).anyMatch( |
241 | | - s -> s.contains("junit-platform-launcher") || s.contains("org.junit.platform.launcher"))) { //$NON-NLS-1$ //$NON-NLS-2$ |
| 243 | + s -> s.contains(BuildPathSupport.JUNIT_PLATFORM_LAUNCHER) || s.contains("org.junit.platform.launcher"))) { //$NON-NLS-1$ |
242 | 244 | try { |
243 | | - JUnitRuntimeClasspathEntry x = new JUnitRuntimeClasspathEntry("junit-platform-launcher", //$NON-NLS-1$ |
244 | | - null); |
| 245 | + JUnitRuntimeClasspathEntry x = new JUnitRuntimeClasspathEntry(BuildPathSupport.JUNIT_PLATFORM_LAUNCHER, |
| 246 | + null, BuildPathSupport.JUNIT_PLATFORM_VERSION); |
245 | 247 | String entryString = new ClasspathLocalizer(Platform.inDevelopmentMode()).entryString(x); |
246 | 248 | int length = classpath.length; |
247 | 249 | System.arraycopy(classpath, 0, classpath = new String[length + 1], 0, length); |
|
0 commit comments