<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>On Tech and Software &#187; easymock</title>
	<atom:link href="http://jmgtan.com/tag/easymock/feed/" rel="self" type="application/rss+xml" />
	<link>http://jmgtan.com</link>
	<description>Random thoughts on technology, ventures, algorithms, frameworks, gadgets and THE MAN</description>
	<lastBuildDate>Fri, 02 Jul 2010 11:14:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>JUnit and EasyMock</title>
		<link>http://jmgtan.com/2009/09/08/junit-and-easymock/</link>
		<comments>http://jmgtan.com/2009/09/08/junit-and-easymock/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 01:04:04 +0000</pubDate>
		<dc:creator>Jan Michael Tan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[easymock]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://jmgtan.com/?p=170</guid>
		<description><![CDATA[Unit testing is tedious, but it has saved my bacon so many times already that even though it eats my time I still religiously create unit test cases for every important business logic use cases. I&#8217;ve been using Spring&#8217;s integration with JUnit and its very cool transaction support for test cases. Unfortunately with this approach, [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>Unit testing is tedious, but it has saved my bacon so many times already that even though it eats my time I still religiously create unit test cases for every important business logic use cases. I&#8217;ve been using Spring&#8217;s integration with JUnit and its very cool transaction support for test cases. Unfortunately with this approach, I have to craft test data to test every single code path for complex business logics. Although the setup, tearDown and rollback upon completion of the test case is handy, I still have to carefully craft the data.</p>
<p>Enter EasyMock, I know i&#8217;m late in the game with mock objects, but in the quest to meet deadlines and still have close to 100% test coverage (well I try to anyway), I haven&#8217;t had the time to actually check out what&#8217;s new in the TDD world.</p>
<p>At its most basic level, it allows you to record and replay the expected method calls and return values for methods that are being used by the object/method that you are currently testing. Aside from mocking interface classes you can also partially mock concrete classes (meaning mock only selected methods) using EasyMock&#8217;s Class Extension. With this, you have fine grain control on how each and every test case will behave.</p>
<p>Check it out at <a href="http://www.easymock.org">http://www.easymock.org</a></p>
<p>I&#8217;ll post a tutorial in my next blog post. There&#8217;s so much stuff in there that I haven&#8217;t used that I&#8217;ll have to start a new tutorial series just to cover this very cool mock framework.</p>
<p></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fjmgtan.com%2F2009%2F09%2F08%2Fjunit-and-easymock%2F&amp;linkname=JUnit%20and%20EasyMock"><img src="http://jmgtan.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://jmgtan.com/2009/09/08/junit-and-easymock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
