fitnesse not able to refer external API's in Java?
fitnesse is not able to test my application. I am working on Java and have defined three things in the class path : 1) path to fitnesse.jar 2) path开发者_如何学编程 to another jar file(xstream.jar) which my code requires. (this jar is included in the build path of my project also). 3) class path of my fixture class.
Fitnesse is showing "java.lang.NoClassDefFoundError: com/thoughtworks/xstream/XStream " can anyone please help, this thing has really made my whole work stuck up !!!
I had recentley similar problems. My resolution was to set the correct working dir. I got this work with use of the followin start bat:
call java -DBaseDir=D:\MyBaseDir -DmyPath=D:\MyBaseDir\someSubDirs\bin -DmyLibraryPath="%PATH%;.;D:\MyBaseDir\someSubDirs\lib" -jar D:\MyBaseDir\Fitnesse\fitnesse.jar -d D:\MyBaseDir\Fitnesse\ -r MySuite -p 8080
Be aware of the start parameters: -d is used for the working dir. Perhaps this gives you some further idea where to look.
It's not finding the xstream lib in your CLASSPATH, you'll need to double check that Fitnesse is picking that up.
Not sure about the reason for your errors, but I got a good start with FitNesse by using testifywizard to set up a testproject and copy the FitNesse bits afterwards.
I think this is how your classpath should be defined in FitNesse (note \ before poc):
!path D:\poc\lib\xstream.jar
Make sure you indeed have xstream.jar in D:\poc\lib folder. But you don't need to add fitnesse.jar in the classpath since it is already added by default by FitNesse framework.
After you execute your test, you can check the classpath used by FitNesse by clicking on 'Yellow Triangle' (if test fails) or 'Blue I' (if test succeeds) icon on top-right of your test wiki page.
精彩评论