« Return to Thread: [jira] Created: (JMOCK-222) An ability to use annotation to create mock objects

[jira] Commented: (JMOCK-222) An ability to use annotation to create mock objects

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View in Thread


    [ http://jira.codehaus.org/browse/JMOCK-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=174026#action_174026 ]

Steve Freeman commented on JMOCK-222:
-------------------------------------

it's true that we trigger a certain amount of repetitive code which mockito, for one, avoids with annotations.

My problem with this suggestion is that for it to work I'd have to turn off the compiler warning about using uninitialised values. I've developed a habit of making as many fields final as possible to reduce mutability.

> An ability to use annotation to create mock objects
> ---------------------------------------------------
>
>                 Key: JMOCK-222
>                 URL: http://jira.codehaus.org/browse/JMOCK-222
>             Project: jMock
>          Issue Type: Improvement
>          Components: JMock 2.x.x Library
>    Affects Versions: 2.5.0
>            Reporter: Ignat Zapolsky
>         Attachments: JMockRunner.java, Mocked.java
>
>
> Hi,
> it could be very nice to have an ability to mark fields in test case to be mocked.
> For example, any field in test case marked with annotation @Mocked will be assigned a value.
> Actually, I have implemented such feature for Jmock 2.5.0 & Junit 4.4 and I'll include sample code.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: [jira] Created: (JMOCK-222) An ability to use annotation to create mock objects