> I use JUnit in Eclipse 3.0. When an assert (java keyword) fail, the
> test go on instead of terminate with an error. How can I detect an
> assert failure in tests?
Have you enabled assertions in the JRE that Eclipse is using? (By
default they are disabled.) If you don't, then assertion failures will
do nothing, whether you invoke code from JUnit or not.
Try invoking the code from main() and running that within Eclipse. Does
the assertion failure stop the virtual machine? Probably not.
Unfortunately, since I don't use 'assert' I don't know exactly how to do
this in Eclipse. Read the documentation or search the web for details.
--
J. B. (Joe) Rainsberger
Diaspar Software Services
http://www.diasparsoftware.com
Author, JUnit Recipes: Practical Methods for Programmer Testing
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/junit/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
