<?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: How to Unit-test private methods</title>
	<atom:link href="http://technology.amis.nl/2007/09/24/how-to-unit-test-private-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl/2007/09/24/how-to-unit-test-private-methods/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-unit-test-private-methods</link>
	<description></description>
	<lastBuildDate>Fri, 12 Apr 2013 10:04:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Tom</title>
		<link>http://technology.amis.nl/2007/09/24/how-to-unit-test-private-methods/#comment-4915</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Sun, 02 Aug 2009 08:17:42 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=2411#comment-4915</guid>
		<description><![CDATA[A private method call generator: http://code.google.com/p/hexacta-booster/
Enjoy!]]></description>
		<content:encoded><![CDATA[<p>A private method call generator: <a href="http://code.google.com/p/hexacta-booster/" rel="nofollow">http://code.google.com/p/hexacta-booster/</a><br />
Enjoy!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Lawrey</title>
		<link>http://technology.amis.nl/2007/09/24/how-to-unit-test-private-methods/#comment-4914</link>
		<dc:creator>Peter Lawrey</dc:creator>
		<pubDate>Tue, 25 Sep 2007 20:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=2411#comment-4914</guid>
		<description><![CDATA[You can access private method this way, but you shouldn&#039;t need to unit test them.  They should be hidden implementation details which you should be able to replace or remove without breaking your unit tests.
If you really must test them, you can make them package private and give your unit tests the same package. (in another base directory)

You can do alot worse with reflections.  You can set final fields and static finals.  You can get the &quot;defineClass&quot; method on your class loader and inject classes which don&#039;t appear on disk.
If you want really dangerous, try the sun.misc.Unsafe class which lets you do alot of the things Java was supposed to prevent you from doing. :)]]></description>
		<content:encoded><![CDATA[<p>You can access private method this way, but you shouldn&#8217;t need to unit test them.  They should be hidden implementation details which you should be able to replace or remove without breaking your unit tests.<br />
If you really must test them, you can make them package private and give your unit tests the same package. (in another base directory)</p>
<p>You can do alot worse with reflections.  You can set final fields and static finals.  You can get the &#8220;defineClass&#8221; method on your class loader and inject classes which don&#8217;t appear on disk.<br />
If you want really dangerous, try the sun.misc.Unsafe class which lets you do alot of the things Java was supposed to prevent you from doing. <img src='http://technology.amis.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
