gpt4 book ai didi

java - SWTBot 测试中的 SWTException : Why is it thrown in Tycho+Surefire?

转载 作者:行者123 更新时间:2023-12-01 04:29:36 33 4
gpt4 key购买 nike

我从所有 SWTBot-Test 中收到 SWTException:Invalid thread access。当它们从 eclipse 启动时,它们都会变成绿色,所以我猜问题一定出在 pom.xml 内部。怎么解决这个问题?

我在测试片段的 pom.xml 中使用以下参数和依赖项:

<!-- language: lang-xml -->
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<failIfNoTests>false</failIfNoTests>
<forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<showEclipseLog>true</showEclipseLog>
<dependencies>
<dependency>
<type>eclipse-plugin</type>
<artifactId>my.host.ui.bundle</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.hamcrest</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<type>installable-unit</type>
<artifactId>org.eclipse.ui</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>installable-unit</type>
<artifactId>org.eclipse.ui.workbench</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.swtbot.eclipse.core</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.swtbot.eclipse.finder</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.swtbot.junit4_x</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.swtbot.swt.finder</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.swtbot.eclipse.finder</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<type>p2-nstallable-unit</type>
<artifactId>org.eclipse.ui.navigator</artifactId>
<version>0.0.0</version>
</dependency>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.ui.views</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
</configuration>
</plugin>
</plugins>
</build>

最佳答案

如果你使用的是 osx,请参见。 this thread

否则,请。提供有关失败测试的更多详细信息

关于java - SWTBot 测试中的 SWTException : Why is it thrown in Tycho+Surefire?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18105947/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com