jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • jMock
  • JMOCK-258

Extend the @Mock annotation to be able to also specify expectations.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.5.1
  • Fix Version/s: None
  • Component/s: JMock 2.x.x Library
  • Labels:
    None

Description

For example,

@Mock(Never.class)
private SomeCollaborator collaborator;

where:

public class Never implements MockExpectations {

@Override
public void apply(Mockery context, final Object mock) {
context.checking( new Expectations() {{ never(mock); }} );
}
}

The idea here is that Never, Ignoring, Allowing etc would be predefined implementations of MockExpectations, but that also developers could write their own implemnetations. One could also, perhaps, allow multiple expectations to be combined, eg:

@Mock(AllowingSomething.class, ButAfterThatNothing.class)
private SomeCollaborator collaborator;

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Unassigned
    Reporter:
    Dan Haywood
Vote (0)
Watch (0)

Dates

  • Created:
    20/Dec/11 5:19 PM
    Updated:
    20/Dec/11 5:19 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.