How can I debug test cases executed by Tycho?

When using Tycho to create a project, test cases are run in a new process by launching a launch vehicle to run -application org.eclipse.tycho.surefire.osgibooter.headlesstest .

How to debug test cases?

+4
source share
2 answers

There is a much simpler way to do this:

just add -DdebugPort=8000 to your Maven command line and join a remote debugging session.

See the docs http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#debugPort

+6
source

Add this to your 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> 

Now you can enable debugging using mvn ... -P debug when printing the following line:

Listening to the dt_socket transport at: 8000

See Eclipse for help setting up an IDE .

+2
source

Source: https://habr.com/ru/post/1401595/


All Articles