Patches item #1711979, was opened at 2007-05-03 16:00
Message generated for change (Comment added) made by lkuehne
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397080&aid=1711979&group_id=29721
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Check for JUnit tests without asserts or fails
Initial Comment:
Hello!
This patch contains a new check wich checks all JUnit tests for contained
asserts.
A JUnit test, which does not contain an assert<type>, fail or verify (from
Easymock) could not be a wise test.
The check ist unit tested and ant gump is successful.
best regards,
Matthias
----------------------------------------------------------------------
>Comment By: Lars Kühne (lkuehne)
Date: 2007-06-06 11:39
Message:
Logged In: YES
user_id=401384
Originator: NO
Hmm... I had a quick look as well, and I found some pretty heavy
limitations in the check:
* The check is designed only for JUnit 3, not the assertion style used in
JUnit 4 or TestNG, which have both been available for quite some time now.
* The check is limited to direct descendants of TestCase. In many real
world tests, this is not the case. For example, at work my unit test
classes often extend classes like
org.springframework.test.AbstractTransactionalSpringContextTests. The
Cactus framework's org.apache.cactus.ServletTestCase base class is another
example.
* If test methods delegate to other, private helper methods in the test
class, and these helper methods call assert, you would still have the test
method flagged.
To be fair, these limitations are hard to overcome in the current
checkstyle architecture, which doesn't give you full type or control flow
information for the class that is checked. Maybe a check tool like findbugs
that operates on class files would be a better environment to implement
this feature?
----------------------------------------------------------------------
Comment By: Oliver Burn (oburn)
Date: 2007-06-04 05:21
Message:
Logged In: YES
user_id=218824
Originator: NO
I had a look at the patch and it looks great....except it is missing
documentation. Could you please create documentation under
src/xdocs/config_misc.xml
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397080&aid=1711979&group_id=29721
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Checkstyle-devel mailing list
Checkstyle-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/checkstyle-devel
|