<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mocking with JMockit</title>
	<atom:link href="http://cwash.org/2009/06/09/mocking-with-jmockit/feed/" rel="self" type="application/rss+xml" />
	<link>http://cwash.org/2009/06/09/mocking-with-jmockit/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mocking-with-jmockit</link>
	<description>+= construction + craftsmanship;</description>
	<lastBuildDate>Fri, 26 Feb 2010 06:16:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
	<item>
		<title>By: Chris Wash</title>
		<link>http://cwash.org/2009/06/09/mocking-with-jmockit/comment-page-1/#comment-3375</link>
		<dc:creator>Chris Wash</dc:creator>
		<pubDate>Fri, 26 Feb 2010 06:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://cwash.org/?p=322#comment-3375</guid>
		<description>@Vik

JMockit (or any mocking framework) will allow you to assert that the code that you call to hit the database actually gets called in your controller.  Setting up the mocks and writing the test is going to depend on what you&#039;re doing, but in general what you are going to want to do to test the controller is define expectations around the code you mentioned in your Application JAR that hits the database, and from your test you want to exercise your controller&#039;s execute method.  In my example I&#039;m expecting the mockService to have its getModel method called and return a model object.  You can set yours up simiarly.  The controller also will be touching the HttpRequest which I have set up expectations for as well.  Hope this helps!</description>
		<content:encoded><![CDATA[<p>@Vik</p>
<p>JMockit (or any mocking framework) will allow you to assert that the code that you call to hit the database actually gets called in your controller.  Setting up the mocks and writing the test is going to depend on what you&#8217;re doing, but in general what you are going to want to do to test the controller is define expectations around the code you mentioned in your Application JAR that hits the database, and from your test you want to exercise your controller&#8217;s execute method.  In my example I&#8217;m expecting the mockService to have its getModel method called and return a model object.  You can set yours up simiarly.  The controller also will be touching the HttpRequest which I have set up expectations for as well.  Hope this helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vik</title>
		<link>http://cwash.org/2009/06/09/mocking-with-jmockit/comment-page-1/#comment-3370</link>
		<dc:creator>vik</dc:creator>
		<pubDate>Wed, 24 Feb 2010 19:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://cwash.org/?p=322#comment-3370</guid>
		<description>Hi Chris,

I have a scenario where I have to write the TestCases using JMockit.
We are using JPF controllers for the portal applications.I have to write test cases for the JPF Controllers.Here the portal code is not allowed to hit any database directly instead we have to use the Application JAR in which there are methods which can hit the database.

I am in real confusion how to write jmockit test cases for this type of controllers..
Please help me</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>I have a scenario where I have to write the TestCases using JMockit.<br />
We are using JPF controllers for the portal applications.I have to write test cases for the JPF Controllers.Here the portal code is not allowed to hit any database directly instead we have to use the Application JAR in which there are methods which can hit the database.</p>
<p>I am in real confusion how to write jmockit test cases for this type of controllers..<br />
Please help me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rogério Liesenfeld</title>
		<link>http://cwash.org/2009/06/09/mocking-with-jmockit/comment-page-1/#comment-3252</link>
		<dc:creator>Rogério Liesenfeld</dc:creator>
		<pubDate>Sun, 14 Jun 2009 00:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://cwash.org/?p=322#comment-3252</guid>
		<description>No plans regarding Maven or Ivy repositories yet...

I looked for an easy way to automate the upload to a Maven repo a few weeks ago, but could not find one.
If someone knows how to do it without some huge effort, I would appreciate it.

Thanks</description>
		<content:encoded><![CDATA[<p>No plans regarding Maven or Ivy repositories yet&#8230;</p>
<p>I looked for an easy way to automate the upload to a Maven repo a few weeks ago, but could not find one.<br />
If someone knows how to do it without some huge effort, I would appreciate it.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Wash</title>
		<link>http://cwash.org/2009/06/09/mocking-with-jmockit/comment-page-1/#comment-3244</link>
		<dc:creator>Chris Wash</dc:creator>
		<pubDate>Fri, 12 Jun 2009 01:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://cwash.org/?p=322#comment-3244</guid>
		<description>@Rogerio - thanks for the advice - I&#039;ll make these changes on the project in github.  Any plans to get JMockit distros plugged into a remote Maven repo?</description>
		<content:encoded><![CDATA[<p>@Rogerio &#8211; thanks for the advice &#8211; I&#8217;ll make these changes on the project in github.  Any plans to get JMockit distros plugged into a remote Maven repo?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rogério Liesenfeld</title>
		<link>http://cwash.org/2009/06/09/mocking-with-jmockit/comment-page-1/#comment-3240</link>
		<dc:creator>Rogério Liesenfeld</dc:creator>
		<pubDate>Wed, 10 Jun 2009 03:00:12 +0000</pubDate>
		<guid isPermaLink="false">http://cwash.org/?p=322#comment-3240</guid>
		<description>Nice! Good to see that release 0.98 is already being used 8^)

Your example test works fine, but two simplifications can be made.
First, the calls to &quot;newEmptyProxy&quot; are redundant, since JMockit already creates and assigns automatically an instance to each mock field.
Second, the call to &quot;endRecording()&quot; is no longer required in cases like this. JMockit will automatically switch from record to replay at the end of each Expectations initialization block.</description>
		<content:encoded><![CDATA[<p>Nice! Good to see that release 0.98 is already being used 8^)</p>
<p>Your example test works fine, but two simplifications can be made.<br />
First, the calls to &#8220;newEmptyProxy&#8221; are redundant, since JMockit already creates and assigns automatically an instance to each mock field.<br />
Second, the call to &#8220;endRecording()&#8221; is no longer required in cases like this. JMockit will automatically switch from record to replay at the end of each Expectations initialization block.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

