java - Adding Custom Messages to JUnit4 Style Exception Tests -


i have following test:

@test(expected=arithmeticexception.class)     public void dividebyzero() {    int n = 2 / 1; } 

as seen here.

i add message print if test fails.

for instance if doing assertion test, following add message:

@test public void assertfail(){     assert.fail("this error message want printed.");     assert.assertequals(true, false); } 

the second example should print out "this error message want printed.". how set first example message text?

i don't think can easily, this guy seems have partially worked way around it.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -