<?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"
	>
<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>
	<pubDate>Tue, 06 Jan 2009 04:12:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: tednaleid</title>
		<link>http://naleid.com/blog/2008/03/24/unit-testing-isolated-methods-with-groovy/#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've only ever used the interface mocking abilities of EasyMock and haven'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'm doing above.  It'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'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-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="">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="">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>
