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
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
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
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!
Nimesh
Tuesday, June 9, 2009
Hey,
Thanx for the info it helped me a lot
Regards,
Nimesh
vikashazrati
Wednesday, June 10, 2009
Great that you found it useful Nimesh.
Vincent Partington
Wednesday, June 10, 2009
Hey Vikas, thanks for this blog. It really helped us out!
See you soon. 🙂
Regards, Vincent.
vikashazrati
Thursday, June 11, 2009
Glad this helped Vincent 🙂
Best Regards
Max
Tuesday, July 7, 2009
Thanks for this info, easy to follow and helped a lot …
Max
Massimo
Monday, February 8, 2010
Hi, this info was quite usefull! I only wish to point out that for my configuration (fitNesse 20090818) I have to use REMOTE_DEBUG_COMMAND instead of COMMAND_PATTERN.
Massimo
Kevin Vranken
Tuesday, March 16, 2010
Would just like to add that I needed to include fitnesse.jar on all my fixtures to get this to work.
Just add
!path C:\path in order to reach\FitNesse\fitnesse.jar
before
!define COMMAND_PATTERN {java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044 -cp %p %m}
Hema
Wednesday, March 30, 2011
Thanks for your post. I am on the way of debugging Fitnesse, and I could not able to.
1) What is the “address” filed we are referring to.Actually my Tomcat is running in ‘8081’ port and my Db is running in ‘1521’ then which one i need to use and why.Please help me out.
2) In 5th point mentioned that we need to start the fitnesse, by the time I come here to eclipse it will runout right ? I know this might look silly but I am very new to this just started in my organization.
Thanks in advance!
Hema