<?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 Delete Actions in Grails</title>
	<atom:link href="http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/</link>
	<description></description>
	<lastBuildDate>Wed, 16 Dec 2009 22:09:57 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: j pimmel</title>
		<link>http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/comment-page-1/#comment-67</link>
		<dc:creator>j pimmel</dc:creator>
		<pubDate>Wed, 09 Sep 2009 01:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.caffeinated.at/?p=80#comment-67</guid>
		<description>Minor, but my preference is to separate testing domain object constraints using unit tests and then use integration tests for queries/HQL and anything else really.
.-= j pimmel&#180;s last blog ..&lt;a href=&quot;http://feedproxy.google.com/~r/actualise/tech/~3/daR-liK0k2U/&quot; rel=&quot;nofollow&quot;&gt;Selenium has evolved; enter Bromine&lt;/a&gt; =-.</description>
		<content:encoded><![CDATA[<p>Minor, but my preference is to separate testing domain object constraints using unit tests and then use integration tests for queries/HQL and anything else really.<br />
<span class="cluv"> j pimmel&#180;s last blog ..<a href="http://feedproxy.google.com/~r/actualise/tech/~3/daR-liK0k2U/" rel="nofollow">Selenium has evolved; enter Bromine</a> <span class="heart_tip_box"><img class="heart_tip" alt="My ComLuv Profile" border="0" width="16" height="14" src="http://www.caffeinated.at/wp-content/plugins/commentluv/images/littleheart.gif"/></span></span></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flo</title>
		<link>http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/comment-page-1/#comment-66</link>
		<dc:creator>Flo</dc:creator>
		<pubDate>Mon, 07 Sep 2009 18:56:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.caffeinated.at/?p=80#comment-66</guid>
		<description>Oh yes, I actually ran into that problem with Criteria and HQL!</description>
		<content:encoded><![CDATA[<p>Oh yes, I actually ran into that problem with Criteria and HQL!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flo</title>
		<link>http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/comment-page-1/#comment-65</link>
		<dc:creator>Flo</dc:creator>
		<pubDate>Mon, 07 Sep 2009 18:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.caffeinated.at/?p=80#comment-65</guid>
		<description>To be honest it was not my decision but a requirment to unit test those classes. After playing around a bit I encountered some situations where i needed to rewrite the controller code to make the test pass which I think is really annoying and error-prone. Also I had some issues regarding dynamic methods like countBy* which is not provided in current version but has been added to git head by Graeme recently. I would also favour integration tests I think.</description>
		<content:encoded><![CDATA[<p>To be honest it was not my decision but a requirment to unit test those classes. After playing around a bit I encountered some situations where i needed to rewrite the controller code to make the test pass which I think is really annoying and error-prone. Also I had some issues regarding dynamic methods like countBy* which is not provided in current version but has been added to git head by Graeme recently. I would also favour integration tests I think.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Burt Beckwith</title>
		<link>http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/comment-page-1/#comment-64</link>
		<dc:creator>Burt Beckwith</dc:creator>
		<pubDate>Sun, 06 Sep 2009 17:57:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.caffeinated.at/?p=80#comment-64</guid>
		<description>I didn&#039;t say I don&#039;t test domain classes, I said I use integrations tests for those. I want them to run in a database, otherwise their persistence isn&#039;t really tested, only constraints, etc. to the extent that the testing plugin has implemented that. How would you test domain class methods that use HQL or Criteria queries using mocks?

Having tested the domain classes, then I&#039;m comfortable mocking them out to test controllers, services, etc. since they&#039;re tested and just a dependency - I&#039;m only concerned that the controller logic is correct when testing controllers, I don&#039;t worry about the domain classes and just mock out their return values.</description>
		<content:encoded><![CDATA[<p>I didn&#8217;t say I don&#8217;t test domain classes, I said I use integrations tests for those. I want them to run in a database, otherwise their persistence isn&#8217;t really tested, only constraints, etc. to the extent that the testing plugin has implemented that. How would you test domain class methods that use HQL or Criteria queries using mocks?</p>
<p>Having tested the domain classes, then I&#8217;m comfortable mocking them out to test controllers, services, etc. since they&#8217;re tested and just a dependency &#8211; I&#8217;m only concerned that the controller logic is correct when testing controllers, I don&#8217;t worry about the domain classes and just mock out their return values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flo</title>
		<link>http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/comment-page-1/#comment-61</link>
		<dc:creator>Flo</dc:creator>
		<pubDate>Sat, 05 Sep 2009 08:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.caffeinated.at/?p=80#comment-61</guid>
		<description>Hi Burt! Thanks for your reply! Normally the delete operation would be somewhere deep in a controller, as it was in my real case. So you think it makes no sense mocking domain classes and unit testing them? The testing plugin would be pretty useless then...? Indeed you rely on the testing framework but it has been tested itself. Don&#039;t you have to trust in an implementation when using a framework? IMHO I think you can test business logic quite good! I&#039;m quite new to that topic so thanks for your feedback!</description>
		<content:encoded><![CDATA[<p>Hi Burt! Thanks for your reply! Normally the delete operation would be somewhere deep in a controller, as it was in my real case. So you think it makes no sense mocking domain classes and unit testing them? The testing plugin would be pretty useless then&#8230;? Indeed you rely on the testing framework but it has been tested itself. Don&#8217;t you have to trust in an implementation when using a framework? IMHO I think you can test business logic quite good! I&#8217;m quite new to that topic so thanks for your feedback!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Burt Beckwith</title>
		<link>http://www.caffeinated.at/2009/09/unit-testing-delete-actions-in-grails/comment-page-1/#comment-60</link>
		<dc:creator>Burt Beckwith</dc:creator>
		<pubDate>Fri, 04 Sep 2009 23:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.caffeinated.at/?p=80#comment-60</guid>
		<description>I don&#039;t test domain classes using mocks, you&#039;re just testing the mocking framework with code like this. I prefer to use integration tests for domain class tests, and use mocks only when testing classes that depend on domain classes (controllers, services, etc.) since I know that they work since they&#039;re already tested.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t test domain classes using mocks, you&#8217;re just testing the mocking framework with code like this. I prefer to use integration tests for domain class tests, and use mocks only when testing classes that depend on domain classes (controllers, services, etc.) since I know that they work since they&#8217;re already tested.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
