<?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: Unit Testing Isolated Methods with Groovy</title>
	<atom:link href="http://naleid.com/blog/2008/03/24/unit-testing-isolated-methods-with-groovy/feed/" rel="self" type="application/rss+xml" />
	<link>http://naleid.com/blog/2008/03/24/unit-testing-isolated-methods-with-groovy/</link>
	<description>Groovy, Grails and OS X tips and tricks</description>
	<lastBuildDate>Sat, 31 Jul 2010 11:43:17 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ewan Dawson</title>
		<link>http://naleid.com/blog/2008/03/24/unit-testing-isolated-methods-with-groovy/comment-page-1/#comment-2606</link>
		<dc:creator>Ewan Dawson</dc:creator>
		<pubDate>Thu, 25 Mar 2010 09:40:20 +0000</pubDate>
		<guid isPermaLink="false">http://tednaleid.wordpress.com/?p=9#comment-2606</guid>
		<description>Great example.  Metaprogramming really makes testing a whole lot easier.</description>
		<content:encoded><![CDATA[<p>Great example.  Metaprogramming really makes testing a whole lot easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2008/03/24/unit-testing-isolated-methods-with-groovy/comment-page-1/#comment-10</link>
		<dc:creator>tednaleid</dc:creator>
		<pubDate>Tue, 01 Apr 2008 03:18:25 +0000</pubDate>
		<guid isPermaLink="false">http://tednaleid.wordpress.com/?p=9#comment-10</guid>
		<description>Hamlet, thanks for your response!

I&#039;ve only ever used the interface mocking abilities of EasyMock and haven&#039;t tried it with the class extensions.  From a brief look, it appears that using the class extensions to create a partial mock is pretty similar to what I&#039;m doing above.  It&#039;s pulling a reference to the method under test and mocking out the rest of the class.

The Test-Specific Subclass pattern is another good alternative.  Though it sounds like it might be a bit of work to create a new subclass and maintain the additional instrumentation on the subclass that exposes and controls the state for testing.

I could definitely see that pattern being useful when working with legacy code that you don&#039;t have much control over.</description>
		<content:encoded><![CDATA[<p>Hamlet, thanks for your response!</p>
<p>I&#8217;ve only ever used the interface mocking abilities of EasyMock and haven&#8217;t tried it with the class extensions.  From a brief look, it appears that using the class extensions to create a partial mock is pretty similar to what I&#8217;m doing above.  It&#8217;s pulling a reference to the method under test and mocking out the rest of the class.</p>
<p>The Test-Specific Subclass pattern is another good alternative.  Though it sounds like it might be a bit of work to create a new subclass and maintain the additional instrumentation on the subclass that exposes and controls the state for testing.</p>
<p>I could definitely see that pattern being useful when working with legacy code that you don&#8217;t have much control over.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hamlet D'Arcy</title>
		<link>http://naleid.com/blog/2008/03/24/unit-testing-isolated-methods-with-groovy/comment-page-1/#comment-9</link>
		<dc:creator>Hamlet D'Arcy</dc:creator>
		<pubDate>Sun, 30 Mar 2008 11:49:42 +0000</pubDate>
		<guid isPermaLink="false">http://tednaleid.wordpress.com/?p=9#comment-9</guid>
		<description>Very clever.There are a couple other solutions I use that work in Java as well.

1. Write a test specific subclass and override the method you want  to mock out. http://xunitpatterns.com/Test-Specific%20Subclass.html

2. Use the EasyMock class extensions and create a partial mock. http://easymock.org/EasyMock2_3_ClassExtension_Documentation.html

The calling semantics of your test helper is pretty nice though!</description>
		<content:encoded><![CDATA[<p>Very clever.There are a couple other solutions I use that work in Java as well.</p>
<p>1. Write a test specific subclass and override the method you want  to mock out. <a href="http://xunitpatterns.com/Test-Specific%20Subclass.html" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/xunitpatterns.com/Test-Specific_20Subclass.html?referer=');">http://xunitpatterns.com/Test-Specific%20Subclass.html</a></p>
<p>2. Use the EasyMock class extensions and create a partial mock. <a href="http://easymock.org/EasyMock2_3_ClassExtension_Documentation.html" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/easymock.org/EasyMock2_3_ClassExtension_Documentation.html?referer=');">http://easymock.org/EasyMock2_3_ClassExtension_Documentation.html</a></p>
<p>The calling semantics of your test helper is pretty nice though!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
