jMock

Exceptions thrown by expectations should be caught and available for rethrowing during verification

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.4.0
  • Fix Version/s: 2.6.0
  • Component/s: JMock 2.x.x Library
  • Labels:
    None
  • Environment:
    all
  • Number of attachments :
    0

Description

At present, Mockery.assertIsSatisfied() flushes any expectations errors that have been thrown during a test but that have not stopped it. Nat and I can't think of a case where there's a good reason to do this. The effect is that if an ExpectationError is thrown but caught and dropped by the code under test, then the test will pass. What we think /should/ happen is that such exceptions should be recorded (which they are) and rethrown if still present during verification.

This would invalidate CascadedFailuresAcceptanceTests.testSuccessfulVerifyClearsFirstFailure()

Issue Links

Activity

Hide
Joerg Schaible added a comment -

For JMock 1.x I provided a solution in JMOCK-59 using a monitor approach.

Show
Joerg Schaible added a comment - For JMock 1.x I provided a solution in JMOCK-59 using a monitor approach.
Hide
Nat Pryce added a comment - - edited

The code in JMOCK-59 is addressing a different issue. This issue has nothing to do with multithreading. However, it must be implemented to make jMock report errors correctly if/when it is made thread-safe (JMOCK-213).

Show
Nat Pryce added a comment - - edited The code in JMOCK-59 is addressing a different issue. This issue has nothing to do with multithreading. However, it must be implemented to make jMock report errors correctly if/when it is made thread-safe (JMOCK-213).
Hide
Nat Pryce added a comment -

Implemented in SVN trunk

Show
Nat Pryce added a comment - Implemented in SVN trunk

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: