|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
[jira] Created: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
------------------------------------------------------------------------- Key: JMOCK-237 URL: http://jira.codehaus.org/browse/JMOCK-237 Project: jMock Issue Type: New Feature Components: JMock 2.x.x Library Reporter: Ivan Yatskevich This new feature should allow to use jMock in the following way: public class JMockRuleTest { @Rule public Verifier jmock = new JMockVerifier(); } It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=197937#action_197937 ] Steve Freeman commented on JMOCK-237: ------------------------------------- This is something we had been intending to do, just another delay :( Perhaps the best approach is if you work up a proposal implementation and we can take it from there. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=197939#action_197939 ] Ivan Yatskevich commented on JMOCK-237: --------------------------------------- Okay, I will start implementing this feature. Also it would be great to receive expectations from the development team and jMock users on how the API will look like. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: JMockRule.java I have developed an example implementation for a JUnit 4.7 rule for JMock based on the JUnit runner see also my Blog entry http://tux2323.blogspot.com/2009/11/junit-rule-for-jmock-instead-of-jmock.html > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Ng Yong Liang updated JMOCK-237: -------------------------------------- Attachment: JMockVerifier.java Here's a simple one I did after I saw Ivan's post. One obvious disadvantage compared to Christian's implementation is that it requires the passing in of the mockery as the constructor's parameter. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: JUnitRuleMockery.java Another option could be to bring mockery context and the JUnit rule altogether, see there for my second attachment ("JUnitRuleMockery.java"). Then a test looks like this: public class FrameworkCommandProviderTest { @Rule public JUnitRuleMockery context = new JUnitRuleMockery() {{ setImposteriser(ClassImposteriser.INSTANCE); }}; ... > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=199171#action_199171 ] Jason Ng Yong Liang commented on JMOCK-237: ------------------------------------------- Great work Christian! The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects. Fyi, I have implemented your solution in my tests and it's working well. However, I would prefer to rename the after method to verify since "after" is meant for tearing down external resources (see org.junit#After and org.junit.rules#ExternalResource). Really hope this could be finalized soon as org.jmock.integration.junit4#JMock is based on org.junit.internal.runners#JUnit4ClassRunner, which has been deprecated since JUnit 4.5 (see http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt) and also does not support the use of Rules. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=199171#action_199171 ] Jason Ng Yong Liang edited comment on JMOCK-237 at 11/23/09 10:01 PM: ---------------------------------------------------------------------- Great work Christian! The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects. Fyi, I have implemented your solution in my tests and it's working well. However, I would prefer to rename the after method to verify since "after" is meant for tearing down external resources in JUnit 4 "vocabulary" (see org.junit#After and org.junit.rules#ExternalResource). Really hope this could be finalized soon as org.jmock.integration.junit4#JMock is based on org.junit.internal.runners#JUnit4ClassRunner, which has been deprecated since JUnit 4.5 (see http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt) and also does not support the use of Rules. was (Author: jasonngyl): Great work Christian! The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects. Fyi, I have implemented your solution in my tests and it's working well. However, I would prefer to rename the after method to verify since "after" is meant for tearing down external resources (see org.junit#After and org.junit.rules#ExternalResource). Really hope this could be finalized soon as org.jmock.integration.junit4#JMock is based on org.junit.internal.runners#JUnit4ClassRunner, which has been deprecated since JUnit 4.5 (see http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt) and also does not support the use of Rules. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=199171#action_199171 ] Jason Ng Yong Liang edited comment on JMOCK-237 at 11/24/09 12:12 AM: ---------------------------------------------------------------------- Great work Christian! The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects. Fyi, I have implemented your solution in my tests and it's working well. However, I would prefer to rename the after method to verify since "after" is meant for tearing down external resources in JUnit 4 "vocabulary" (see org.junit#After and org.junit.rules#ExternalResource). Just notice a problem with the evaluate method, in the event an AssertionError is thrown by the assertIsSatisfied method, we will have lost the Throwable thrown by the base.evaluate method. The try - final block should be removed. Really hope this could be finalized soon as org.jmock.integration.junit4#JMock is based on org.junit.internal.runners#JUnit4ClassRunner, which has been deprecated since JUnit 4.5 (see http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt) and also does not support the use of Rules. was (Author: jasonngyl): Great work Christian! The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects. Fyi, I have implemented your solution in my tests and it's working well. However, I would prefer to rename the after method to verify since "after" is meant for tearing down external resources in JUnit 4 "vocabulary" (see org.junit#After and org.junit.rules#ExternalResource). Really hope this could be finalized soon as org.jmock.integration.junit4#JMock is based on org.junit.internal.runners#JUnit4ClassRunner, which has been deprecated since JUnit 4.5 (see http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt) and also does not support the use of Rules. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: JUnitRuleMockery.java @Jason Ng Yong Liang thanks, and you are right there is bug in my last implementation we must verify if a exception is expceted by a test then we must also verify the mock objects, when a exception is not expected by the test we sould not verify the state of the mock objects, thats absolut true. See there for my last implementation in the attachted file... > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: (was: JUnitRuleMockery.java) > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: (was: JUnitRuleMockery.java) > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: JUnitRuleMockery.java > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=199263#action_199263 ] Christian Baranowski edited comment on JMOCK-237 at 11/24/09 1:27 PM: ---------------------------------------------------------------------- @Jason Ng Yong Liang thanks, and you are right there is bug in my last implementation we must verify if a exception is expceted by a test then we must also verify the mock objects, when a exception is not expected by the test we sould not verify the state of the mock objects, thats absolut true. See there for my last implementation in the attachted file JUnitRuleMockery.java I added a method isExceptionExpectedByTestMethod(...) was (Author: baranowski): @Jason Ng Yong Liang thanks, and you are right there is bug in my last implementation we must verify if a exception is expceted by a test then we must also verify the mock objects, when a exception is not expected by the test we sould not verify the state of the mock objects, thats absolut true. See there for my last implementation in the attachted file... > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: (was: JUnitRuleMockery.java) > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Baranowski updated JMOCK-237: --------------------------------------- Attachment: JUnitRuleMockery.java replaced base class JUnitMockery by Mockery and add the setup for the expectation error translator in the rule constructor. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=199264#action_199264 ] Christian Baranowski edited comment on JMOCK-237 at 11/24/09 1:32 PM: ---------------------------------------------------------------------- replaced base class JUnitMockery by Mockery and add the setup for the expectation error translator in the rule constructor. See there for my last implementation in the attachted file JUnitRuleMockery.java was (Author: baranowski): replaced base class JUnitMockery by Mockery and add the setup for the expectation error translator in the rule constructor. > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Ng Yong Liang updated JMOCK-237: -------------------------------------- Attachment: (was: JMockVerifier.java) > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JUnitRuleMockery.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Ng Yong Liang updated JMOCK-237: -------------------------------------- Attachment: MockeryRule.java Hi Christian, I've checked and there is no need for {@code isExceptionExpectedByTestMethod} because the JUnit 4.7 default runner would handle any unexpected exception as before. However, I'm not sure about other runners since I don't use them, so maybe there will be a use for the method in runners that work differently from the default. Anyone can confirm? Attached is a modified version (plus some simple javadoc comments) of your 1st implementation of {@code JUnitRuleMockery}. Some other rationale: 1. I still extend {@code JUnit4Mockery} because I still use it directly for test classes that need mocks in only one or two test methods; no need to verify expectations are met when mocks are not used. 2. Use {@code verify} following the convention used in {@code Verifier} > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JUnitRuleMockery.java, MockeryRule.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)[ http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=200225#action_200225 ] Jason Ng Yong Liang edited comment on JMOCK-237 at 12/1/09 10:00 PM: --------------------------------------------------------------------- Hi Christian, I've checked and there is no need for {code isExceptionExpectedByTestMethod} because the JUnit 4.7 default runner would handle any unexpected exception as before. However, I'm not sure about other runners since I don't use them, so maybe there will be a use for the method in runners that work differently from the default. Anyone can confirm? Attached is a modified version (plus some simple javadoc comments) of your 1st implementation of {@code JUnitRuleMockery}. Some other rationale: 1. I still extend {@code JUnit4Mockery} because I still use it directly for test classes that need mocks in only one or two test methods; no need to verify expectations are met when mocks are not used. 2. Use {@code verify} following the convention used in {@code Verifier} was (Author: jasonngyl): Hi Christian, I've checked and there is no need for {@code isExceptionExpectedByTestMethod} because the JUnit 4.7 default runner would handle any unexpected exception as before. However, I'm not sure about other runners since I don't use them, so maybe there will be a use for the method in runners that work differently from the default. Anyone can confirm? Attached is a modified version (plus some simple javadoc comments) of your 1st implementation of {@code JUnitRuleMockery}. Some other rationale: 1. I still extend {@code JUnit4Mockery} because I still use it directly for test classes that need mocks in only one or two test methods; no need to verify expectations are met when mocks are not used. 2. Use {@code verify} following the convention used in {@code Verifier} > Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7) > ------------------------------------------------------------------------- > > Key: JMOCK-237 > URL: http://jira.codehaus.org/browse/JMOCK-237 > Project: jMock > Issue Type: New Feature > Components: JMock 2.x.x Library > Reporter: Ivan Yatskevich > Attachments: JMockRule.java, JUnitRuleMockery.java, MockeryRule.java > > > This new feature should allow to use jMock in the following way: > public class JMockRuleTest { > @Rule public Verifier jmock = new JMockVerifier(); > } > It will also open the possibility of using jMock with a custom JUnit runner like Theories. -- 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 |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |