diff --git a/java-extension/com.microsoft.java.test.plugin/META-INF/MANIFEST.MF b/java-extension/com.microsoft.java.test.plugin/META-INF/MANIFEST.MF index f9f385b5..6d0ba677 100644 --- a/java-extension/com.microsoft.java.test.plugin/META-INF/MANIFEST.MF +++ b/java-extension/com.microsoft.java.test.plugin/META-INF/MANIFEST.MF @@ -20,7 +20,7 @@ Require-Bundle: org.eclipse.jdt.core, org.eclipse.text, org.eclipse.ltk.core.refactoring, org.eclipse.debug.core, - org.eclipse.jdt.junit.core, + org.eclipse.jdt.junit.core;bundle-version="[3.15.0,4.0.0)", org.eclipse.jdt.junit.runtime, org.eclipse.jdt.junit4.runtime, org.eclipse.jdt.junit5.runtime, diff --git a/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/launchers/JUnitLaunchConfigurationDelegate.java b/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/launchers/JUnitLaunchConfigurationDelegate.java index c0711c5c..97f85a02 100644 --- a/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/launchers/JUnitLaunchConfigurationDelegate.java +++ b/java-extension/com.microsoft.java.test.plugin/src/main/java/com/microsoft/java/test/plugin/launchers/JUnitLaunchConfigurationDelegate.java @@ -46,8 +46,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; @@ -96,13 +94,8 @@ public Response getJUnitLaunchArguments(ILaunchConfigurati IProgressMonitor monitor) { final ILaunch launch = new Launch(configuration, mode, null); - // TODO: Make the getVMRunnerConfiguration() in super class protected. try { - final Method getVMRunnerConfiguration = getClass().getSuperclass().getDeclaredMethod( - "getVMRunnerConfiguration", ILaunchConfiguration.class, ILaunch.class, String.class, - IProgressMonitor.class); - getVMRunnerConfiguration.setAccessible(true); - final VMRunnerConfiguration config = (VMRunnerConfiguration) getVMRunnerConfiguration.invoke(this, + final VMRunnerConfiguration config = getVMRunnerConfiguration( configuration, launch, mode, new NullProgressMonitor()); final IJavaProject javaProject = getJavaProject(configuration); final JUnitLaunchArguments launchArguments = new JUnitLaunchArguments(); @@ -115,8 +108,7 @@ public Response getJUnitLaunchArguments(ILaunchConfigurati launchArguments.programArguments = parseParameters(config.getProgramArguments()); return new Response<>(launchArguments, null); - } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | - InvocationTargetException | CoreException e) { + } catch (CoreException e) { JUnitPlugin.logException("failed to resolve the classpath.", e); final String msg = e.getCause() != null ? e.getCause().getMessage() : e.getMessage(); return new Response<>(null, msg);