History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-15001
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Bas Leijdekkers
Reporter: Taras Tielkes
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

'Test contains no assertions' inspection should understand JMock usage

Created: 16 Jan 07 15:09   Updated: 01 Mar 07 18:24
Component/s: Code Analysis. Inspection
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 6,148


 Description  « Hide
Two things to support (meaning: not trigger "contains no assertions" warning):
1) JMock "assertThat" syntax: http://joe.truemesh.com/blog/000511.html
Treat these as present assertions.

2) Understand that JMock expectations are verified after the test runs.
Often my unit tests using JMock expectations contain no further assertions.
For an example unit test see: http://jmock.org/getting-started.html



 All   Comments   Work Log   Change History      Sort Order:
Taras Tielkes - 16 Jan 07 17:43
It seems that my first point is already covered, since the inspection checks for "assertXXX" methods, thus matching the "assertThat" construct.

Taras Tielkes - 26 Jan 07 02:01
Bas, I think checking for presence of org.jmock.Mock#expects calls would satisfy point (2)

Taras Tielkes - 26 Jan 07 02:16
Wait, that last comment only applies when the testcase subclasses some specific JMock (auto-verifying) base class. Let me think about this some more.