EasyMock

Partial mocking: Difficulties with covariant return types

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.0
  • Fix Version/s: 3.1
  • Component/s: Core
  • Labels:
    None

Description

We are experiencing difficulties when trying to (partially) mock methods with covariant return types. EasyMock sees both methods (the overridden and overriding one) and throws an exception or behaves JRE-dependant.
The attached test case show the different failures.
Maybe this is a Java bug, but possibly EasyMock could work around it.

Best regards
Marcel Freese

Activity

Hide
Henri Tremblay added a comment -

The problem comes from bridge methods. They should not be ignored by addMockedMethod which should find the real method instead of the bridge.

Filtering the bridge methods seems to solve it all.

Show
Henri Tremblay added a comment - The problem comes from bridge methods. They should not be ignored by addMockedMethod which should find the real method instead of the bridge. Filtering the bridge methods seems to solve it all.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: