<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Object Mentor Blog: &lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?</title>
    <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>&amp;lt;a href=&amp;quot;http://infinitest.org/web/guest/home&amp;quot;&amp;gt;Infinitest&amp;lt;/A&amp;gt; for Java, have you tried it?</title>
      <description>&lt;h2&gt;Background&lt;/h2&gt;
About 2 years ago, I was working with &lt;a href="http://twitter.com/benrady"&gt;Ben Rady&lt;/a&gt; and he demonstrated something he was working on at the time: &lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt;. As often I am, I was a little interested but mostly skeptical &amp;#8211; don&amp;#8217;t know if that came across or not.

	&lt;p&gt;Since then he and others (e.g., &lt;a href="http://twitter.com/rcoffin"&gt;Rod Coffin&lt;/a&gt; have made amazing strides and created plugins for both Eclipse and IntelliJ.&lt;/p&gt;


&lt;h2&gt;Taking it for a test run&lt;/h2&gt;
Earlier this month, I finally decided to give it a test drive. When I made that announcement, &lt;a href="http://twitter.com/benrady"&gt;Ben&lt;/a&gt; made the following (bold?) statement:
&lt;blockquote&gt;
For me, using Infinitest is as different from &lt;span class="caps"&gt;TDD&lt;/span&gt; as &lt;span class="caps"&gt;TDD&lt;/span&gt; is from not testing
&lt;/blockquote&gt;

	&lt;p&gt;So is that true? Is using a continuous test execution tool as different from not using one as using &lt;span class="caps"&gt;TDD&lt;/span&gt; is from not testing? I&amp;#8217;m not sure I&amp;#8217;m there yet. However, I will say my brain is having some difficulty getting used to the cool feedback.&lt;/p&gt;


	&lt;p&gt;Here are two recent experiences I had using it.&lt;/p&gt;


&lt;h2&gt;Classpath Issues&lt;/h2&gt;
Back at the end of 2006 I wrote a &lt;a href="http://schuchert.wikispaces.com/EJB+3+and+Java+Persistence+API"&gt;class on using &lt;span class="caps"&gt;JPA&lt;/span&gt; and &lt;span class="caps"&gt;EJB 3&lt;/span&gt;&lt;/a&gt;. I&amp;#8217;ve not really done much to update that material in some years but recently I had an email from someone trying to work through the first tutorial with little success. Over the past few years there&amp;#8217;s been some bit-rot. The embeddable container is not really up to date, &lt;span class="caps"&gt;EJB 3&lt;/span&gt;.1 includes an embeddable container as part of its spec, Hibernate has been updated, etc. 

So I spent a few hours tracking down updated jar files and building my classpath. I had already installed &lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; and I noticed as added I something to my classpath, &lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; would kick off and show a stack trace (my code was doing that in a @Before method). So I sped up what I was doing:
	&lt;ul&gt;
	&lt;li&gt;I directly edited the .classpath file in Eclipse&lt;/li&gt;
		&lt;li&gt;Saved what I was doing&lt;/li&gt;
		&lt;li&gt;Waited about a second&lt;/li&gt;
		&lt;li&gt;Noticed the new stack trace&lt;/li&gt;
		&lt;li&gt;Found the next jar file I needed to add&lt;/li&gt;
		&lt;li&gt;Repeat until tests passed.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Might sound like a bit of overkill, but in the end I built a classpath from scratch and I ended up adding 13 jar files. So it saved some time.&lt;/p&gt;


	&lt;p&gt;Note, I wasn&amp;#8217;t looking for this. I had only installed &lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; the day before so this was unexpected and welcome! Oh, and before my @Before method was handling the exception properly, &lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; showed that the code had a problem (it was in the @After with a null pointer exception), which it indicated as an error like a syntax error or a validation error. Nice!&lt;/p&gt;


&lt;h2&gt;Using &lt;a href="http://mockito.org/"&gt;Mockito&lt;/a&gt;&lt;/h2&gt;
I&amp;#8217;ve recently been using &lt;a href="http://mockito.org/"&gt;Mockito&lt;/a&gt;. You can review &lt;a href="http://blog.objectmentor.com/articles/2009/05/27/mockito-example-java-mocking-framework"&gt;a previous blog entry&lt;/a&gt; for that example. Today we&amp;#8217;re holding the first &lt;a href="http://codingdojo.org/"&gt;coding dojo&lt;/a&gt; at the recently opened &lt;a href="http://okccoco.com/"&gt;OkC CoCo&lt;/a&gt;. Last night I started working on the next problem I want to use for the next dojo. It involves practicing using a &lt;a href="http://www.martinfowler.com/articles/mocksArentStubs.html#ClassicalAndMockistTesting"&gt;mockist approach&lt;/a&gt;. I set up my classpath, started writing tests and immediately I noticed what looked like a syntax error on the verification step of my first unit test. I was confused thinking I had an actual syntax error since I&amp;#8217;m not quite to the point of touch-typing &lt;a href="http://mockito.org/"&gt;Mockito&lt;/a&gt; based tests (I did update Eclipse so I could &lt;a href="http://jdcarlflip.blogspot.com/2008/07/eclipse-tip-static-imports.html"&gt;more easily find the static imports&lt;/a&gt;).&lt;p/&gt;

	&lt;p&gt;Next, I updated my test to use the @Mock annotation. I removed the hand-written initialization and immediately I noticed a &amp;#8220;syntax&amp;#8221; error &amp;#8211; null pointer exception. I was immediately (OK 1 second later) showed the impact of removing a single line of code. I added the missing line to auto-initialize the @Mock annotated fields but I did it incorrectly, so the error remained. I finally got the line correct and the &amp;#8220;syntax error&amp;#8221; went away.&lt;/p&gt;


&lt;h2&gt;Observations&lt;/h2&gt;
Wow. That&amp;#8217;s what I have to say so far. I&amp;#8217;m not entirely sure the before and after of using &lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; is the same size as moving from not testing to using &lt;span class="caps"&gt;TDD&lt;/span&gt;. Maybe it&amp;#8217;s the same as moving from being &lt;a href="http://c2.com/cgi/wiki?TestInfected"&gt;Test Infected&lt;/a&gt; to practicing &lt;span class="caps"&gt;TDD&lt;/span&gt;. I was &lt;a href="http://c2.com/cgi/wiki?TestInfected"&gt;Test Infected&lt;/a&gt; several years before I practiced &lt;span class="caps"&gt;TDD&lt;/span&gt;. 

	&lt;p&gt;I was also about as skeptical that moving to &lt;span class="caps"&gt;TDD&lt;/span&gt; from being &lt;a href="http://c2.com/cgi/wiki?TestInfected"&gt;Test Infected&lt;/a&gt; was useful. I was wrong. History tends to repeat itself, so I&amp;#8217;m guessing, based on my initial resistance, that this is the future.&lt;/p&gt;


	&lt;p&gt;Embrace it.&lt;/p&gt;</description>
      <pubDate>Thu, 18 Jun 2009 11:35:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e0b1e630-9d3c-4830-a1c9-87cfb0cea6d3</guid>
      <author>Brett Schuchert</author>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it</link>
      <category>Schuchert's Scattered Synapses </category>
      <category>infinitest</category>
      <category>TDD</category>
      <category>test</category>
      <category>infected</category>
      <category>mock</category>
      <category>mockito</category>
      <category>ejb</category>
      <category>3</category>
      <category>jpa</category>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by Womens Moncler Jackets</title>
      <description>&lt;p&gt;Everyone should have a Mens Moncler Jackets as it is the best outwear against the cold season and is also comfortable and light to wear.&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jan 2012 03:23:06 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:46c1688d-8cb2-401c-90f2-c64291715555</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-194228</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by Arcteryx Jackets</title>
      <description>&lt;p&gt;&lt;a href="http://www.arcteryxjackets-sale.com" rel="nofollow"&gt;http://www.arcteryxjackets-sale.com&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 20 Nov 2011 21:50:18 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:45bb5e82-1a4b-42ea-b082-d03691df0d87</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-176063</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by Spyder Jackets</title>
      <description>&lt;p&gt;&lt;a href="http://www.spyderjackets-outlet.net" rel="nofollow"&gt;http://www.spyderjackets-outlet.net&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 18 Nov 2011 00:50:15 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:8bec403c-587c-4e45-9826-71ffbe558db4</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-175232</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by okey oyunu oyna </title>
      <description>&lt;p&gt;thanks a lot.&lt;/p&gt;


	&lt;p&gt;internette g&#246;r&#252;nt&#252;l&#252; olarak &lt;a href="http://www.okeyoyunu-oyna.com" rel="nofollow"&gt;okey oyunu oyna&lt;/a&gt;, ger&#231;ek kisilerle tanis,
 turnuva heyecanini yasa.&lt;/p&gt;</description>
      <pubDate>Thu, 28 Apr 2011 14:35:36 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5700f51d-9af1-4368-bd71-9efbaeba9754</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-92767</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by centrifugal fan</title>
      <description>&lt;p&gt;Haile Electric Industrial Co. Ltd. is the leading manufacturer and exporter of cold room,axial fan,condensing unit,centrifugal fan,shaded pole motor and refrigeration products in China.&lt;/p&gt;</description>
      <pubDate>Mon, 28 Feb 2011 23:46:42 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:55bcb8e2-d29e-4d53-9678-cba180c9dfc1</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-67635</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by Pandora </title>
      <description>&lt;p&gt;Ok, so I&#8217;m getting good feedback on the first picture. Now for a series of pictures.&lt;/p&gt;</description>
      <pubDate>Thu, 02 Dec 2010 02:22:06 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:78166042-64bc-4b5d-ae5f-270c0de1b76b</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-45264</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by nike shoes hosting</title>
      <description>&lt;p&gt;Oh, and before my @Before method was handling the exception properly, Infinitest showed that the code had a problem (it was in the @After with a null pointer exception), which it indicated as an error like a syntax error or a validation error. Nice!&lt;/p&gt;</description>
      <pubDate>Thu, 03 Dec 2009 07:00:54 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:da1f3182-c5ec-4f08-be48-4af875787923</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-5372</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by Brett L. Schuchert</title>
      <description>&lt;p&gt;&lt;b&gt;Helen&lt;/b&gt; wrote:
&lt;blockquote&gt;
Are the circular links supposed to be funny or are they accidental? 
&lt;/blockquote&gt;&lt;/p&gt;


	&lt;p&gt;Now that you point them out, they are kind of funny. However, no it was a loose nut between the chair and the keyboard (me). When I typed the href incorrectly and then cut and pasted it like mad.&lt;/p&gt;


	&lt;p&gt;Thanks! &amp;#38;&amp;#38; Fixed!&lt;/p&gt;</description>
      <pubDate>Thu, 18 Jun 2009 14:49:33 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a96a6cbc-8f9a-47fa-9523-bf024260f3ea</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-3592</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by Jake B</title>
      <description>&lt;p&gt;I know what you mean when you say that this is the future. I cannot develop without my autotest (part of the ZenTest gem for Ruby) which does effectively the same thing.&lt;/p&gt;</description>
      <pubDate>Thu, 18 Jun 2009 14:26:14 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:47b5897a-dd99-44d6-95b4-ef888411e840</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-3591</link>
    </item>
    <item>
      <title>"&lt;a href="http://infinitest.org/web/guest/home"&gt;Infinitest&lt;/A&gt; for Java, have you tried it?" by Helen</title>
      <description>&lt;p&gt;Are the circular links supposed to be funny or are they accidental? (All links to Infinitest in this blog post link back to the post itself &amp;#8211; the only real link is carefully camouflaged in the post title.)&lt;/p&gt;</description>
      <pubDate>Thu, 18 Jun 2009 14:16:04 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1d1abcbe-c5f1-4024-a18f-721835d44a74</guid>
      <link>http://blog.objectmentor.com/articles/2009/06/18/infinitest-for-java-have-you-tried-it#comment-3590</link>
    </item>
  </channel>
</rss>

