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

编写Ant脚本进行持续測试的时候。出现了junit.framework.AssertionFailedError: Forked Java VM exited abnormally的报错,以此为keyword谷歌了非常久,得到的答案差点儿都是扩大内存之类。或者设置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)程序猿的工作是让人激动的


原文地址:https://www.cnblogs.com/yjbjingcha/p/6852369.html