“Forked Java VM exited abnormally” error from junit tests

前端 未结 17 1729
[愿得一人]
[愿得一人] 2020-12-08 18:22

I have a java junit test that passes when run alone on a development machine. We also have a hudson job which runs all the tests, invoked via ant, on a Mac OS X 10.4 node wi

17条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 19:04

    This can occur when an uncaught RuntimeException is thrown. Unfortunately, the junit ant task doesn't output the exception so there isn't an easy way to determine the root cause. You can work around this by running the test case from the command line where the exception will be shown.

    java  org.junit.runner.JUnitCore 
    

    In my case, an IllegalArgumentException was being thrown.

提交回复
热议问题