在Eclipse Junit测试运行器中挂起未捕获的运行时异常 [英] Suspend on uncaught runtime exceptions in Eclipse Junit test runner

查看:145
本文介绍了在Eclipse Junit测试运行器中挂起未捕获的运行时异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试Junit测试期间,Eclipse不会挂起未捕获的运行时异常。我试过:




  • JRE 1.6更新15和16

  • Eclipse 3.5.0和Eclipse 3.4.2

  • 检查挂起未捕获的异常异常和所有运行时异常

  • 选中调试后运行测试运行后保持JUnit

  • 仅运行测试方法和整个测试类时调试

  • 建议这里 here



全部无效。



没有testrunner的调试(即:通过一个具有自己的main方法的类)工作,即:eclipse挂起发生异常的行。

解决方案

您尝试将 -consolelog 添加到您的 eclipse.ini 文件,并检查您的JUnit会话在哪里生成?

这个线程,OP实现了他的xml文件是指错误的测试课程。


Eclipse is not suspending on an uncaught runtime exception during debugging of a Junit test. I've tried:

  • JRE 1.6 update 15 and 16
  • Eclipse 3.5.0 and Eclipse 3.4.2
  • Checked "Suspend on uncaught exception" for the exception and all runtime exceptions
  • Checked "Keep JUnit running after a test run when debugging"
  • Debugging when running only the test method, and the entire test class
  • Suggestions here and here

All to no avail.

Debugging without the testrunner (ie: via a class with its own main method) works, ie: eclipse suspends on the line where the exception occurs.

解决方案

Did you try adding -consolelog to your eclipse.ini file and check what your JUnit session produce there?
In this thread, the OP realized his xml file was referring to the wrong testing class.

这篇关于在Eclipse Junit测试运行器中挂起未捕获的运行时异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆