[jira] Created: (JMOCK-227) Allow ReturnDefaultValueAction to be replaced/extended

View: New views
1 Messages — Rating Filter:   Alert me  

[jira] Created: (JMOCK-227) Allow ReturnDefaultValueAction to be replaced/extended

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

Reply to Author | View Threaded | Show Only this Message

Allow ReturnDefaultValueAction to be replaced/extended
------------------------------------------------------

                 Key: JMOCK-227
                 URL: http://jira.codehaus.org/browse/JMOCK-227
             Project: jMock
          Issue Type: Improvement
    Affects Versions: 2.5.1
            Reporter: Pétur Runólfsson


Currently, there is no way alter the way ReturnDefaultValueAction works beyond specifying default values based on type with setDefaultResultForType. It would be nice to be able to replace or extend the implementation in other ways.

I have two examples were this would be useful:

1. Methods that return java.util.Collection

The mocks created by ReturnDefaultValueAction for java.util.Collection are not consistent, because size() == 0 while isEmpty() == false. It would be nice to be able to do something more intelligent with collections (making isEmpty() return true would go a long way).

2. Methods that return their parameter

Methods with signatures like Foo bar(Foo x) return null by default if Foo is a class type. It would be nice if they could instead be made to return the parameter.


--
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