【发布时间】:2016-01-07 13:58:58
【问题描述】:
我使用tycho-eclipse-plugin-archetype 中的原型创建了一个简单的Eclipse 插件,其中包含一个有效的集成测试项目。除了......它没有。
当我以“JUnit Plug-in Test”开始任何测试时,我得到以下异常:
!ENTRY org.eclipse.osgi 2 0 2016-01-07 14:43:35.734
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2016-01-07 14:43:35.734
!MESSAGE Bundle initial@reference:file:../../../../../../../Users/MyName/.eclipse/org.eclipse.platform_4.5.1_2043537226_win32_win32_x86_64/plugins/org.eclipse.pde.junit.runtime_3.4.500.v20150423-1241.jar/ was not resolved.
!SUBENTRY 2 org.eclipse.pde.junit.runtime 2 0 2016-01-07 14:43:35.734
!MESSAGE Missing required bundle org.eclipse.core.runtime_[3.11.0,4.0.0).
(以及其他插件的一些类似消息。)
这很奇怪,因为我的目标平台包含 org.eclipse.pde.junit.runtime 3.4.300,而不是 3.4.500,它需要 org.eclipse.core.runtime 版本 [3.3.0,4.0.0)。测试用例的运行配置与该版本一致,并证明“未检测到问题”。
因此,从路径包含 "/org.eclipse.platform_4.5.1" 的事实来看,我假设它采用当前正在运行的 Eclipse 目标平台,即使在工作区和运行配置。
如何更改 JUnit 插件测试以采用当前活动的目标平台?
【问题讨论】: