When using both the VisualVM Eclipse launcher (v1.1.2) together with EclEmma (e. g.: v3.0.1.201711142128), it's impossible to run a JUnit4 test with coverage, even when using a regular Eclipse launcher.
The problem is caused by the following NPE:
!ENTRY org.eclipse.core.jobs 4 2 2018-08-28 15:12:26.783
!MESSAGE An internal error occurred during: "Launching TimeZoneTest (1)".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:188)
at org.eclipse.visualvm.launcher.java.VisualVMJUnitDelegate.launch(VisualVMJUnitDelegate.java:20)
at org.eclipse.eclemma.core.launching.CoverageLauncher.launch(CoverageLauncher.java:94)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Regular Java applications as well as TestNG tests are not affected by this problem.
The issue can be worked around by uninstalling the VisualVM launcher.
This is a known issue -- see, for example, Coverage As -> JUnit Test in Eclipse Oxygen reports NullPointerException.
When using both the VisualVM Eclipse launcher (v1.1.2) together with EclEmma (e. g.: v3.0.1.201711142128), it's impossible to run a JUnit4 test with coverage, even when using a regular Eclipse launcher.
The problem is caused by the following NPE:
Regular Java applications as well as TestNG tests are not affected by this problem.
The issue can be worked around by uninstalling the VisualVM launcher.
This is a known issue -- see, for example, Coverage As -> JUnit Test in Eclipse Oxygen reports NullPointerException.