|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
[jira] Created: (JMOCK-191) Please assign unique default mock namesPlease assign unique default mock names
--------------------------------------- Key: JMOCK-191 URL: http://jira.codehaus.org/browse/JMOCK-191 Project: jMock Issue Type: Improvement Components: Library Affects Versions: 2.4.0 Reporter: Steven Cummings Fix For: Chore (ASAP) If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
|
|
[jira] Commented: (JMOCK-191) Please assign unique default mock names[ http://jira.codehaus.org/browse/JMOCK-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=135748#action_135748 ] Steve Freeman commented on JMOCK-191: ------------------------------------- I disagree, the point of the distinguishing name is to make the failure messages meaningful. If the numbers are allocated automatically, it won't be so clear which mock is failing. How much of a problem is this in practice? Are your unit tests getting too big? S. > Please assign unique default mock names > --------------------------------------- > > Key: JMOCK-191 > URL: http://jira.codehaus.org/browse/JMOCK-191 > Project: jMock > Issue Type: Improvement > Components: Library > Affects Versions: 2.4.0 > Reporter: Steven Cummings > Fix For: Chore (ASAP) > > > If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. > Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
|
|
[jira] Commented: (JMOCK-191) Please assign unique default mock names[ http://jira.codehaus.org/browse/JMOCK-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=135788#action_135788 ] Steven Cummings commented on JMOCK-191: --------------------------------------- It's not a problem of tests getting to large. In general, you are right. JUnit coders should be aiming to distinguish mocks so that debugging is easy. The situation where defaults would be nice is if there are multiple mocks created with no expectations just to get the test passing. On the other hand, I suppose this is assuming that calls to those mocks would never be the cause of failure, and wouldn't be relevant in debugging. > Please assign unique default mock names > --------------------------------------- > > Key: JMOCK-191 > URL: http://jira.codehaus.org/browse/JMOCK-191 > Project: jMock > Issue Type: Improvement > Components: Library > Affects Versions: 2.4.0 > Reporter: Steven Cummings > Fix For: Chore (ASAP) > > > If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. > Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
|
|
[jira] Commented: (JMOCK-191) Please assign unique default mock names[ http://jira.codehaus.org/browse/JMOCK-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=135790#action_135790 ] Nat Pryce commented on JMOCK-191: --------------------------------- I agree with Steve. The programmer writing the test may not care what the names of the mock objects are, but the programmers who have to diagnose test failures certainly will. The jMock philosophy is to trade off ease of writing tests in favour of ease of understanding them. > Please assign unique default mock names > --------------------------------------- > > Key: JMOCK-191 > URL: http://jira.codehaus.org/browse/JMOCK-191 > Project: jMock > Issue Type: Improvement > Components: Library > Affects Versions: 2.4.0 > Reporter: Steven Cummings > Fix For: Chore (ASAP) > > > If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. > Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
|
|
[jira] Closed: (JMOCK-191) Please assign unique default mock names[ http://jira.codehaus.org/browse/JMOCK-191?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nat Pryce closed JMOCK-191. --------------------------- Resolution: Won't Fix > Please assign unique default mock names > --------------------------------------- > > Key: JMOCK-191 > URL: http://jira.codehaus.org/browse/JMOCK-191 > Project: jMock > Issue Type: Improvement > Components: Library > Affects Versions: 2.4.0 > Reporter: Steven Cummings > > If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. > Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
|
|
[jira] Updated: (JMOCK-191) Please assign unique default mock names[ http://jira.codehaus.org/browse/JMOCK-191?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nat Pryce updated JMOCK-191: ---------------------------- Fix Version/s: (was: Chore (ASAP)) Removed Fix Version: it's not up to the submitter to choose that! > Please assign unique default mock names > --------------------------------------- > > Key: JMOCK-191 > URL: http://jira.codehaus.org/browse/JMOCK-191 > Project: jMock > Issue Type: Improvement > Components: Library > Affects Versions: 2.4.0 > Reporter: Steven Cummings > > If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. > Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
|
|
[jira] Commented: (JMOCK-191) Please assign unique default mock names[ http://jira.codehaus.org/browse/JMOCK-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=136025#action_136025 ] Nat Pryce commented on JMOCK-191: --------------------------------- If you really want to do this, you can write your own naming scheme and plug it into the mockery. However, you won't be doing any favours for the people who have to maintain your code. > Please assign unique default mock names > --------------------------------------- > > Key: JMOCK-191 > URL: http://jira.codehaus.org/browse/JMOCK-191 > Project: jMock > Issue Type: Improvement > Components: Library > Affects Versions: 2.4.0 > Reporter: Steven Cummings > > If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. > Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
|
|
[jira] Commented: (JMOCK-191) Please assign unique default mock names[ http://jira.codehaus.org/browse/JMOCK-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=136029#action_136029 ] Steven Cummings commented on JMOCK-191: --------------------------------------- I'll think about it some more. > Please assign unique default mock names > --------------------------------------- > > Key: JMOCK-191 > URL: http://jira.codehaus.org/browse/JMOCK-191 > Project: jMock > Issue Type: Improvement > Components: Library > Affects Versions: 2.4.0 > Reporter: Steven Cummings > > If more than one mock of a particular class is created within a test, the programmer is *forced* to ensure they have different names, even if they don't care what the names are. The Mockery.mock(Class) method should assign unique mock names by default. > Probably the most predictable and sane default would be something like: <qualified class name>-<integer unique to class or globally unique>. E.g, if I mock multiple instances of java.util.List, their default names might be java.util.List-0, java.util.List-1, java.util.List-2, etc. -- 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 |
| Free embeddable forum powered by Nabble | Forum Help |