Remote Debugging | Fitnesse with Eclipse

Posted on Wednesday, December 5, 2007

8


We use Fitnesse as the acceptance testing tool for our projects. Many a times it becomes a necessity to remotely debug how the fitnesse fixture is running through your code.

This blog would try to explain how you can easily set up a remote debugging session between Fitnesse and Eclipse so that you can debug through the code as your fixture is being executed.

In your Eclipse IDE

1. Goto Run->Open Debug Dialog

2. Right click on Remote Java Application option in the left hand menu tree and say new

3. Create a remote java application debug configuration like this

screenshot-debug.png

4. Add the sources to the configuration. These should be all your java projects.These are required so that while remotely debugging you can walk through your code

screenshot11.png

5. Now your Eclipse configuration is done. Note that we have told eclipse to listen at port 1044 and have specified all the source files that it should use for code walkthrough.

6. If you hit the debug button at this moment you would get an error. Why? because right now fitnesse is not executing and eclipse would not find anything to listen to at port 1044. Hence you would see something like this

screenshot-problem-occurred.png

7. Now add the following line to the fixture that you want to debug

!define COMMAND_PATTERN {java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044 -cp %p %m}

5. Start the test in fitnesse

6. Goto Eclipse, open Debug dialog, select the Remote java application that we just created and hit debug button.

7. The debug view would now open at the first breakpoint

Happy Debugging!

Posted in: Java, testing