在 Ubuntu 上使用 Galileo eclipse 时,Junit 测试不会终止
我在 Ubuntu 上使用 Galileo Eclipse,在 Windows XP 上托管的 VirtualBox VM 内运行。
Eclipse 在 JDK 1.5 下运行(通过 -vm 命令行开关)
我正在处理的项目在 JDK 1.3 下运行(通过构建路径设置)
当我从 eclipse 中运行单元测试时(通过右键单击源文件并执行“Run as Junit Test”),测试似乎运行正常,但它永远不会完成。进度条向右移动到最大程度,并且 jUnit 窗口强烈指示它已完成,但是如果我进入“调试”视角,我可以看到 junit 进程仍在运行,这是我唯一能做的就是手动终止它。
如果我将项目 VM 更改为 java 1.5,则测试会成功。
如果我使用“正常”junit textui 运行程序从命令行运行测试,它们会成功运行。
有没有人以前遇到过,或者可以建议解决方法?我自己的谷歌尝试并没有出现太多结果。
谢谢
戴夫
I'm using Galileo Eclipse on Ubuntu running inside a VirtualBox VM hosted on Windows XP.
Eclipse is running under JDK 1.5 ( via the -vm command line switch )
The project that I am working with runs under JDK 1.3 ( set via the Build Path )
When I run a unit test from within eclipse ( by right clicking the source file and doing "Run as Junit Test"), the test seems to run properly, except it never finishes. The progress bar moves right across to its fullest extent, and the jUnit window gives a strong indication that it has finished, but if I go in to the Debug perspective I can see that the junit process is still running and the only think I can do is to terminate it manually.
If I change the project VM to java 1.5, then the tests work successfully.
If I run the tests from the command line using the "normal" junit textui runner, they work successfully.
Has anyone come across before, or can suggest a workaround? I've not turned up much on my own Google attempts.
Thanks
dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您真的需要 JDK 1.3 吗?如果是这样,您可以考虑将单元测试作为 Ant 任务来运行,而不是通过闪亮的 Eclipse GUI 来运行。
Do you really, really need JDK 1.3? If so, you may consider running your unit tests as Ant tasks rather than through the shiny Eclipse GUI.
可能是某个线程由于某种原因而保持运行状态,从而阻止 VM 终止(可能是 1.3 VM 中的错误;或者更高版本中的行为更改)。在调试模式下运行单元测试以检查进程。
It could be that a thread is left running for some reason, preventing the VM from terminating (perhaps a bug in the 1.3 VM; or a change in behaviour in later versions). Run the unit tests in debug mode to inspect the process.