Fitnesse 无法在 Java 中引用外部 API?
Fitnesse 无法测试我的应用程序。 我正在研究 Java,并在类路径中定义了三件事: 1)fitnesse.jar的路径 2)我的代码需要的另一个jar文件(xstream.jar)的路径。 (这个 jar 也包含在我的项目的构建路径中)。 3)我的fixture类的类路径。
Fitnesse 显示“java.lang.NoClassDefFoundError: com/thoughtworks/xstream/XStream ” 谁能帮忙,这件事真的让我的整个工作陷入困境!
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 !!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我最近也遇到了类似的问题。我的解决方案是设置正确的工作目录。我使用以下启动蝙蝠完成了这项工作:
请注意启动参数:-d 用于工作目录。也许这会让您进一步了解去哪里寻找。
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:
Be aware of the start parameters: -d is used for the working dir. Perhaps this gives you some further idea where to look.
它没有在您的 CLASSPATH 中找到 xstream 库,您需要仔细检查 Fitnesse 是否正在选择它。
It's not finding the xstream lib in your CLASSPATH, you'll need to double check that Fitnesse is picking that up.
不确定错误的原因,但我通过使用 testifywizard 在 FitNesse 上取得了良好的开端设置一个测试项目并随后复制 FitNesse 位。
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.
我认为这就是您在 FitNesse 中定义类路径的方式(注意 poc 之前的 \):
确保 D:\poc\lib 文件夹中确实有 xstream.jar。但是您不需要在类路径中添加fitnesse.jar,因为FitNesse框架已经默认添加了fitnesse.jar。
执行测试后,您可以通过单击测试 wiki 页面右上角的“黄色三角形”(如果测试失败)或“蓝色 I”(如果测试成功)图标来检查 FitNesse 使用的类路径。
I think this is how your classpath should be defined in FitNesse (note \ before poc):
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.