SWTException в SWTBot-Test: почему он выдается в Tycho+Surefire?
Я получаю SWTException:Invalid thread access
из всех моих SWTBot-тестов. Все они становятся зелеными, когда начинаются с затмения, поэтому проблема должна быть внутри 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>
2 ответа
Как вы скажете наверняка, какие тесты для вас? Вы настроили следующее?
<configuration>
...
<testSuite>bundle.symbolic.name.of.test.plugin</testSuite>
<testClass>package.of.test.suite.YourTestSuiteOrClass</testClass>
...
</configuration>
Если вы на OSX, ср. эта тема
в противном случае, пожалуйста. предоставить более подробную информацию о провале теста