#测试相关#Getting “junit.framework.AssertionFailedError: Forked Java VM exited abnormally” Exception

来源:互联网 发布:小米6抢购软件 编辑:程序博客网 时间:2024/06/11 05:26

编写Ant脚本进行持续测试的时候,出现了junit.framework.AssertionFailedError: Forked Java VM exited abnormally的报错,以此为关键字谷歌了很久,得到的答案几乎都是扩大内存之类,或者设置junit标签的fork为no的,试过了均是无效。

其实这个提示是不够精准的。

I faced similar issue. I ran junit tests as ant task. Added showoutput="yes" ant junit property and ran the ant junit task. It then showed the exception stacktrace which caused the forked jvm to exit.(http://stackoverflow.com/questions/1846329/forked-java-vm-exited-abnormally-error-from-junit-tests)

上面的话来自stackoverflow,意思在junit标签设置showoutput为yes,让Ant可以在控制台显示出Test时的信息,从而可以得到错误信息。

我在自己的测试中,使用了此方法,后来发现竟然是数据库连接Confused的问题。数据库与VM内存,是没有直接关系的。

以上得到两点:1)StackOverFlow是个好网站;2)程序员的工作是让人激动的


1 0