【问题标题】:Maven/Tycho SWTBot Eclipse RCPMaven/Tycho SWTBot Eclipse RCP
【发布时间】:2018-05-16 12:33:46
【问题描述】:

我想使用 Maven/Tycho 运行我的 UI 测试 SWTBot,但 Tycho 无法获取我的 .product。 这是我的日志:

!ENTRY org.eclipse.equinox.app 0 0 2017-12-02 16:36:32.573
!MESSAGE Product tychodemo.bundle.product could not be found.
***WARNING: Display must be created on main thread due to Cocoa restrictions.

!ENTRY org.eclipse.osgi 4 0 2017-12-02 16:36:32.760
!MESSAGE Application error
!STACK 1
...

这是我的 pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>tychodemo.swtbot.test</artifactId>
  <packaging>eclipse-test-plugin</packaging>
  <parent>
    <groupId>tychodemo</groupId>
    <artifactId>tychodemo.parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../tychodemo.parent</relativePath>
  </parent>
  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-surefire-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <useUIHarness>true</useUIHarness>
          <useUIThread>false</useUIThread>
          <!-- use our product and application to launch the tests -->
          <product>tychodemo.bundle.product</product>
          <application>org.eclipse.e4.ui.workbench.swt.E4Application</application>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

这是放置我的 .product 的正确位置吗?

谢谢你, 安托万

【问题讨论】:

  • 您能否发布“应用程序错误”的整个堆栈跟踪?测试是否从 IDE 运行?
  • 我在 cas(终端和 ide)都有这个问题,这是我的整个 log
  • 这是我的project

标签: maven user-interface eclipse-rcp tycho swtbot


【解决方案1】:

错误似乎表明issue on the MacOS platform

要在 Mac 上启动测试,您需要在单独的配置文件中指定 -XstartOnFirstThread 命令行选项:

<profile>
  <id>macosx</id>
  <activation>
    <os>
      <name>macosx</name>
      <family>mac</family>
    </os>
  </activation>
  <properties>
    <ui.test.vmargs>-Xmx512m -XX:MaxPermSize=256m -XstartOnFirstThread</ui.test.vmargs>
  </properties>
</profile>

【讨论】:

    猜你喜欢
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-04
    • 2018-02-22
    • 2018-02-10
    • 1970-01-01
    • 2013-07-13
    相关资源
    最近更新 更多