title: JUnit Plug-in Test Ignores Target Platform in Eclipse Neon
body: <p>I have some problems getting JUnit plug-in tests to work using Eclipse Neon M7 and I'd really like input from anybody out there who uses tests (there has to be <em>somebody</em>, right?).</p>
  
  <p>Whenever I start a test that works in Eclipse Luna (but <a href="https://stackoverflow.com/questions/34657010/junit-plug-in-tests-ignoring-target-platform">didn't in Mars</a>, which I assumed was a bug) and continues to work using Tycho I get the following exception:</p>
  
  <pre><code>!SESSION 2016-05-11 10:25:41.456 -----------------------------------------------
  eclipse.buildId=unknown
  java.version=1.8.0_73
  java.vendor=Oracle Corporation
  BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
  Framework arguments:  -version 3 -port 60297 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.acme.test.test.core.ActivatorTest -application org.eclipse.pde.junit.runtime.uitestapplication -testApplication org.eclipse.ui.ide.workbench -testpluginname test.core
  Command-line arguments:  -os win32 -ws win32 -arch x86 -consoleLog -version 3 -port 60297 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames org.acme.test.test.core.ActivatorTest -application org.eclipse.pde.junit.runtime.uitestapplication -testApplication org.eclipse.ui.ide.workbench -data C:\workspaces\MyWorkspace/../junit-workspace -dev file:C:/workspaces/MyWorkspace/.metadata/.plugins/org.eclipse.pde.core/pde-junit/dev.properties -os win32 -ws win32 -arch x86 -consoleLog -testpluginname test.core
  
  !ENTRY org.eclipse.pde.junit.runtime 4 0 2016-05-11 10:25:42.373
  !MESSAGE FrameworkEvent ERROR
  !STACK 0
  org.osgi.framework.BundleException: Could not resolve module: org.eclipse.pde.junit.runtime [81]
    Unresolved requirement: Require-Bundle: org.eclipse.core.runtime; bundle-version="[3.11.0,4.0.0)"
  
      at org.eclipse.osgi.container.Module.start(Module.java:434)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
      at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
      at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
      at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
  
  !ENTRY org.eclipse.pde.junit.runtime 2 0 2016-05-11 10:25:42.719
  !MESSAGE Could not resolve module: org.eclipse.pde.junit.runtime [81]
    Unresolved requirement: Require-Bundle: org.eclipse.core.runtime; bundle-version="[3.11.0,4.0.0)"
  
  
  !ENTRY org.eclipse.osgi 4 0 2016-05-11 10:25:42.720
  !MESSAGE Application error
  !STACK 1
  java.lang.RuntimeException: Application "org.eclipse.pde.junit.runtime.uitestapplication" could not be found in the registry. The applications available are: org.eclipse.ant.core.antRunner, org.eclipse.ui.ide.workbench, org.eclipse.help.base.infocenterApplication, org.eclipse.help.base.helpApplication, org.eclipse.help.base.indexTool, org.acme.test.rxp.rxpdemo, org.eclipse.equinox.app.error.
      at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:248)
      at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
  </code></pre>
  
  <p>Clearly it's not a Eclipse bug at this point, but I'm doing something wrong. There is no indication what kind of plug-ins are started in the test, but judging from the version ranges I assume it's the wrong ones again - the plug-ins of the running Eclipse instance instead of the plug-ins defined in the workspace's target platform.</p>
  
  <p>Still the launch configuration claims the later target platform is used. </p>
  
  <p>How do I configure a plug-in unit test so that it will take the currently active target platform?</p>