【问题标题】:Headless integration tests of an eclipse plugin with maven tycho使用 maven tycho 对 Eclipse 插件进行无头集成测试
【发布时间】:2011-02-08 13:58:19
【问题描述】:

我为我的 Eclipse 插件编写了一些 Junit 测试。如果我将我的测试套件作为 Eclipse 的 "JUnit Plug-in Test" 启动,那么一切正常。 现在我想从 Maven Tycho 运行它们。

所以我在 pom.xml 中放了以下包装:"eclipse-test-plugin",集成测试以 "mvn clean 开头集成测试”。所以我觉得我的maven配置还不错。

但有些测试失败了,我怀疑无头构建无法检测到我的测试试图检测到的IMarkers,因为 IMarker 是 UI 组件。

我说的对吗?有什么想法可以让我的测试基于 IMarkers 与 Tycho 一起运行吗?

【问题讨论】:

  • 如果你能提供你从失败的测试中得到的错误,那就太好了。我发现查看target/work/configuration 文件夹下的[timestamp].log 文件通常是一个很好的起点

标签: junit eclipse-plugin maven headless tycho


【解决方案1】:

您需要告诉测试插件您要使用 UI 运行测试,默认情况下它将使用无头运行器运行。

<plugin>
  <groupId>org.eclipse.tycho</groupId>
  <artifactId>tycho-surefire-plugin</artifactId>
  <configuration>
    <useUIHarness>true</useUIHarness>
    <useUIThread>true</useUIThread>
  </configuration>
</plugin>

【讨论】:

    猜你喜欢
    • 2014-08-30
    • 1970-01-01
    • 2011-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-03
    • 1970-01-01
    相关资源
    最近更新 更多