Debugging junit test that spawns forked process
Answered
I am trying to debug a junit test in which the junit runner is PaxExam.
The PaxExam creates a forked OSGi container when starting up, with a specific debug port that I can choose myself. But seeing as this is a forked process, the debugger won't hit my breakpoint when executing the junit test. The only way to achieve this is by quickly running the remote debugger attachment when starting the junit test, but this is pretty cumbersome and if I am too slow to attach it, my test has already finished.
Anyone know for a working solution to make it work that it will automatically also attach the remote debugger to the port when starting the junit test / forked container inside the junit test.
Please sign in to leave a comment.
You can try the Compound Run/Debug configuration: https://www.jetbrains.com/help/idea/2016.3/run-debug-configuration-compound.html. It can start JUnit runner and Remote configuration at the same time.
Hey Serge,
Hmm, this doesn't seem to do anything more than running the test. No console or popup about the "Remote" configuration going active. I added the JUnit runner and the remote debugger in attach with the correct port. Even if I let the forked container start in suspension mode like the following, it still doesnt start the remote debugger:
Greets,
Roy