从 Netbeans 6.5 升级到 Netbeans 6.7 后运行单元测试时出现问题
在选择“测试包”下的文件并执行右键单击 --> 调试或右键单击 --> 运行时,我在 Netbeans 6.7 中的 Netbeans 6.5 中遇到了问题。 报告的错误是:
java.lang.NoSuchMethodError: main
Exception in thread "main" Java Result: 1
我正在使用 JUnit 4.x,
自升级以来我没有更改任何代码,并且已在多个正在运行的项目上尝试过此操作,但我仍然遇到该问题。 我能够对整个项目执行右键单击-->测试。
由于升级,我需要进行任何更改吗?或者 Netbeans 6.7 中是否有任何问题?
I am experiencing issues with existing projects from Netbeans 6.5 in Netbeans 6.7 when selecting a file under "Test Packages" and performing a right click-->Debug, or right click-->Run. The error reported is:
java.lang.NoSuchMethodError: main
Exception in thread "main" Java Result: 1
I am using JUnit 4.x
I have not changed any code since the upgrade and have tried this on multiple projects that were working and I still experience the problem. I am able to perform right click-->Test on the entire project.
Are there any changes I would need to make due to the upgrade, or is anything broken in Netbeans 6.7?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到解决方案
如果未选中 Netbeans 6.7 中的以下设置,则测试将像在 6.5 中一样工作:
右键单击--> “项目属性”--> “构建”--> “编译”--> “保存时编译”
因此,在理解真正的问题之前,这至少是一种解决方法。
-bn
Work-around Solution Found
If the following setting in Netbeans 6.7 is not checked, the tests work as they did in 6.5:
Right Click --> "Project Properties" --> "Build" --> "Compiling" --> "Compile on Save"
So, this is at least a work-around until real issue is understood.
-bn