-
Website
http://www.brodwall.com/johannes/blog/ -
Original page
http://www.brodwall.com/johannes/blog/2008/03/19/some-fitnesse-tricks-classpath-and-debugging/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Andy Palmer
1 comment · 1 points
-
Affordable SEO Services
1 comment · 1 points
-
anderssv
3 comments · 1 points
-
eirikma
2 comments · 1 points
-
vidar
1 comment · 1 points
-
-
Popular Threads
-
Å trene på Java EE
3 weeks ago · 1 comment
-
Å trene på Java EE
We include the pom in the Fitnesse page by writing "!pom path_to_the_pom_he_fixtures_were_built_from/pom.xml". See http://boss.bekk.no/fitnesse-pom-widget/usage.html
Now you may set up a debugger in eclipse. Java Application->new->
Main class: fitnesse.runner.TestRunner
Arguments: localhost 8091 YourWikiPathToTestOrSuite -v -html fitnesse.html
Bonus tip to your many readers: add "-e 0" to the startup of your FitNesse server to avoid those dreadful zips. Isn't FitNesse intuitive?
Three reasons why I don't like solutions like the fitnesse-pom-widget:
1. You have to install fitnesse yourself. PLUS: You have to micky around with the installation. For me, maven is my only installer
2. You have to start up stuff with special commands and stuff. For me, Eclipse is my only application runner.
3. You still have to specify a path to the pom that will vary from workstation to workstation in your tests. For me, there is no changes when you relocate the workspace.
Close, but no cigar.
The debugger is nice, but the result of running the test won't be displayed in your web browser, right?
java -cp fitnesse.jar;lib\fitnesse-pom-widget-1.0-SNAPSHOT.jar;lib\maven-embedder-2.0.4-dep.jar fitnesse.FitNesse -p 8091 -r FitNesseRoot -l logs -o -e 0
Guess you'd find a way to execute the fitness server from Eclipse, but I don't see why. It uses near to nothing of resources and don't need to be restarted to notice updates. A simple .bat or .sh is good enough.
RELOCATION
I presume you have your fixtures in source control, why not have fitnesse ialongside it? They definetly belong together.
/trunk/fitnesse
/trunk/fixtures (or wherever the fixtures are located)
Then you may use the relative path "!pom ../fixtures/pom.xml"
DEBUGGER
The option -html fitnesse.html in the debugger outputs the results in the same manner as pressing Test in the fitnesse page.
Sadly, there is no cigar with FitNesse. I say, use it to communicate requirements, supplement with a few test tables. It's a wiki, terrible to maintain and opposes refactoring. I've committed my share of sins. Do you have any rules/guidelines for this Johannes?
Anyway, you seem to have found a good solution for running FitNesse for a Maven project. I still think there's cases where the pom widget is useful, especially when having a common FitNesse server installation and multiple projects within it.
As for me, I've left FitNesse and use plain Fit instead. We use Excel spreadsheets as the source and convert them to HTML tables when the tests are run. Then our build run Fit with these converted HTML tables. It's fast, simple and more importantly, just what we need.
Using plain old Fit is indeed an option that I considered, too. But now I am actually glad I didn't. I hope you'll like to try out the code from this article.
FitNesse is definitely not designed with embedding and extending in mind. But when I was willing to dive into it, I found it wasn't that bad. I really wish my "trick" with writing my own main class was closer to the intended use, though.
!path {java.class.path}
You get the classpath that fitnesse was called with, without the need for changing the fitnesse code.
Also, if you create a page with the following (eg. .DebugSettings)
!define COMMAND_PATTERN {java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044 -cp %p %m}
Then, on pages you want to debug, you can just add
!include .DebugSettings
not as nice as a Debug responder, but solves the problem without writing code for FitNesse.