如何调试 Tycho 运行的测试用例?
-
16-12-2019 - |
题
当使用Tycho构建项目时,测试用例在使用Equinox启动器运行的新进程中运行 -application org.eclipse.tycho.surefire.osgibooter.headlesstest
.
如何调试测试用例?
解决方案
有一种更简单的方法可以实现此目的:
只需添加 -DdebugPort=8000
到您的 Maven 命令行并附加远程调试会话。
请参阅文档 http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#debugPort
其他提示
将此添加到pom:
<profiles>
<profile>
<id>debug</id>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<argLine>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
.
现在,当打印以下行时,您可以启用mvn ... -P debug
的调试:
在地址处收听运输DT_Socket:8000
请参阅 Eclipse帮助如何配置IDE 。不隶属于 StackOverflow