<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-2663</id>
	<title>Nabble - jMock</title>
	<updated>2009-11-24T11:32:55Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/jMock-f2663.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/jMock-f2663.html" />
	<subtitle type="html">jMock is a library for testing Java code using mock objects1. Mock objects help you design and test the interactions between the objects in your programs. The jMock package makes it quick and easy to define mock objects, so you don't break the rhythm of programming; lets you define flexible constraints over object interactions, reducing the brittleness of your tests; is easy to extend. jMock home is &lt;a href=&quot;http://jmock.codehaus.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26501980</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:32:55Z</published>
	<updated>2009-11-24T11:32:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: &amp;nbsp; &amp;nbsp; (was: JUnitRuleMockery.java)
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501980.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26501981</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:32:55Z</published>
	<updated>2009-11-24T11:32:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: JUnitRuleMockery.java
&lt;br&gt;&lt;br&gt;replaced base class JUnitMockery by Mockery and add the setup for the expectation error translator in the rule constructor.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501981.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26501982</id>
	<title>[jira] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:32:55Z</published>
	<updated>2009-11-24T11:32:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199264#action_199264&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199264#action_199264&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Christian Baranowski edited comment on JMOCK-237 at 11/24/09 1:32 PM:
&lt;br&gt;----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;replaced base class JUnitMockery by Mockery and add the setup for the expectation error translator in the rule constructor.
&lt;br&gt;&lt;br&gt;See there for my last implementation in the attachted file JUnitRuleMockery.java 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; was (Author: baranowski):
&lt;br&gt;&amp;nbsp; &amp;nbsp; replaced base class JUnitMockery by Mockery and add the setup for the expectation error translator in the rule constructor.
&lt;br&gt;&amp;nbsp; 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501982.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26501900</id>
	<title>[jira] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:27:55Z</published>
	<updated>2009-11-24T11:27:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199263#action_199263&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199263#action_199263&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Christian Baranowski edited comment on JMOCK-237 at 11/24/09 1:27 PM:
&lt;br&gt;----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;@Jason Ng Yong Liang thanks, 
&lt;br&gt;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.
&lt;br&gt;&lt;br&gt;See there for my last implementation in the attachted file &amp;nbsp;JUnitRuleMockery.java 
&lt;br&gt;&lt;br&gt;I added a method isExceptionExpectedByTestMethod(...)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; was (Author: baranowski):
&lt;br&gt;&amp;nbsp; &amp;nbsp; @Jason Ng Yong Liang thanks, 
&lt;br&gt;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.
&lt;br&gt;&lt;br&gt;See there for my last implementation in the attachted file...
&lt;br&gt;&amp;nbsp; 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501900.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26501867</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:25:55Z</published>
	<updated>2009-11-24T11:25:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: &amp;nbsp; &amp;nbsp; (was: JUnitRuleMockery.java)
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501867.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26501868</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:25:55Z</published>
	<updated>2009-11-24T11:25:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: JUnitRuleMockery.java
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501868.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26501834</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:23:55Z</published>
	<updated>2009-11-24T11:23:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: JUnitRuleMockery.java
&lt;br&gt;&lt;br&gt;@Jason Ng Yong Liang thanks, 
&lt;br&gt;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.
&lt;br&gt;&lt;br&gt;See there for my last implementation in the attachted file...
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501834.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26501835</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-24T11:23:55Z</published>
	<updated>2009-11-24T11:23:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: &amp;nbsp; &amp;nbsp; (was: JUnitRuleMockery.java)
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26501835.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26490952</id>
	<title>[jira] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-23T22:13:55Z</published>
	<updated>2009-11-23T22:13:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199171#action_199171&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199171#action_199171&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Jason Ng Yong Liang edited comment on JMOCK-237 at 11/24/09 12:12 AM:
&lt;br&gt;----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Great work Christian!
&lt;br&gt;The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects.
&lt;br&gt;&lt;br&gt;Fyi, I have implemented your solution in my tests and it's working well.
&lt;br&gt;However, I would prefer to rename the after method to verify since &amp;quot;after&amp;quot; is meant for tearing down external resources in JUnit 4 &amp;quot;vocabulary&amp;quot; (see org.junit#After and org.junit.rules#ExternalResource).
&lt;br&gt;&lt;br&gt;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.
&lt;br&gt;&lt;br&gt;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 &lt;a href=&quot;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&lt;/a&gt;) and also does not support the use of Rules.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; was (Author: jasonngyl):
&lt;br&gt;&amp;nbsp; &amp;nbsp; Great work Christian!
&lt;br&gt;The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects.
&lt;br&gt;&lt;br&gt;Fyi, I have implemented your solution in my tests and it's working well.
&lt;br&gt;However, I would prefer to rename the after method to verify since &amp;quot;after&amp;quot; is meant for tearing down external resources in JUnit 4 &amp;quot;vocabulary&amp;quot; (see org.junit#After and org.junit.rules#ExternalResource).
&lt;br&gt;&lt;br&gt;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 &lt;a href=&quot;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&lt;/a&gt;) and also does not support the use of Rules.
&lt;br&gt;&amp;nbsp; 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26490952.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26490177</id>
	<title>[jira] Issue Comment Edited: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-23T20:01:55Z</published>
	<updated>2009-11-23T20:01:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199171#action_199171&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199171#action_199171&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Jason Ng Yong Liang edited comment on JMOCK-237 at 11/23/09 10:01 PM:
&lt;br&gt;----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;Great work Christian!
&lt;br&gt;The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects.
&lt;br&gt;&lt;br&gt;Fyi, I have implemented your solution in my tests and it's working well.
&lt;br&gt;However, I would prefer to rename the after method to verify since &amp;quot;after&amp;quot; is meant for tearing down external resources in JUnit 4 &amp;quot;vocabulary&amp;quot; (see org.junit#After and org.junit.rules#ExternalResource).
&lt;br&gt;&lt;br&gt;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 &lt;a href=&quot;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&lt;/a&gt;) and also does not support the use of Rules.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; was (Author: jasonngyl):
&lt;br&gt;&amp;nbsp; &amp;nbsp; Great work Christian!
&lt;br&gt;The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects.
&lt;br&gt;&lt;br&gt;Fyi, I have implemented your solution in my tests and it's working well.
&lt;br&gt;However, I would prefer to rename the after method to verify since &amp;quot;after&amp;quot; is meant for tearing down external resources (see org.junit#After and org.junit.rules#ExternalResource).
&lt;br&gt;&lt;br&gt;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 &lt;a href=&quot;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&lt;/a&gt;) and also does not support the use of Rules.
&lt;br&gt;&amp;nbsp; 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26490177.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26490154</id>
	<title>[jira] Commented: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-23T19:58:55Z</published>
	<updated>2009-11-23T19:58:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199171#action_199171&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=199171#action_199171&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Jason Ng Yong Liang commented on JMOCK-237:
&lt;br&gt;-------------------------------------------
&lt;br&gt;&lt;br&gt;Great work Christian!
&lt;br&gt;The 2nd solution you proposed is definitely much neater to use - no need to manage 2 separate objects.
&lt;br&gt;&lt;br&gt;Fyi, I have implemented your solution in my tests and it's working well.
&lt;br&gt;However, I would prefer to rename the after method to verify since &amp;quot;after&amp;quot; is meant for tearing down external resources (see org.junit#After and org.junit.rules#ExternalResource).
&lt;br&gt;&lt;br&gt;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 &lt;a href=&quot;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit/blob/master/doc/ReleaseNotes4.5.txt&lt;/a&gt;) and also does not support the use of Rules.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26490154.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26476068</id>
	<title>Re: JMock doesn't seem to be invoked when mocking a  concrete class</title>
	<published>2009-11-23T03:07:30Z</published>
	<updated>2009-11-23T03:07:30Z</updated>
	<author>
		<name>Viggo Navarsete</name>
	</author>
	<content type="html">well, you&amp;#39;re partially right. The problem is that the VirtualInstanceContextHolder contains a private constructor,an the way that class is used is by invoking a &lt;br&gt;VirtualInstanceContextHolder.getContext() which would return a VirtualInstanceContext object. &lt;br&gt;
The bottom line is: I want to return a DTOFactory from my metod getDTOFactory in the Service class. Can I do that without setting up mock of all the things that the getDTOFactory is using?&lt;br&gt;&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Viggo&lt;br&gt;
&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Nov 23, 2009 at 11:15 AM, Julian Hall &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26476068&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jules@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;Viggo Navarsete wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
I&amp;#39;m having a unit test which is supposed to test a Service. The Service in turn calls another class. I want to mock the invocations to the class the Service uses.&lt;br&gt;
&lt;br&gt;
MyTest--&amp;gt;Service--&amp;gt;AConcreteClass&lt;br&gt;
&lt;br&gt;
So, MyTest executes a method on Service, which in turn execute a method on a concrete class, AConcreteClass.&lt;br&gt;
I want to mock the execution on the AConcreteClass in Service, but it doesn&amp;#39;t seem to mock it.&lt;br&gt;
&lt;br&gt;
Some code:&lt;br&gt;
&lt;br&gt;
************************************************************************************************************************************************************************************************&lt;br&gt;
MyTest:&lt;br&gt;
&lt;br&gt;
@Test&lt;br&gt;
public void testDataLoad() throws Exception {&lt;br&gt;
&lt;br&gt;
        Mockery context = new Mockery() {{&lt;br&gt;
            setImposteriser( ClassImposteriser.INSTANCE );&lt;br&gt;
        }};&lt;br&gt;
&lt;br&gt;
        final VirtualInstanceContextHolder vich = context.mock( VirtualInstanceContextHolder.class );&lt;br&gt;
        final VirtualInstanceContext vic = context.mock( VirtualInstanceContext.class );&lt;br&gt;
        final ApplicationContext ac = context.mock( ApplicationContext.class );&lt;br&gt;
        final Persistence persistence = context.mock( Persistence.class );&lt;br&gt;
        final Map&amp;lt;String, String&amp;gt; emMap = new HashMap&amp;lt;String, String&amp;gt;();&lt;br&gt;
&lt;br&gt;
        context.checking( new Expectations() {{&lt;br&gt;
            allowing( vich );&lt;br&gt;
                will( returnValue( new VirtualInstanceContext()));&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;
Shouldn&amp;#39;t this be returning vic?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
   &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Viggo Navarsete&lt;br&gt;Senior Developer&lt;br&gt;TraceTracker AS&lt;br&gt;&lt;br&gt;Øvre Slottsgt.4, 4th floor, N-0157 Oslo, Norway&lt;br&gt;Central number: +47 47 70 44 00&lt;br&gt;Direct number: +47 92 43 14 90&lt;br&gt;
E-mail: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26476068&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;viggo@...&lt;/a&gt;&lt;br&gt;&lt;br&gt;TraceTracker was selected Technology Pioneer 2009 by the World Economic Forum.&lt;br&gt;&lt;br&gt;This is a confidential business communication. If you have received it in error please notify the sender and delete it. Any unauthorized use of this communication is prohibited.Copyright 2009 TraceTracker AS, Oslo - Norway&lt;br&gt;

&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JMock-doesn%27t-seem-to-be-invoked-when-mocking-a-concrete-class-tp26475158p26476068.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26476012</id>
	<title>RE [jmock-user] JMock doesn't seem to be invoked when mocking a concrete class</title>
	<published>2009-11-23T03:01:49Z</published>
	<updated>2009-11-23T03:01:49Z</updated>
	<author>
		<name>ar92</name>
	</author>
	<content type="html">
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;Looks like you have a static method
(&lt;/font&gt;&lt;font size=3&gt;VirtualInstanceContextHolder.getContext()&lt;/font&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;),
and you can't mock static methods because they're not polymorphic.&lt;/font&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;There are some hacks to get around this
(though the ideal solution is to refactor so vic is injected - i.e. passed
as an argument into either the service's constructor or the method call).
&amp;nbsp;&lt;/font&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;If you can set the singleton value returned
by &lt;/font&gt;&lt;font size=3&gt;VirtualInstanceContextHolder.getContext()&lt;/font&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;
to vic, your problem is solved (it seems to be set to null in your test,
currently). &amp;nbsp;Or you could move the static call into&lt;/font&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;a protected method of the service (call
it &amp;quot;getVIContext()&amp;quot; or something like that) and then run your
test on a subclass of the service which overrides this method to return
an instance&lt;/font&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;received in its constructor or a setter,
where you inject the object vic in your test code. &amp;nbsp;&lt;/font&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;-Alan&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;table width=100%&gt;
&lt;tr valign=top&gt;
&lt;td width=40%&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;&lt;b&gt;Viggo Navarsete &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26476012&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;viggo@...&lt;/a&gt;&amp;gt;&lt;/b&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;23/11/2009 10:52&lt;/font&gt;
&lt;table border&gt;
&lt;tr valign=top&gt;
&lt;td bgcolor=white&gt;
&lt;div align=center&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;Veuillez répondre à&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26476012&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;/table&gt;
&lt;br&gt;
&lt;td width=59%&gt;
&lt;table width=100%&gt;
&lt;tr valign=top&gt;
&lt;td&gt;
&lt;div align=right&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;A&lt;/font&gt;&lt;/div&gt;
&lt;td&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26476012&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;/font&gt;
&lt;tr valign=top&gt;
&lt;td&gt;
&lt;div align=right&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;cc&lt;/font&gt;&lt;/div&gt;
&lt;td&gt;
&lt;tr valign=top&gt;
&lt;td&gt;
&lt;div align=right&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;Objet&lt;/font&gt;&lt;/div&gt;
&lt;td&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;[jmock-user] JMock doesn't seem to be
invoked when mocking a concrete class&lt;/font&gt;&lt;/table&gt;
&lt;br&gt;
&lt;table&gt;
&lt;tr valign=top&gt;
&lt;td&gt;
&lt;td&gt;&lt;/table&gt;
&lt;br&gt;&lt;/table&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;&lt;font size=3&gt;I'm having a unit test which is supposed to test a Service.
The Service in turn calls another class. I want to mock the invocations
to the class the Service uses.&lt;br&gt;
&lt;br&gt;
MyTest--&amp;gt;Service--&amp;gt;AConcreteClass&lt;br&gt;
&lt;br&gt;
So, MyTest executes a method on Service, which in turn execute a method
on a concrete class, AConcreteClass.&lt;br&gt;
I want to mock the execution on the AConcreteClass in Service, but it doesn't
seem to mock it.&lt;br&gt;
&lt;br&gt;
Some code:&lt;br&gt;
&lt;br&gt;
************************************************************************************************************************************************************************************************&lt;br&gt;
MyTest:&lt;br&gt;
&lt;br&gt;
@Test&lt;br&gt;
public void testDataLoad() throws Exception {&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Mockery context = new Mockery() {{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; setImposteriser(
ClassImposteriser.INSTANCE );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }};&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; final VirtualInstanceContextHolder
vich = context.mock( VirtualInstanceContextHolder.class );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; final VirtualInstanceContext vic
= context.mock( VirtualInstanceContext.class );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; final ApplicationContext ac = context.mock(
ApplicationContext.class );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; final Persistence persistence = context.mock(
Persistence.class );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; final Map&amp;lt;String, String&amp;gt; emMap
= new HashMap&amp;lt;String, String&amp;gt;();&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; context.checking( new Expectations()
{{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; allowing( vich
);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;
will( returnValue( new VirtualInstanceContext()));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; allowing( vic
).getApplicationContext();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;
will( returnValue( new AutowiringXmlWebApplicationContext() ));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; allowing( ac ).getParent();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; allowing( ac ).getBean(
&amp;quot;SecureDTOFactory&amp;quot; );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;
will( returnValue( new DTOFactory() ) );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; allowing( persistence).createEntityManagerFactory(
&amp;quot;epcisTIXPU&amp;quot;, emMap );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;
will( returnValue( Persistence.createEntityManagerFactory( &amp;quot;epcisTIXPU&amp;quot;
).createEntityManager()));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }});&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; results = service.simpleEventQuery(new
QueryParams()); // execute the actual method on Service&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
************************************************************************************************************************************************************************************************&lt;br&gt;
Service:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; public List&amp;lt;EventDetailsDTO&amp;gt; simpleEventQuery( QueryParams
queryParam) {&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DTOFactory dtoFactory = getDTOFactory();
// I want to mock the method invocations in the private getDTOFactory!!&lt;br&gt;
&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private DTOFactory getDTOFactory() {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; VirtualInstanceContext vic = VirtualInstanceContextHolder.getContext();
// I get back an object here&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ApplicationContext ac = vic.getApplicationContext();
// This one returns null and is what I want to figure out why!!&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ApplicationContext acParent = ac.getParent();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DTOFactory dtoFactory = (DTOFactory)
acParent.getBean( &amp;quot;SecureDTOFactory&amp;quot; );&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return dtoFactory;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
My environment:&lt;br&gt;
- Maven 2.0.9&lt;br&gt;
- JUnit 4.4&lt;br&gt;
- JDK 1.6.0_16&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JMock-doesn%27t-seem-to-be-invoked-when-mocking-a-concrete-class-tp26475158p26476012.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26475436</id>
	<title>Re: JMock doesn't seem to be invoked when mocking a concrete class</title>
	<published>2009-11-23T02:15:41Z</published>
	<updated>2009-11-23T02:15:41Z</updated>
	<author>
		<name>Julian Hall-2</name>
	</author>
	<content type="html">Viggo Navarsete wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I'm having a unit test which is supposed to test a Service. The 
&lt;br&gt;&amp;gt; Service in turn calls another class. I want to mock the invocations to 
&lt;br&gt;&amp;gt; the class the Service uses.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; MyTest--&amp;gt;Service--&amp;gt;AConcreteClass
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; So, MyTest executes a method on Service, which in turn execute a 
&lt;br&gt;&amp;gt; method on a concrete class, AConcreteClass.
&lt;br&gt;&amp;gt; I want to mock the execution on the AConcreteClass in Service, but it 
&lt;br&gt;&amp;gt; doesn't seem to mock it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Some code:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ************************************************************************************************************************************************************************************************
&lt;br&gt;&amp;gt; MyTest:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; @Test
&lt;br&gt;&amp;gt; public void testDataLoad() throws Exception {
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Mockery context = new Mockery() {{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setImposteriser( ClassImposteriser.INSTANCE );
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }};
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final VirtualInstanceContextHolder vich = context.mock( 
&lt;br&gt;&amp;gt; VirtualInstanceContextHolder.class );
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final VirtualInstanceContext vic = context.mock( 
&lt;br&gt;&amp;gt; VirtualInstanceContext.class );
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final ApplicationContext ac = context.mock( 
&lt;br&gt;&amp;gt; ApplicationContext.class );
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final Persistence persistence = context.mock( Persistence.class );
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; final Map&amp;lt;String, String&amp;gt; emMap = new HashMap&amp;lt;String, String&amp;gt;();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; context.checking( new Expectations() {{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; allowing( vich );
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; will( returnValue( new VirtualInstanceContext()));
&lt;/div&gt;Shouldn't this be returning vic?
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JMock-doesn%27t-seem-to-be-invoked-when-mocking-a-concrete-class-tp26475158p26475436.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26475158</id>
	<title>JMock doesn't seem to be invoked when mocking a concrete class</title>
	<published>2009-11-23T01:51:46Z</published>
	<updated>2009-11-23T01:51:46Z</updated>
	<author>
		<name>Viggo Navarsete</name>
	</author>
	<content type="html">I&amp;#39;m having a unit test which is supposed to test a Service. The Service in turn calls another class. I want to mock the invocations to the class the Service uses.&lt;br&gt;&lt;br&gt;MyTest--&amp;gt;Service--&amp;gt;AConcreteClass&lt;br&gt;&lt;br&gt;So, MyTest executes a method on Service, which in turn execute a method on a concrete class, AConcreteClass.&lt;br&gt;
I want to mock the execution on the AConcreteClass in Service, but it doesn&amp;#39;t seem to mock it.&lt;br&gt;&lt;br&gt;Some code:&lt;br&gt;&lt;br&gt;************************************************************************************************************************************************************************************************&lt;br&gt;
MyTest:&lt;br&gt;&lt;br&gt;@Test&lt;br&gt;public void testDataLoad() throws Exception {&lt;br&gt;&lt;br&gt;        Mockery context = new Mockery() {{&lt;br&gt;            setImposteriser( ClassImposteriser.INSTANCE );&lt;br&gt;        }};&lt;br&gt;&lt;br&gt;        final VirtualInstanceContextHolder vich = context.mock( VirtualInstanceContextHolder.class );&lt;br&gt;
        final VirtualInstanceContext vic = context.mock( VirtualInstanceContext.class );&lt;br&gt;        final ApplicationContext ac = context.mock( ApplicationContext.class );&lt;br&gt;        final Persistence persistence = context.mock( Persistence.class );&lt;br&gt;
        final Map&amp;lt;String, String&amp;gt; emMap = new HashMap&amp;lt;String, String&amp;gt;();&lt;br&gt;&lt;br&gt;        context.checking( new Expectations() {{&lt;br&gt;            allowing( vich );&lt;br&gt;                will( returnValue( new VirtualInstanceContext()));&lt;br&gt;
            allowing( vic ).getApplicationContext();&lt;br&gt;                will( returnValue( new AutowiringXmlWebApplicationContext() ));&lt;br&gt;            allowing( ac ).getParent();&lt;br&gt;            allowing( ac ).getBean( &amp;quot;SecureDTOFactory&amp;quot; );&lt;br&gt;
                will( returnValue( new DTOFactory() ) );&lt;br&gt;            allowing( persistence).createEntityManagerFactory( &amp;quot;epcisTIXPU&amp;quot;, emMap );&lt;br&gt;                will( returnValue( Persistence.createEntityManagerFactory( &amp;quot;epcisTIXPU&amp;quot; ).createEntityManager()));&lt;br&gt;
        }});&lt;br&gt;&lt;br&gt;&lt;br&gt;       results = service.simpleEventQuery(new QueryParams()); // execute the actual method on Service&lt;br&gt;&lt;br&gt;&lt;br&gt;************************************************************************************************************************************************************************************************&lt;br&gt;
Service:&lt;br&gt;&lt;br&gt;   public List&amp;lt;EventDetailsDTO&amp;gt; simpleEventQuery( QueryParams queryParam) {&lt;br&gt; &lt;br&gt;       DTOFactory dtoFactory = getDTOFactory(); // I want to mock the method invocations in the private getDTOFactory!!&lt;br&gt;
   }&lt;br&gt;&lt;br&gt;    private DTOFactory getDTOFactory() {&lt;br&gt;        VirtualInstanceContext vic = VirtualInstanceContextHolder.getContext(); // I get back an object here&lt;br&gt;        ApplicationContext ac = vic.getApplicationContext(); // This one returns null and is what I want to figure out why!!&lt;br&gt;
        ApplicationContext acParent = ac.getParent();&lt;br&gt;        DTOFactory dtoFactory = (DTOFactory) acParent.getBean( &amp;quot;SecureDTOFactory&amp;quot; );&lt;br&gt;        return dtoFactory;&lt;br&gt;    }&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
My environment:&lt;br&gt;- Maven 2.0.9&lt;br&gt;- JUnit 4.4&lt;br&gt;- JDK 1.6.0_16&lt;br&gt;&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JMock-doesn%27t-seem-to-be-invoked-when-mocking-a-concrete-class-tp26475158p26475158.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26473691</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-22T23:31:55Z</published>
	<updated>2009-11-22T23:31:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: JUnitRuleMockery.java
&lt;br&gt;&lt;br&gt;Another option could be to bring mockery context and the JUnit rule altogether, see there for my second attachment (&amp;quot;JUnitRuleMockery.java&amp;quot;).
&lt;br&gt;&lt;br&gt;Then a test looks like this:
&lt;br&gt;&lt;br&gt;public class FrameworkCommandProviderTest {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Rule
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public JUnitRuleMockery context = new JUnitRuleMockery() {{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setImposteriser(ClassImposteriser.INSTANCE);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }};
&lt;br&gt;&lt;br&gt;...
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java, JUnitRuleMockery.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26473691.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26471790</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-22T18:07:55Z</published>
	<updated>2009-11-22T18:07:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Jason Ng Yong Liang updated JMOCK-237:
&lt;br&gt;--------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: JMockVerifier.java
&lt;br&gt;&lt;br&gt;Here's a simple one I did after I saw Ivan's post.
&lt;br&gt;One obvious disadvantage compared to Christian's implementation is that it requires the passing in of the mockery as the constructor's parameter.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java, JMockVerifier.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26471790.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26471134</id>
	<title>Checkstyle check for @RunWith(JMock)</title>
	<published>2009-11-22T16:33:34Z</published>
	<updated>2009-11-22T16:33:34Z</updated>
	<author>
		<name>Stephen Smith-2</name>
	</author>
	<content type="html">Hi
&lt;br&gt;&lt;br&gt;I'm thinking of writing a Checkstyle custom check that checks a class containing 
&lt;br&gt;a Mockery field is annotated with @RunWith(JMock).
&lt;br&gt;&lt;br&gt;Can anyone think of a scenario where you might want a Mockery field and not use 
&lt;br&gt;the JMock TestRunner implementation?
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;&lt;br&gt;S
&lt;br&gt;-- 
&lt;br&gt;Stephen Smith
&lt;br&gt;&lt;a href=&quot;http://www.stephen-smith.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.stephen-smith.co.uk/&lt;/a&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Checkstyle-check-for-%40RunWith%28JMock%29-tp26471134p26471134.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26468444</id>
	<title>[jira] Updated: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-22T11:12:55Z</published>
	<updated>2009-11-22T11:12:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel&lt;/a&gt;&amp;nbsp;]
&lt;br&gt;&lt;br&gt;Christian Baranowski updated JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; Attachment: JMockRule.java
&lt;br&gt;&lt;br&gt;I have developed an example implementation for a JUnit 4.7 rule for JMock based on the JUnit runner 
&lt;br&gt;&lt;br&gt;see also my Blog entry &lt;a href=&quot;http://tux2323.blogspot.com/2009/11/junit-rule-for-jmock-instead-of-jmock.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tux2323.blogspot.com/2009/11/junit-rule-for-jmock-instead-of-jmock.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: JMockRule.java
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26468444.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26444758</id>
	<title>Re: error message with custom matcher</title>
	<published>2009-11-20T06:59:10Z</published>
	<updated>2009-11-20T06:59:10Z</updated>
	<author>
		<name>Steve Freeman-2</name>
	</author>
	<content type="html">More...
&lt;br&gt;&lt;br&gt;You might also want to look at samePropertyValuesAs().
&lt;br&gt;&lt;br&gt;And you don't need to declare @Factory on the factory method, that's just for code generating the Matchers class.
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 20 Nov 2009, at 06:07, John Sanda wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; I writing a test using a custom matcher. The custom matcher seems to be working, but the error message in the failure seems off. Here is roughly what my test looks like,
&lt;br&gt;&lt;br&gt;S.
&lt;br&gt;&lt;br&gt;Steve Freeman
&lt;br&gt;&lt;br&gt;Winner of the Agile Alliance Gordon Pask award 2006
&lt;br&gt;Book: &lt;a href=&quot;http://www.growing-object-oriented-software.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.growing-object-oriented-software.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;+44 (0) 797 179 4105
&lt;br&gt;M3P Limited. &amp;nbsp;&lt;a href=&quot;http://www.m3p.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.m3p.co.uk&lt;/a&gt;&lt;br&gt;Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ. 
&lt;br&gt;Company registered in England &amp; Wales. Number 03689627
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/error-message-with-custom-matcher-tp26443846p26444758.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26444710</id>
	<title>Re: error message with custom matcher</title>
	<published>2009-11-20T06:56:13Z</published>
	<updated>2009-11-20T06:56:13Z</updated>
	<author>
		<name>Steve Freeman-2</name>
	</author>
	<content type="html">describeTo() describes the /matcher/, what you expected not what you got.
&lt;br&gt;&lt;br&gt;to report the actual value, you need to implement a mismatch description. Look at TypeSafeDiagnosingMatche. If you can't find it, you probably need to upgrade to the next version of Hamcrest.
&lt;br&gt;&lt;br&gt;S
&lt;br&gt;&lt;br&gt;&lt;br&gt;On 20 Nov 2009, at 06:07, John Sanda wrote:
&lt;br&gt;&amp;gt; I writing a test using a custom matcher. The custom matcher seems to be working, but the error message in the failure seems off. Here is roughly what my test looks like,
&lt;br&gt;&lt;br&gt;Steve Freeman
&lt;br&gt;&lt;br&gt;Winner of the Agile Alliance Gordon Pask award 2006
&lt;br&gt;Book: &lt;a href=&quot;http://www.growing-object-oriented-software.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.growing-object-oriented-software.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;+44 (0) 797 179 4105
&lt;br&gt;M3P Limited. &amp;nbsp;&lt;a href=&quot;http://www.m3p.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.m3p.co.uk&lt;/a&gt;&lt;br&gt;Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ. 
&lt;br&gt;Company registered in England &amp; Wales. Number 03689627
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/error-message-with-custom-matcher-tp26443846p26444710.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26443846</id>
	<title>error message with custom matcher</title>
	<published>2009-11-20T06:07:04Z</published>
	<updated>2009-11-20T06:07:04Z</updated>
	<author>
		<name>John Sanda-3</name>
	</author>
	<content type="html">I writing a test using a custom matcher. The custom matcher seems to be working, but the error message in the failure seems off. Here is roughly what my test looks like,&lt;br&gt;&lt;br&gt;ConfigurationFacet facet = context.mock(ConfigurationFacet.class)&lt;br&gt;
ConfigurationService configService = context.mock(ConfigurationService.class);&lt;br&gt;&lt;br&gt;context.checking(new Expectations() {{&lt;br&gt;    oneOf(facet).updateResourceConfiguration(with(any(ConfigurationUpdateReport.class)));&lt;br&gt;
    atLeast(1).of(configService).completeConfigurationUpdate(with(matchingResponse(expectedResponse)));&lt;br&gt;}});&lt;br&gt;&lt;br&gt;expectedResponse is an instance of ConfigurationUpdateResponse and matchingResponse is my custom matcher that does a property comparison. The code for it is,&lt;br&gt;
&lt;br&gt;public class ConfigurationUpdateResponseMatcher extends TypeSafeMatcher&amp;lt;ConfigurationUpdateResponse&amp;gt; {&lt;br&gt;        @Factory&lt;br&gt;        public static Matcher&amp;lt;ConfigurationUpdateResponse&amp;gt; matchingResponse(ConfigurationUpdateResponse expected) {&lt;br&gt;
            return new ConfigurationUpdateResponseMatcher(expected);&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        private ConfigurationUpdateResponse expected;&lt;br&gt;&lt;br&gt;        public ConfigurationUpdateResponseMatcher(ConfigurationUpdateResponse response) {&lt;br&gt;
            expected = response;&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        public boolean matchesSafely(ConfigurationUpdateResponse actual) {&lt;br&gt;            return propertyEquals(expected.getConfiguration(), actual.getConfiguration()) &amp;amp;&amp;amp;&lt;br&gt;
                      propertyEquals(expected.getConfigurationUpdateId(), actual.getConfigurationUpdateId()) &amp;amp;&amp;amp;&lt;br&gt;                      propertyEquals(expected.getErrorMessage(), actual.getErrorMessage()) &amp;amp;&amp;amp;&lt;br&gt;
                      propertyEquals(expected.getStatus(), actual.getStatus());&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        private boolean propertyEquals(Object expected, Object actual) {&lt;br&gt;            if (expected == null &amp;amp;&amp;amp; actual == null) {&lt;br&gt;
                return true;&lt;br&gt;            }&lt;br&gt;&lt;br&gt;            if (expected == null &amp;amp;&amp;amp; actual != null) {&lt;br&gt;                return false;&lt;br&gt;            }&lt;br&gt;            return expected.equals(actual);&lt;br&gt;        }&lt;br&gt;
&lt;br&gt;        public void describeTo(Description description) {&lt;br&gt;            description.appendText(&amp;quot;A &amp;quot; + ConfigurationUpdateResponse.class.getSimpleName() + &amp;quot; matching &amp;quot; +&lt;br&gt;
                    expected);&lt;br&gt;        }&lt;br&gt;}&lt;br&gt;&lt;br&gt;I thought that the error message I would see when my custom matcher returns false would be the description it creates in its describeTo() method. Instead, I see,&lt;br&gt;
&lt;br&gt;un&lt;br&gt;Expected :ConfigurationUpdateResponse[configurationUpdateId=-1, ConfigurationUpdateStatus=Failure, configuration=Configuration[id=0]]&lt;br&gt;Actual   :org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport@50269997&lt;br&gt;
)&lt;br&gt;&lt;br&gt;I used values to trigger the failure as a way to verify that my custom matcher is working, but the error reporting is wrong. The object it is reporting as expected appears to be from,&lt;br&gt;&lt;br&gt;oneOf(facet).updateResourceConfiguration(with(any(ConfigurationUpdateReport.class)))&lt;br&gt;
&lt;br&gt;but the custom matcher takes an instance of ConfigurationUpdateResponse. Is there something that I can do to alter the error message that is reported?&lt;br&gt;&lt;br&gt;Thanks&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;- John&lt;br&gt;
&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/error-message-with-custom-matcher-tp26443846p26443846.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26400958</id>
	<title>Re: javax.xml package</title>
	<published>2009-11-17T17:29:44Z</published>
	<updated>2009-11-17T17:29:44Z</updated>
	<author>
		<name>Sam-186</name>
	</author>
	<content type="html">Thanks Steve, appreciate it. 
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/javax.xml-package-tp26344773p26400958.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26391574</id>
	<title>[jira] Created: (JMOCK-238) PublisherTest on Getting Started Page</title>
	<published>2009-11-17T07:10:55Z</published>
	<updated>2009-11-17T07:10:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">PublisherTest on Getting Started Page
&lt;br&gt;-------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Key: JMOCK-238
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-238&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-238&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Project: jMock
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Issue Type: Bug
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Components: Documentation
&lt;br&gt;&amp;nbsp; &amp;nbsp; Affects Versions: 2.5.1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Environment: Website
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Reporter: Gordon Dickens
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: Trivial
&lt;br&gt;&lt;br&gt;&lt;br&gt;Make the PublisherTest code example on the Getting Started page a public class.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-238%29-PublisherTest-on-Getting-Started-Page-tp26391574p26391574.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26387239</id>
	<title>Re: Advice on testing my classes that has many third party API calls.</title>
	<published>2009-11-17T02:05:22Z</published>
	<updated>2009-11-17T02:05:22Z</updated>
	<author>
		<name>LadyCoconut</name>
	</author>
	<content type="html">&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Steve Freeman-2 wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;On 27 Oct 2009, at 10:36, LadyCoconut wrote:
&lt;br&gt;&amp;gt; My questions are:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1. in my test I am using the matchers with(any(OpertionOptions.class),
&lt;br&gt;&amp;gt; with(any(Profile.class) and such....should I be mocking these concrete
&lt;br&gt;&amp;gt; classes using the ClassImposteriser and setting them up and checking &amp;nbsp;
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; exact expectations of these? It feels a bit wrong. All I want to &amp;nbsp;
&lt;br&gt;&amp;gt; test is
&lt;br&gt;&amp;gt; that a call to the service is made and that I get back an expected &amp;nbsp;
&lt;br&gt;&amp;gt; type with
&lt;br&gt;&amp;gt; some parameters in it?
&lt;br&gt;&lt;br&gt;You want to check, for example, that the ObjectIdentitySet has been &amp;nbsp;
&lt;br&gt;set up correctly? You could write a more precise matcher that checks &amp;nbsp;
&lt;br&gt;the values within the ObjectIdSet that was passed in. Something like:
&lt;br&gt;&lt;br&gt;oneOf(objectService).get(with(objectIdentitySetWithId(1)), ...
&lt;br&gt;&lt;br&gt;If you just want to let the call go through, then the any() clauses &amp;nbsp;
&lt;br&gt;are fine--that's your intention. You can simplify it further, if &amp;nbsp;
&lt;br&gt;there's only one call to an object:
&lt;br&gt;&lt;br&gt;allowing(objectService); will(returnValue(dataPackage));
&lt;br&gt;&lt;br&gt;if that's all you care about. (Remember: Stub Queries, Expect Actions)
&lt;br&gt;&lt;br&gt;&amp;gt; 2. Should I be spending my time skinning and wrapping the API for &amp;nbsp;
&lt;br&gt;&amp;gt; testing?
&lt;br&gt;&amp;gt; As its rather a small project at the moment, I managed to create a &amp;nbsp;
&lt;br&gt;&amp;gt; stub
&lt;br&gt;&amp;gt; service initially that returns some duff data.
&lt;br&gt;&lt;br&gt;That depends :) At the least, I'd have some kind of interface in my &amp;nbsp;
&lt;br&gt;domain code that protected me from the library, so there were no &amp;nbsp;
&lt;br&gt;references.
&lt;br&gt;&lt;br&gt;S.
&lt;br&gt;&lt;br&gt;Steve Freeman
&lt;br&gt;&lt;br&gt;Winner of the Agile Alliance Gordon Pask award 2006
&lt;br&gt;Book: &lt;a href=&quot;http://www.growing-object-oriented-software.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.growing-object-oriented-software.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;+44 (0) 797 179 4105
&lt;br&gt;M3P Limited. &amp;nbsp;&lt;a href=&quot;http://www.m3p.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.m3p.co.uk&lt;/a&gt;&lt;br&gt;Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ.
&lt;br&gt;Company registered in England &amp; Wales. Number 03689627
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;br&gt;Thanks for the advice and the reply. 
&lt;br&gt;Got your book in the post yesterday, looking forward to reading it. 
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Advice-on-testing-my-classes-that-has-many-third-party-API-calls.-tp26075443p26387239.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26370101</id>
	<title>Re: javax.xml package</title>
	<published>2009-11-16T03:04:11Z</published>
	<updated>2009-11-16T03:04:11Z</updated>
	<author>
		<name>Steve Freeman-2</name>
	</author>
	<content type="html">Sorry for the delay in responding. My first instinct is to write my domain code against interfaces that describes what I want from JAXB, which I can mock in my tests. What happens after that depends on what I want to prove and how hard it is to work with the third-party library. For a case like this, it might be best to test the adaptor code directly against the jaxb library and see what XML comes out. Whether any of that testing involves mocks depends on how complex the adaption is and how accommodating the design of java.xml is.
&lt;br&gt;&lt;br&gt;S.
&lt;br&gt;&lt;br&gt;On 13 Nov 2009, at 22:48, Sam wrote:
&lt;br&gt;&amp;gt; I'm writing code which uses the javax.xml package. Is the correct approach, and
&lt;br&gt;&amp;gt; I use the phrase lightly, that I create domain appropriate interfaces and the
&lt;br&gt;&amp;gt; relevant adaptors for the package? Or should I use the api directly and mock
&lt;br&gt;&amp;gt; classes such as JAXBContext.java for testing purposes?
&lt;br&gt;&lt;br&gt;Steve Freeman
&lt;br&gt;&lt;br&gt;Winner of the Agile Alliance Gordon Pask award 2006
&lt;br&gt;Book: &lt;a href=&quot;http://www.growing-object-oriented-software.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.growing-object-oriented-software.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;+44 (0) 797 179 4105
&lt;br&gt;M3P Limited. &amp;nbsp;&lt;a href=&quot;http://www.m3p.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.m3p.co.uk&lt;/a&gt;&lt;br&gt;Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ. 
&lt;br&gt;Company registered in England &amp; Wales. Number 03689627
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/javax.xml-package-tp26344773p26370101.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26344773</id>
	<title>javax.xml package</title>
	<published>2009-11-13T14:48:50Z</published>
	<updated>2009-11-13T14:48:50Z</updated>
	<author>
		<name>Sam-186</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;I'm writing code which uses the javax.xml package. Is the correct approach, and
&lt;br&gt;I use the phrase lightly, that I create domain appropriate interfaces and the
&lt;br&gt;relevant adaptors for the package? Or should I use the api directly and mock
&lt;br&gt;classes such as JAXBContext.java for testing purposes?
&lt;br&gt;&lt;br&gt;Any thoughts would be greatly appreciated.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Sam 
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/javax.xml-package-tp26344773p26344773.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26298903</id>
	<title>[jira] Commented: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-11T02:09:55Z</published>
	<updated>2009-11-11T02:09:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197939#action_197939&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197939#action_197939&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Ivan Yatskevich commented on JMOCK-237:
&lt;br&gt;---------------------------------------
&lt;br&gt;&lt;br&gt;Okay, I will start implementing this feature.
&lt;br&gt;Also it would be great to receive expectations from the development team and jMock users on how the API will look like.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26298903.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26298744</id>
	<title>[jira] Commented: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-11T01:54:58Z</published>
	<updated>2009-11-11T01:54:58Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197937#action_197937&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197937#action_197937&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Steve Freeman commented on JMOCK-237:
&lt;br&gt;-------------------------------------
&lt;br&gt;&lt;br&gt;This is something we had been intending to do, just another delay :(
&lt;br&gt;&lt;br&gt;Perhaps the best approach is if you work up a proposal implementation and we can take it from there.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-237
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: New Feature
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 2.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ivan Yatskevich
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This new feature should allow to use jMock in the following way:
&lt;br&gt;&amp;gt; public class JMockRuleTest {
&lt;br&gt;&amp;gt; &amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt; It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26298744.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26273074</id>
	<title>[jira] Commented: (JMOCK-197) Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.</title>
	<published>2009-11-09T12:23:55Z</published>
	<updated>2009-11-09T12:23:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197751#action_197751&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197751#action_197751&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Ryan Hoegg commented on JMOCK-197:
&lt;br&gt;----------------------------------
&lt;br&gt;&lt;br&gt;Did you ever make the small, self-contained JUnit test?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Mocking a static nested class causes a net.sf.cglib.core.CodeGenerationException to be thrown.
&lt;br&gt;&amp;gt; ----------------------------------------------------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-197
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-197&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-197&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Components: JMock 1.x.x Library
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 1.2.0
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Ryan C. Payne
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In some code that I have inherited I have a class with a static nested class. In the past (jMock 1.1.0) I was able to successfully mock this static nested class. After upgrading to jMock 1.2.0, this no longer works. I end up getting the following exception:
&lt;br&gt;&amp;gt; net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError--&amp;gt;tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:63)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:46)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:35)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
&lt;br&gt;&amp;gt; 	at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
&lt;br&gt;&amp;gt; 	at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
&lt;br&gt;&amp;gt; 	at com.mycompany.core.persistence.hbm.HBMBaseDAOTest.testLimitResultSet(HBMBaseDAOTest.java:117)
&lt;br&gt;&amp;gt; Caused by: java.lang.IllegalAccessError: tried to access method org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.CGLIB$setPageNumber$6(I)V from class org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5
&lt;br&gt;&amp;gt; 	at org.jmock.codegen.org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6$$FastClassByCGLIB$$e9f65fd5.invoke(&amp;lt;generated&amp;gt;)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.intercept(CGLIBCoreMock.java:79)
&lt;br&gt;&amp;gt; 	at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.setPageNumber(&amp;lt;generated&amp;gt;)
&lt;br&gt;&amp;gt; 	at com.mycompany.core.util.DataPage$DataPageDefinition.&amp;lt;init&amp;gt;(DataPage.java:280)
&lt;br&gt;&amp;gt; 	at com.mycompany.core.util.DataPage$DataPageDefinition.&amp;lt;init&amp;gt;(DataPage.java:267)
&lt;br&gt;&amp;gt; 	at org.jmock.codegen.com.mycompany.core.util.DataPage$DataPageDefinition$$EnhancerByCGLIB$$3417fee6.&amp;lt;init&amp;gt;(&amp;lt;generated&amp;gt;)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
&lt;br&gt;&amp;gt; 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
&lt;br&gt;&amp;gt; 	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
&lt;br&gt;&amp;gt; 	... 58 more
&lt;br&gt;&amp;gt; Research led me to the following:
&lt;br&gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;http://www.gg3721.com/list/50/44427.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.gg3721.com/list/50/44427.html&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&amp;gt; and the followup
&lt;br&gt;&amp;gt; &amp;nbsp; &lt;a href=&quot;http://www.gg3721.com/list/50/44774.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.gg3721.com/list/50/44774.html&lt;/a&gt;&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-197%29-Mocking-a-static-nested-class-causes-a-net.sf.cglib.core.CodeGenerationException-to-be-thrown.-tp18724689p26273074.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26273075</id>
	<title>[jira] Commented: (JMOCK-125) Not able to mock classes with no visible construtor</title>
	<published>2009-11-09T12:23:55Z</published>
	<updated>2009-11-09T12:23:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">&lt;br&gt;&amp;nbsp; &amp;nbsp; [ &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197752#action_197752&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=197752#action_197752&lt;/a&gt;&amp;nbsp;] 
&lt;br&gt;&lt;br&gt;Ryan Hoegg commented on JMOCK-125:
&lt;br&gt;----------------------------------
&lt;br&gt;&lt;br&gt;Do you plan to fix this for 1.2.0 as well?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Not able to mock classes with no visible construtor
&lt;br&gt;&amp;gt; ---------------------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Key: JMOCK-125
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-125&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-125&lt;/a&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project: jMock
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Issue Type: Bug
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Affects Versions: 1.2.0, 2.1.0-RC4
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Reporter: Chuck Y
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Assignee: Nat Pryce
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Fix For: 2.1.0-RC4
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Attachments: mocktest.jar
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; java.lang.IllegalArgumentException: No visible constructors in class org.src.TestClass
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.filterConstructors(Enhancer.java:531)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:448)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:63)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:46)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:35)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
&lt;br&gt;&amp;gt; 	at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
&lt;br&gt;&amp;gt; 	at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
&lt;br&gt;&amp;gt; 	at org.src.ClassUnderTestTest.test(ClassUnderTestTest.java:63)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
&lt;br&gt;&amp;gt; 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
&lt;br&gt;&amp;gt; 	at java.lang.reflect.Method.invoke(Unknown Source)
&lt;br&gt;&amp;gt; 	at junit.framework.TestCase.runTest(TestCase.java:164)
&lt;br&gt;&amp;gt; 	at org.jmock.core.VerifyingTestCase.runBare(VerifyingTestCase.java:39)
&lt;br&gt;&amp;gt; 	at junit.framework.TestResult$1.protect(TestResult.java:110)
&lt;br&gt;&amp;gt; 	at junit.framework.TestResult.runProtected(TestResult.java:128)
&lt;br&gt;&amp;gt; 	at junit.framework.TestResult.run(TestResult.java:113)
&lt;br&gt;&amp;gt; 	at junit.framework.TestCase.run(TestCase.java:120)
&lt;br&gt;&amp;gt; 	at junit.framework.TestSuite.runTest(TestSuite.java:228)
&lt;br&gt;&amp;gt; 	at junit.framework.TestSuite.run(TestSuite.java:223)
&lt;br&gt;&amp;gt; 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
&lt;br&gt;&amp;gt; If filterConstructors() is overridden to do nothing, by patching.. I get this exception...
&lt;br&gt;&amp;gt; net.sf.cglib.core.CodeGenerationException: java.lang.IllegalAccessError--&amp;gt;tried to access method org.src.TestClass.&amp;lt;init&amp;gt;()V from class org.jmock.codegen.org.src.TestClass$$EnhancerByCGLIB$$11111fbf
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:636)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:304)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:63)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:46)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.CGLIBCoreMock.&amp;lt;init&amp;gt;(CGLIBCoreMock.java:35)
&lt;br&gt;&amp;gt; 	at org.jmock.cglib.MockObjectTestCase.newCoreMock(MockObjectTestCase.java:33)
&lt;br&gt;&amp;gt; 	at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:67)
&lt;br&gt;&amp;gt; 	at org.jmock.MockObjectTestCase.mock(MockObjectTestCase.java:55)
&lt;br&gt;&amp;gt; 	at org.src.ClassUnderTestTest.test(ClassUnderTestTest.java:66)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
&lt;br&gt;&amp;gt; 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
&lt;br&gt;&amp;gt; 	at java.lang.reflect.Method.invoke(Unknown Source)
&lt;br&gt;&amp;gt; 	at junit.framework.TestCase.runTest(TestCase.java:164)
&lt;br&gt;&amp;gt; 	at org.jmock.core.VerifyingTestCase.runBare(VerifyingTestCase.java:39)
&lt;br&gt;&amp;gt; 	at junit.framework.TestResult$1.protect(TestResult.java:110)
&lt;br&gt;&amp;gt; 	at junit.framework.TestResult.runProtected(TestResult.java:128)
&lt;br&gt;&amp;gt; 	at junit.framework.TestResult.run(TestResult.java:113)
&lt;br&gt;&amp;gt; 	at junit.framework.TestCase.run(TestCase.java:120)
&lt;br&gt;&amp;gt; 	at junit.framework.TestSuite.runTest(TestSuite.java:228)
&lt;br&gt;&amp;gt; 	at junit.framework.TestSuite.run(TestSuite.java:223)
&lt;br&gt;&amp;gt; 	at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
&lt;br&gt;&amp;gt; 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
&lt;br&gt;&amp;gt; Caused by: java.lang.IllegalAccessError: tried to access method org.src.TestClass.&amp;lt;init&amp;gt;()V from class org.jmock.codegen.org.src.TestClass$$EnhancerByCGLIB$$11111fbf
&lt;br&gt;&amp;gt; 	at org.jmock.codegen.org.src.TestClass$$EnhancerByCGLIB$$11111fbf.&amp;lt;init&amp;gt;(&amp;lt;generated&amp;gt;)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
&lt;br&gt;&amp;gt; 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
&lt;br&gt;&amp;gt; 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
&lt;br&gt;&amp;gt; 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
&lt;br&gt;&amp;gt; 	at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)
&lt;br&gt;&amp;gt; 	... 32 more
&lt;br&gt;&amp;gt; No offence to JMock developers, but Ea$yMock is able to do this.
&lt;/div&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-125%29-Not-able-to-mock-classes-with-no-visible-construtor-tp10711453p26273075.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26258696</id>
	<title>Ability to use jMock through the Rule mechanism</title>
	<published>2009-11-08T14:26:27Z</published>
	<updated>2009-11-08T14:26:27Z</updated>
	<author>
		<name>Ivan Yatskevich</name>
	</author>
	<content type="html">Hello everybody!
&lt;br&gt;&lt;br&gt;As all of you probably know a new feature, Rule mechanism, has been
&lt;br&gt;added to JUnit 4.7.
&lt;br&gt;After the discussion with David Saff (main JUnit contributor) and Nat
&lt;br&gt;Pryce it comes out that it is better to use jMock through the Rule
&lt;br&gt;mechanism and not through the runner:
&lt;br&gt;&lt;br&gt;public class JMockRuleTest {
&lt;br&gt;&amp;nbsp; @Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;This approach will allow to use jMock with a custom JUnit runner like
&lt;br&gt;Theories or your favorite one.
&lt;br&gt;&lt;br&gt;I'm going to implement this feature and want to know your valuable
&lt;br&gt;opinion on what kind of API you expect.
&lt;br&gt;Personally I think that this new API will be similar to the current
&lt;br&gt;Mockery's one.
&lt;br&gt;&lt;br&gt;I've already created a new issue in JIRA -
&lt;br&gt;&lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Best regards,
&lt;br&gt;Ivan Yatskevich
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Ability-to-use-jMock-through-the-Rule-mechanism-tp26258696p26258696.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26258349</id>
	<title>[jira] Created: (JMOCK-237) Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)</title>
	<published>2009-11-08T13:47:55Z</published>
	<updated>2009-11-08T13:47:55Z</updated>
	<author>
		<name>JIRA jira@codehaus.org</name>
	</author>
	<content type="html">Ability to use jMock through the Rule mechanism (introduced in JUnit 4.7)
&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Key: JMOCK-237
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;URL: &lt;a href=&quot;http://jira.codehaus.org/browse/JMOCK-237&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/JMOCK-237&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Project: jMock
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Issue Type: New Feature
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Components: JMock 2.x.x Library
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Reporter: Ivan Yatskevich
&lt;br&gt;&lt;br&gt;&lt;br&gt;This new feature should allow to use jMock in the following way:
&lt;br&gt;&lt;br&gt;public class JMockRuleTest {
&lt;br&gt;&amp;nbsp;@Rule public Verifier jmock = new JMockVerifier();
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;It will also open the possibility of using jMock with a custom JUnit runner like Theories.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;This message is automatically generated by JIRA.
&lt;br&gt;-
&lt;br&gt;If you think it was sent incorrectly contact one of the administrators: &lt;a href=&quot;http://jira.codehaus.org/secure/Administrators.jspa&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/secure/Administrators.jspa&lt;/a&gt;&lt;br&gt;-
&lt;br&gt;For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---Dev-f2664.html&quot; embed=&quot;fixTarget[2664]&quot; target=&quot;_top&quot; &gt;jMock - Dev&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-jira--Created%3A-%28JMOCK-237%29-Ability-to-use-jMock-through-the-Rule-mechanism-%28introduced-in-JUnit-4.7%29-tp26258349p26258349.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26131106</id>
	<title>Re: Advice on testing my classes that has many third party API calls.</title>
	<published>2009-10-30T07:33:28Z</published>
	<updated>2009-10-30T07:33:28Z</updated>
	<author>
		<name>Steve Freeman-2</name>
	</author>
	<content type="html">On 27 Oct 2009, at 10:36, LadyCoconut wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; My questions are:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1. in my test I am using the matchers with(any(OpertionOptions.class),
&lt;br&gt;&amp;gt; with(any(Profile.class) and such....should I be mocking these concrete
&lt;br&gt;&amp;gt; classes using the ClassImposteriser and setting them up and checking &amp;nbsp;
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; exact expectations of these? It feels a bit wrong. All I want to &amp;nbsp;
&lt;br&gt;&amp;gt; test is
&lt;br&gt;&amp;gt; that a call to the service is made and that I get back an expected &amp;nbsp;
&lt;br&gt;&amp;gt; type with
&lt;br&gt;&amp;gt; some parameters in it?
&lt;/div&gt;&lt;br&gt;You want to check, for example, that the ObjectIdentitySet has been &amp;nbsp;
&lt;br&gt;set up correctly? You could write a more precise matcher that checks &amp;nbsp;
&lt;br&gt;the values within the ObjectIdSet that was passed in. Something like:
&lt;br&gt;&lt;br&gt;oneOf(objectService).get(with(objectIdentitySetWithId(1)), ...
&lt;br&gt;&lt;br&gt;If you just want to let the call go through, then the any() clauses &amp;nbsp;
&lt;br&gt;are fine--that's your intention. You can simplify it further, if &amp;nbsp;
&lt;br&gt;there's only one call to an object:
&lt;br&gt;&lt;br&gt;allowing(objectService); will(returnValue(dataPackage));
&lt;br&gt;&lt;br&gt;if that's all you care about. (Remember: Stub Queries, Expect Actions)
&lt;br&gt;&lt;br&gt;&amp;gt; 2. Should I be spending my time skinning and wrapping the API for &amp;nbsp;
&lt;br&gt;&amp;gt; testing?
&lt;br&gt;&amp;gt; As its rather a small project at the moment, I managed to create a &amp;nbsp;
&lt;br&gt;&amp;gt; stub
&lt;br&gt;&amp;gt; service initially that returns some duff data.
&lt;br&gt;&lt;br&gt;That depends :) At the least, I'd have some kind of interface in my &amp;nbsp;
&lt;br&gt;domain code that protected me from the library, so there were no &amp;nbsp;
&lt;br&gt;references.
&lt;br&gt;&lt;br&gt;S.
&lt;br&gt;&lt;br&gt;Steve Freeman
&lt;br&gt;&lt;br&gt;Winner of the Agile Alliance Gordon Pask award 2006
&lt;br&gt;Book: &lt;a href=&quot;http://www.growing-object-oriented-software.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.growing-object-oriented-software.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;+44 (0) 797 179 4105
&lt;br&gt;M3P Limited. &amp;nbsp;&lt;a href=&quot;http://www.m3p.co.uk&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.m3p.co.uk&lt;/a&gt;&lt;br&gt;Registered office. 2 Church Street, Burnham, Bucks, SL1 7HZ.
&lt;br&gt;Company registered in England &amp; Wales. Number 03689627
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Advice-on-testing-my-classes-that-has-many-third-party-API-calls.-tp26075443p26131106.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26099734</id>
	<title>Re: Differences between jMock &amp; Mockito</title>
	<published>2009-10-28T11:27:52Z</published>
	<updated>2009-10-28T11:27:52Z</updated>
	<author>
		<name>Steve Freeman-2</name>
	</author>
	<content type="html">&lt;div class='shrinkable-quote'&gt;&amp;gt; Julian Hall wrote:
&lt;br&gt;&amp;gt;&amp;gt; isaiah perumalla wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Jmock will highlight badly designed communication protocols &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; between object under test and its collaborators. On the other &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; hand, frameworks like mockito by default ignore all calls between &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the object under test and it's mocked collaborator(s) and only &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; verifies calls you explicitly specify.
&lt;br&gt;&amp;gt;&amp;gt; There is, of course, a halfway ground to consider. &amp;nbsp;When I'm &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; working in .NET, I tend to use Rhino.Mocks. &amp;nbsp;This has the &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; interesting facility that if you call MockRepository.CreateMock to &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; create your mock, you end up with something that behaves like JMock &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; does, but if you call MockRepository.DynamicMock you end up with a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; stub implementation that ignores unexpected calls, or you can use &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; MockRepository.PartialMock when mocking a concrete class to get a &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; stub that passes calls to the original implementation by default. &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; It's still a &amp;quot;set expectations before running your code&amp;quot; style of &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; interaction rather than the &amp;quot;verify what happened after you've done &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; it&amp;quot; style you use with Mockito, but it's a little more flexible &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; than JMock.
&lt;/div&gt;&lt;br&gt;Actually, JMock does the first two without have to choose when &amp;nbsp;
&lt;br&gt;declaring the mock. The third is just a bad idea unless it's an &amp;nbsp;
&lt;br&gt;emergency :)
&lt;br&gt;&lt;br&gt;S.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/jMock---User-f2665.html&quot; embed=&quot;fixTarget[2665]&quot; target=&quot;_top&quot; &gt;jMock - User&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Differences-between-jMock---Mockito-tp26023576p26099734.html" />
</entry>

</feed>
