在Eclipse中,失败时如何查看Assert.assertEquals的输入? [英] In Eclipse, how do I see the input to Assert.assertEquals when it fails?
问题描述
我不是Eclipse专家,所以请原谅我的笨拙.
I'm not much of an Eclipse guru, so please forgive my clumsiness.
在Eclipse中,当我调用Assert.assertEquals(obj1,obj2)失败时,如何使IDE向我显示obj1和obj2?
In Eclipse, when I call Assert.assertEquals(obj1,obj2) and that fails, how do I get the IDE to show me obj1 and obj2?
我正在使用 JExample ,但我想那不应该做出改变.
I'm using JExample, but I guess that shouldn't make a difference.
编辑:这是我看到的内容:
(来源: yfrog.com )
Edit: Here's what I see:
(source: yfrog.com)
.
推荐答案
如果JUnit视图中的信息不足以满足您的需求,则可以始终在例如java.lang.AssertionError上设置异常断点.运行测试时,调试器将在实际引发异常之前立即停止.
If the information in the JUnit view is not enough for you, you can always set a exception breakpoint on, for example, java.lang.AssertionError. When running the test, the debugger will stop immediately before the exception is actually being thrown.
这篇关于在Eclipse中,失败时如何查看Assert.assertEquals的输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!