<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Gary Gregory</title>
	<atom:link href="http://garygregory.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://garygregory.wordpress.com</link>
	<description>Java, Eclipse, and other tech tidbits</description>
	<lastBuildDate>Fri, 20 Jan 2012 01:57:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='garygregory.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Gary Gregory</title>
		<link>http://garygregory.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://garygregory.wordpress.com/osd.xml" title="Gary Gregory" />
	<atom:link rel='hub' href='http://garygregory.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Spring Batch in Action is out!</title>
		<link>http://garygregory.wordpress.com/2011/11/08/spring-batch-in-action-is-out/</link>
		<comments>http://garygregory.wordpress.com/2011/11/08/spring-batch-in-action-is-out/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 21:59:32 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=199</guid>
		<description><![CDATA[Here it is, my second book: Spring Batch in Action. Spring Batch in Action is an in-depth guide to writing batch applications using Spring Batch. Written for developers who have basic knowledge of Java and the Spring lightweight container, the book provides both a best-practices approach to writing batch jobs and comprehensive coverage of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=199&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here it is, my second book: Spring Batch in Action.</p>
<div id="attachment_202" class="wp-caption aligncenter" style="width: 160px"><a href="http://garygregory.files.wordpress.com/2011/11/sbia150.jpg"><img class="size-full wp-image-202" title="Spring Batch in Action" src="http://garygregory.files.wordpress.com/2011/11/sbia150.jpg?w=500" alt="Spring Batch in Action"   /></a><p class="wp-caption-text">Spring Batch in Action</p></div>
<p><em>Spring Batch in Action</em> is an in-depth guide to writing batch applications using Spring Batch. Written for developers who have basic knowledge of Java and the Spring lightweight container, the book provides both a best-practices approach to writing batch jobs and comprehensive coverage of the Spring Batch framework.</p>
<p>The book is available directly from <a href="http://www.manning.com/templier/">Manning</a>, and from the usual on-line booksellers <a href="http://www.amazon.com/Spring-Batch-Action-Arnaud-Cogoluegnes/dp/1935182951">Amazon</a>, <a href="http://www.barnesandnoble.com/w/spring-batch-in-action-arnaud-cogoluegnes/1100275342">Barnes &amp; Noble</a>, <a href="https://www.powells.com/biblio/62-9781935182955-0">Powell&#8217;s Books</a> and <a href="http://www.walmart.com/ip/16435568">Walmart</a>!</p>
<p>And in the UK, from <a href="http://www.pearsoned.co.uk/bookshop/detail.asp?item=100000000452182">Pearson</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=199&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/11/08/spring-batch-in-action-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>

		<media:content url="http://garygregory.files.wordpress.com/2011/11/sbia150.jpg" medium="image">
			<media:title type="html">Spring Batch in Action</media:title>
		</media:content>
	</item>
		<item>
		<title>Understaning JUnit method order execution</title>
		<link>http://garygregory.wordpress.com/2011/09/25/understaning-junit-method-order-execution/</link>
		<comments>http://garygregory.wordpress.com/2011/09/25/understaning-junit-method-order-execution/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 16:41:12 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=160</guid>
		<description><![CDATA[With the addition of the ClassRule annotation in JUnit 4.9, I thought I&#8217;d come back and revisit JUnit test order execution. @ClassRule fill a gap in the JUnit API, by providing class level rules like @BeforeClass and @AfterClass provide class wide set up and tear down. This article explains how to control code execution of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=160&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With the addition of the <strong>ClassRule</strong> annotation in JUnit 4.9, I thought I&#8217;d come back and revisit JUnit test order execution.</p>
<p><strong>@ClassRule</strong> fill a gap in the JUnit API, by providing class level rules like <strong>@BeforeClass</strong> and <strong>@AfterClass</strong> provide class wide set up and tear down.</p>
<p>This article explains how to control code execution of unit tests and where <strong>@ClassRule</strong> fits in.</p>
<p>The terminology I use:</p>
<ul>
<li>A test implements <strong>@Test</strong></li>
<li>A test case in a class with <strong>@Test</strong> methods</li>
</ul>
<h1>Ordering test methods</h1>
<p>The simplest test case you can write in JUnit is to annotate methods with<strong> @Test</strong>:</p>
<p><pre class="brush: java; highlight: [7,8,12,13];">
package test;

import org.junit.Test;

public class OrderTest1 {

    @Test
    public void test1() {
        println(&quot;@Test test1()&quot;);
    }

    @Test
    public void test2() {
        println(&quot;@Test test2()&quot;);
    }

    private void println(String string) {
        OrderTestUtils.println(OrderTest1.class, string);
    }
}
</pre></p>
<p>In <strong>OrderTest1</strong>, the execution order is:</p>
<p><pre class="brush: plain;">
OrderTest1 @Test test1()
OrderTest1 @Test test2()
</pre></p>
<h1>Managing test fixtures</h1>
<p>If you need to initialize the same data for each test, you put that data in instance variables and initialize them in a <strong>@Before setUp</strong> method. The <strong>setUp</strong> method is called before each <strong>@Test</strong> method.</p>
<p>One test invocation becomes the following call sequence:</p>
<ol>
<li>Call <strong>@Before setUp</strong></li>
<li>Call one <strong>@Test</strong> method</li>
</ol>
<p>If that data needs to be cleaned up, implement an <strong>@After tearDown</strong> method. The tearDown method is called after each <strong>@Test</strong> method.</p>
<p>One test invocation becomes the following call sequence:</p>
<ol>
<li>Call <strong>@Before setUp</strong></li>
<li>Call one <strong>@Test</strong> method</li>
<li>Call <strong>@After tearDown</strong></li>
</ol>
<p>The call sequence for a class with two test methods is:</p>
<ol>
<li>Call <strong>@Before setUp</strong></li>
<li>Call <strong>@Test</strong> method <strong>test1</strong></li>
<li>Call <strong>@After tearDown</strong></li>
<li>Call <strong>@Before setUp</strong></li>
<li>Call <strong>@Test</strong> method <strong>test2</strong></li>
<li>Call <strong>@After tearDown</strong></li>
</ol>
<p>For example:</p>
<p><pre class="brush: java; highlight: [24,25,30,21];">
package test;

import java.io.Closeable;
import java.io.IOException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class OrderTest2 {

    static class ManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    private ManagedResource managedResource;

    private void println(String string) {
        OrderTestUtils.println(OrderTest2.class, string);
    }

    @Before
    public void setUp() {
        this.println(&quot;@Before setUp&quot;);
        this.managedResource = new ManagedResource();
    }

    @After
    public void tearDown() throws IOException {
        this.println(&quot;@After tearDown&quot;);
        this.managedResource.close();
        this.managedResource = null;
    }

    @Test
    public void test1() {
        this.println(&quot;@Test test1()&quot;);
    }

    @Test
    public void test2() {
        this.println(&quot;@Test test2()&quot;);
    }
}
</pre></p>
<p>In <strong>OrderTest2</strong>, the execution order is:</p>
<p><pre class="brush: plain; highlight: [1,3,4,6];">
OrderTest2 @Before setUp
OrderTest2 @Test test1()
OrderTest2 @After tearDown
OrderTest2 @Before setUp
OrderTest2 @Test test2()
OrderTest2 @After tearDown
</pre></p>
<h1>Managing expensive test fixtures</h1>
<p>When a resource is expensive to manage like a connection to a server, a database, or even managing an embedded server, it&#8217;s best to only initialize that resource once for the whole test case. You want to avoid starting and stopping a server for each <strong>@Test</strong> method. Instead you want to initialize once for all the tests in the class.</p>
<p>To do so, we a <strong>@BeforeClass</strong> and <strong>@AfterClass</strong> methods, instead of <strong>@Before</strong> and <strong>@After</strong> to get the following call sequence:</p>
<ol>
<li>Call <strong>@BeforeClass setUpClass</strong></li>
<li>Call <strong>@Test</strong> method <strong>test1</strong></li>
<li>Call <strong>@Test</strong> method <strong>test2</strong></li>
<li>Call <strong>@AfterClass tearDownClass</strong></li>
</ol>
<p>Let&#8217;s add class-level set up and tear down to our example:</p>
<p><pre class="brush: java; highlight: [26,27,32,33];">
package test;

import java.io.Closeable;
import java.io.IOException;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class OrderTest3 {

    static class ExpensiveManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    static class ManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    @BeforeClass
    public static void setUpClass() {
        OrderTestUtils.println(OrderTest3.class, &quot;@BeforeClass setUpClass&quot;);
        MyExpensiveManagedResource = new ExpensiveManagedResource();
    }

    @AfterClass
    public static void tearDownClass() throws IOException {
        OrderTestUtils.println(OrderTest3.class, &quot;@AfterClass tearDownClass&quot;);
        MyExpensiveManagedResource.close();
        MyExpensiveManagedResource = null;
    }

    private ManagedResource myManagedResource;
    private static ExpensiveManagedResource MyExpensiveManagedResource;

    private void println(String string) {
        OrderTestUtils.println(OrderTest3.class, string);
    }

    @Before
    public void setUp() {
        this.println(&quot;@Before setUp&quot;);
        this.myManagedResource = new ManagedResource();
    }

    @After
    public void tearDown() throws IOException {
        this.println(&quot;@After setUp&quot;);
        this.myManagedResource.close();
        this.myManagedResource = null;
    }

    @Test
    public void test1() {
        this.println(&quot;@Test test1()&quot;);
    }

    @Test
    public void test2() {
        this.println(&quot;@Test test2()&quot;);
    }
}
</pre></p>
<p>In <strong>OrderTest3</strong>, the execution order is:</p>
<p><pre class="brush: plain; highlight: [1,8];">
OrderTestAll @BeforeClass setUpClass
OrderTestAll @Before setUp
OrderTestAll @Test test1()
OrderTestAll @After setUp
OrderTestAll @Before setUp
OrderTestAll @Test test2()
OrderTestAll @After setUp
OrderTestAll @AfterClass tearDownClass
</pre></p>
<p>You can see that the <strong>setUpClass</strong> and <strong>tearDownClass</strong> wrap the execution of this test case.</p>
<h1>Managing resources with rules</h1>
<p>Instead of duplicating resource management code in each class, you can reuse your code, but instead of putting this common in a superclass for all your tests. you can abstract external resource management with a JUnit <strong>Rule</strong>.</p>
<p>JUnit  rules are subclasses of the <strong>ExternalResource</strong> class.</p>
<p>Let&#8217;s do it both ways and compare.</p>
<p><pre class="brush: java; highlight: [58,59];">
package test;

import java.io.Closeable;
import java.io.IOException;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExternalResource;

public class OrderTest4 {

    static class ExpensiveExternalResource extends ExternalResource {

        ExpensiveExternalResource() {
            OrderTestUtils.println(ExpensiveExternalResource.class, &quot;constructor&quot;);
        }

        @Override
        protected void after() {
            OrderTestUtils.println(ExpensiveExternalResource.class, &quot;after&quot;);
        };

        @Override
        protected void before() throws Throwable {
            OrderTestUtils.println(ExpensiveExternalResource.class, &quot;before&quot;);
        };
    };

    static class ExpensiveManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    static class ManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    @BeforeClass
    public static void setUpClass() {
        OrderTestUtils.println(OrderTest4.class, &quot;@BeforeClass setUpClass&quot;);
        MyExpensiveManagedResource = new ExpensiveManagedResource();
    }

    @AfterClass
    public static void tearDownClass() throws IOException {
        OrderTestUtils.println(OrderTest4.class, &quot;@AfterClass tearDownClass&quot;);
        MyExpensiveManagedResource.close();
        MyExpensiveManagedResource = null;
    }

    @Rule
    public ExternalResource resource = new ExpensiveExternalResource();

    private ManagedResource myManagedResource;

    private static ExpensiveManagedResource MyExpensiveManagedResource;

    private void println(String string) {
        OrderTestUtils.println(OrderTest4.class, string);
    }

    @Before
    public void setUp() {
        this.println(&quot;@Before setUp&quot;);
        this.myManagedResource = new ManagedResource();
    }

    @After
    public void tearDown() throws IOException {
        this.println(&quot;@After tearDown()&quot;);
        this.myManagedResource.close();
        this.myManagedResource = null;
    }

    @Test
    public void test1() {
        this.println(&quot;@Test test1()&quot;);
    }

    @Test
    public void test2() {
        this.println(&quot;@Test test2()&quot;);
    }
}
</pre></p>
<p>The method are run in the following order:</p>
<p><pre class="brush: plain; highlight: [2,3,7,8,9,13];">
OrderTest4 @BeforeClass setUpClass
ExpensiveExternalResource constructor
ExpensiveExternalResource before
OrderTest4 @Before setUp
OrderTest4 @Test test1()
OrderTest4 @After setUp
ExpensiveExternalResource after
ExpensiveExternalResource constructor
ExpensiveExternalResource before
OrderTest4 @Before setUp
OrderTest4 @Test test2()
OrderTest4 @After setUp
ExpensiveExternalResource after
OrderTest4 @AfterClass tearDownClass
</pre></p>
<p>The <strong>ExternalResource</strong> <strong>before</strong> method is called just before the <strong>@Before setUp</strong> method.</p>
<p>The <strong>ExternalResource</strong> <strong>after</strong> method is called just before the <strong>@After setUp</strong> method.</p>
<p>An <strong>ExternalResource</strong> is a nice way to abstract out and resuse your resource management code. You can now compose use of your resources instead of  subclassing.</p>
<h1>Managing expensive resources with rules</h1>
<p>Just like you can wrap a test case with <strong>@BeforeClass</strong> and <strong>@AfterClass</strong>, there was no way to do this with rules until JUnit 4.9 and the <strong>ClassRule</strong> annotation.</p>
<p>The following examples shows a <strong>ClassRule</strong> at work. Deltas from the previous example are highlighted.</p>
<p><pre class="brush: java; highlight: [65,66];">
package test;

import java.io.Closeable;
import java.io.IOException;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExternalResource;

public class OrderTest5 {

    static class ExpensiveExternalResource extends ExternalResource {

        private final String info;

        ExpensiveExternalResource(String info) {
            this.info = info;
            OrderTestUtils.println(ExpensiveExternalResource.class, &quot;constructor &quot; + info);
        }

        @Override
        protected void after() {
            OrderTestUtils.println(ExpensiveExternalResource.class, &quot;after &quot; + this.info);
        };

        @Override
        protected void before() throws Throwable {
            OrderTestUtils.println(ExpensiveExternalResource.class, &quot;before &quot; + this.info);
        };
    };

    static class ExpensiveManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    static class ManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    @BeforeClass
    public static void setUpClass() {
        OrderTestUtils.println(OrderTest5.class, &quot;@BeforeClass setUpClass&quot;);
        MyExpensiveManagedResource = new ExpensiveManagedResource();
    }

    @AfterClass
    public static void tearDownClass() throws IOException {
        OrderTestUtils.println(OrderTest5.class, &quot;@AfterClass tearDownClass&quot;);
        MyExpensiveManagedResource.close();
        MyExpensiveManagedResource = null;
    }

    @Rule
    public ExternalResource resource = new ExpensiveExternalResource(&quot;instance&quot;);

    @ClassRule
    public static ExternalResource StaticResource = new ExpensiveExternalResource(&quot;static&quot;);

    private ManagedResource myManagedResource;

    private static ExpensiveManagedResource MyExpensiveManagedResource;

    private void println(String string) {
        OrderTestUtils.println(OrderTest5.class, string);
    }

    @Before
    public void setUp() {
        this.println(&quot;@Before setUp&quot;);
        this.myManagedResource = new ManagedResource();
    }

    @After
    public void tearDown() throws IOException {
        this.println(&quot;@After tearDown()&quot;);
        this.myManagedResource.close();
        this.myManagedResource = null;
    }

    @Test
    public void test1() {
        this.println(&quot;@Test test1()&quot;);
    }

    @Test
    public void test2() {
        this.println(&quot;@Test test2()&quot;);
    }
}
</pre></p>
<p>The test run shows the <strong>ClassRule</strong> kick in at the start and end of the test case:</p>
<p><pre class="brush: plain; highlight: [1,2,17];">
ExpensiveExternalResource constructor static
ExpensiveExternalResource before static
OrderTest5 @BeforeClass setUpClass
ExpensiveExternalResource constructor instance
ExpensiveExternalResource before instance
OrderTest5 @Before setUp
OrderTest5 @Test test1()
OrderTest5 @After tearDown()
ExpensiveExternalResource after instance
ExpensiveExternalResource constructor instance
ExpensiveExternalResource before instance
OrderTest5 @Before setUp
OrderTest5 @Test test2()
OrderTest5 @After tearDown()
ExpensiveExternalResource after instance
OrderTest5 @AfterClass tearDownClass
ExpensiveExternalResource after static
</pre></p>
<h1>Subclassing test cases</h1>
<p>What happens when you subclass a test case? For example:</p>
<p><pre class="brush: java;">
package test;

import org.junit.Test;

public class SubOrderTest1 extends OrderTest1 {

    private void println(String string) {
        OrderTestUtils.println(SubOrderTest1.class, string);
    }

    @Test
    public void testSub1() {
        this.println(&quot;@Test testSub1()&quot;);
    }

    @Test
    public void testSub2() {
        this.println(&quot;@Test testSub1()&quot;);
    }
}
</pre></p>
<p>JUnit runs the given test case and then the super class test case:</p>
<p><pre class="brush: plain;">
SubOrderTest1 @Test testSub1()
SubOrderTest1 @Test testSub1()
OrderTest1 @Test test1()
OrderTest1 @Test test2()
</pre></p>
<p>If you add a third level with a <strong>SubSubOrderTest1</strong> class extending <strong>SubOrderTest1</strong>, you get:</p>
<p><pre class="brush: plain;">
SubSubOrderTest1 @Test testSubSub1()
SubSubOrderTest1 @Test testSubSub1()
SubOrderTest1 @Test testSub1()
SubOrderTest1 @Test testSub1()
OrderTest1 @Test test1()
OrderTest1 @Test test2()
</pre></p>
<p>Method execution order starts with the given test case and goes up the super class chain until you get to the top of the hierarchy.</p>
<h1>Subclassing test cases with managed resources</h1>
<p>Here, things get trickier.</p>
<p>The order of <strong>@Before</strong> methods goes from the top to the bottom of the hierarchy: parent, child, child of child.</p>
<p>The order of <strong>@After</strong> methods goes from the bottom to the top of the hierarchy: child of child, child, parent.</p>
<p>For example:</p>
<p><pre class="brush: java;">
package test;

import java.io.Closeable;
import java.io.IOException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class SubOrderTest2 extends OrderTest2 {

    static class ManagedResource implements Closeable {
        @Override
        public void close() throws IOException {
        }
    }

    private ManagedResource managedResource;

    private void println(String string) {
        OrderTestUtils.println(SubOrderTest2.class, string);
    }

    @Before
    public void setUpSub() {
        this.println(&quot;@Before setUpSub&quot;);
        this.managedResource = new ManagedResource();
    }

    @After
    public void tearDownSub() throws IOException {
        this.println(&quot;@After tearDownSub&quot;);
        this.managedResource.close();
        this.managedResource = null;
    }

    @Test
    public void testSub1() {
        this.println(&quot;@Test testSub1()&quot;);
    }

    @Test
    public void testSub2() {
        this.println(&quot;@Test testSub2()&quot;);
    }
}
</pre></p>
<p>Here, JUnit runs the given test case and then the super class test case:</p>
<p><pre class="brush: plain;">
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubOrderTest2 @Test testSub1()
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubOrderTest2 @Test testSub2()
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
OrderTest2 @Test test1()
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
OrderTest2 @Test test2()
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
</pre></p>
<p>If add a third level with a <strong>SubSubOrderTest2</strong> class extending <strong>SubOrderTest2</strong>, you get:</p>
<p><pre class="brush: plain;">
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubSubOrderTest2 @Before setUpSubSub
SubSubOrderTest2 @Test testSubSub1()
SubSubOrderTest2 @After tearDownSubSub
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubSubOrderTest2 @Before setUpSubSub
SubSubOrderTest2 @Test testSubSub2()
SubSubOrderTest2 @After tearDownSubSub
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubSubOrderTest2 @Before setUpSubSub
SubOrderTest2 @Test testSub1()
SubSubOrderTest2 @After tearDownSubSub
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubSubOrderTest2 @Before setUpSubSub
SubOrderTest2 @Test testSub2()
SubSubOrderTest2 @After tearDownSubSub
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubSubOrderTest2 @Before setUpSubSub
OrderTest2 @Test test1()
SubSubOrderTest2 @After tearDownSubSub
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
OrderTest2 @Before setUp
SubOrderTest2 @Before setUpSub
SubSubOrderTest2 @Before setUpSubSub
OrderTest2 @Test test2()
SubSubOrderTest2 @After tearDownSubSub
SubOrderTest2 @After tearDownSub
OrderTest2 @After tearDown
</pre></p>
<p>I hope you found this post helpful. I was a nice reminder for me to lay it out and remember the power of JUnit rules. With the new <strong>ClassRule</strong> in JUnit 4.9, rules can finally be used at full strength.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=160&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/09/25/understaning-junit-method-order-execution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
		<item>
		<title>JUnit 4.9 to the rescue with @ClassRule</title>
		<link>http://garygregory.wordpress.com/2011/09/21/junit-4-9-to-the-rescue-with-classrule/</link>
		<comments>http://garygregory.wordpress.com/2011/09/21/junit-4-9-to-the-rescue-with-classrule/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 01:53:25 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=130</guid>
		<description><![CDATA[In a previous article titled &#8220;JUnit @Rule not initialized before @BeforeClass&#8220;, I bemoaned the fact that an @Rule could not be set up to run before an @BeforeClass. It appears my wish has been answered with the release of JUnit 4.9 and the new @ClassRule annotation. The only change required to make our example work [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=130&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a previous article titled &#8220;<a href="https://garygregory.wordpress.com/2010/03/21/junit-rule-not-initialized-before-beforeclass/">JUnit @Rule not initialized before @BeforeClass</a>&#8220;, I bemoaned the fact that an @Rule could not be set up to run before an @BeforeClass.</p>
<p>It appears my <a href="http://tech.groups.yahoo.com/group/junit/message/22516">wish</a> has been answered with the release of JUnit 4.9 and the new @ClassRule annotation.</p>
<p>The only change required to make our example work is to replace @Rule with @ClassRule:</p>
<p><pre class="brush: java; highlight: [14,15];">
package test;

import java.io.File;
import java.io.IOException;

import junit.framework.Assert;

import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

public class TemporaryFolderRuleBeforeClass {
    @ClassRule
    public static TemporaryFolder testFolder = new TemporaryFolder();

    @BeforeClass
    public static void testInTempFolder() throws IOException {
        File tempFile = testFolder.newFile(&quot;file.txt&quot;);
        File tempFolder = testFolder.newFolder(&quot;folder&quot;);
        System.out.println(&quot;Test folder: &quot; + testFolder.getRoot());
        // test
        Assert.assertNotNull(testFolder.getRoot());
    }

    @Test
    public void test() {
        // ...
    }
}
</pre></p>
<p>Voila! It just works, the @ClassRule is set up correctly before the @BeforeClass method is called. Thank you JUnit 4.9!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=130&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/09/21/junit-4-9-to-the-rescue-with-classrule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
		<item>
		<title>Java multi-threaded unit testing</title>
		<link>http://garygregory.wordpress.com/2011/09/09/multi-threaded-unit-testing/</link>
		<comments>http://garygregory.wordpress.com/2011/09/09/multi-threaded-unit-testing/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 16:06:35 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=104</guid>
		<description><![CDATA[With Java 5 and JUnit 4, writing multi-threaded unit tests has never been easier. Let&#8217;s take a brain dead ID generator as our domain object example: This is how you test this class with different threads loads of 1, 2, 4, 8, 16, and 32 threads. We use the Java java.util.concurrent API to manage threads [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=104&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With Java 5 and JUnit 4, writing multi-threaded unit tests has never been easier.</p>
<p>Let&#8217;s take a brain dead ID generator as our domain object example:</p>
<p><pre class="brush: java;">
    /**
     * Generates sequential unique IDs starting with 1, 2, 3, and so on.
     * &lt;p&gt;
     * This class is NOT thread-safe.
     * &lt;/p&gt;
     */
    static class BrokenUniqueIdGenerator {
        private long counter = 0;

        public long nextId() {
            return ++counter;
        }
    }
</pre></p>
<p>This is how you test this class with different threads loads of 1, 2, 4, 8, 16, and 32 threads. We use the Java java.util.concurrent API to manage threads to use our domain object concurrently. We use JUnit @Test methods to run the test and verify results.</p>
<p><pre class="brush: java;">
    @Test
    public void test01() throws InterruptedException, ExecutionException {
        test(1);
    }

    @Test
    public void test02() throws InterruptedException, ExecutionException {
        test(2);
    }

    @Test
    public void test04() throws InterruptedException, ExecutionException {
        test(4);
    }

    @Test
    public void test08() throws InterruptedException, ExecutionException {
        test(8);
    }

    @Test
    public void test16() throws InterruptedException, ExecutionException {
        test(16);
    }

    @Test
    public void test32() throws InterruptedException, ExecutionException {
        test(32);
    }

    private void test(final int threadCount) throws InterruptedException, ExecutionException {
        final BrokenUniqueIdGenerator domainObject = new BrokenUniqueIdGenerator();
        Callable&lt;Long&gt; task = new Callable&lt;Long&gt;() {
            @Override
            public Long call() {
                return domainObject.nextId();
            }
        };
        List&lt;Callable&lt;Long&gt;&gt; tasks = Collections.nCopies(threadCount, task);
        ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
        List&lt;Future&lt;Long&gt;&gt; futures = executorService.invokeAll(tasks);
        List&lt;Long&gt; resultList = new ArrayList&lt;Long&gt;(futures.size());
        // Check for exceptions
        for (Future&lt;Long&gt; future : futures) {
            // Throws an exception if an exception was thrown by the task.
            resultList.add(future.get());
        }
        // Validate the IDs
        Assert.assertEquals(futures.size(), threadCount);
        List&lt;Long&gt; expectedList = new ArrayList&lt;Long&gt;(threadCount);
        for (long i = 1; i &lt;= threadCount; i++) {
            expectedList.add(i);
        }
        Collections.sort(resultList);
        Assert.assertEquals(expectedList, resultList);
    }
</pre></p>
<p>Let&#8217;s walk through the test(int threadCount) method. We start by creating our domain object:</p>
<p><pre class="brush: java; light: true;">
final BrokenUniqueIdGenerator domainObject = new BrokenUniqueIdGenerator();
</pre></p>
<p>This class has one method, nextId, which we wrap into a task, an instance of Callable:</p>
<p><pre class="brush: java;">
        Callable&lt;Long&gt; task = new Callable&lt;Long&gt;() {
            @Override
            public Long call() {
                return domainObject.nextId();
            }
        };
</pre></p>
<p>This is just a generic way to fit our API call in the Java concurrency API.</p>
<p>We then make copies of this task, one for each thread:</p>
<p><pre class="brush: java; light: true;">
List&lt;Callable&lt;Long&gt;&gt; tasks = Collections.nCopies(threadCount, task);
</pre></p>
<p>Next, we create a thread pool, sized at least as big as the number of threads we want to test, in this case we use the exact given value threadCount.</p>
<p><pre class="brush: java; light: true;">
ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
</pre></p>
<p>And ask Java to run all the tasks concurrently using threads from the pool:</p>
<p><pre class="brush: java; light: true;">
List&lt;Future&lt;Long&gt;&gt; futures = executorService.invokeAll(tasks);
</pre></p>
<p>The call to invokeAll blocks until all the threads are done. Each task is run on a thread, which invokes the tasks&#8217; call method, which in turn calls our domain object API, nextId().</p>
<p>When you run this test case, it will sometimes pass and sometimes fail.</p>
<p>That&#8217;s multithreaded testing with Java 5 and JUnit 4. Voila!</p>
<p>BTW, the proper implementation is:</p>
<p><pre class="brush: java;">
    /**
     * Generates sequential unique IDs starting with 1, 2, 3, and so on.
     * &lt;p&gt;
     * This class is thread-safe.
     * &lt;/p&gt;
     */
    static class UniqueIdGenerator {
        private final AtomicLong counter = new AtomicLong();

        public long nextId() {
            return counter.incrementAndGet();
        }
    }
</pre></p>
<p>The full listing is:</p>
<p><pre class="brush: java;">
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicLong;

import org.junit.Assert;
import org.junit.Test;

public class MultiThreadedTestCase {

    /**
     * Generates sequential unique IDs starting with 1, 2, 3, and so on.
     * &lt;p&gt;
     * This class is NOT thread-safe.
     * &lt;/p&gt;
     */
    static class BrokenUniqueIdGenerator {
        private long counter = 0;

        public long nextId() {
            return ++counter;
        }
    }

    /**
     * Generates sequential unique IDs starting with 1, 2, 3, and so on.
     * &lt;p&gt;
     * This class is thread-safe.
     * &lt;/p&gt;
     */
    static class UniqueIdGenerator {
        private final AtomicLong counter = new AtomicLong();

        public long nextId() {
            return counter.incrementAndGet();
        }
    }

    private void test(final int threadCount) throws InterruptedException, ExecutionException {
        final UniqueIdGenerator domainObject = new UniqueIdGenerator();
        Callable&lt;Long&gt; task = new Callable&lt;Long&gt;() {
            @Override
            public Long call() {
                return domainObject.nextId();
            }
        };
        List&lt;Callable&lt;Long&gt;&gt; tasks = Collections.nCopies(threadCount, task);
        ExecutorService executorService = Executors.newFixedThreadPool(threadCount);
        List&lt;Future&lt;Long&gt;&gt; futures = executorService.invokeAll(tasks);
        List&lt;Long&gt; resultList = new ArrayList&lt;Long&gt;(futures.size());
        // Check for exceptions
        for (Future&lt;Long&gt; future : futures) {
            // Throws an exception if an exception was thrown by the task.
            resultList.add(future.get());
        }
        // Validate the IDs
        Assert.assertEquals(futures.size(), threadCount);
        List&lt;Long&gt; expectedList = new ArrayList&lt;Long&gt;(threadCount);
        for (long i = 1; i &lt;= threadCount; i++) {
            expectedList.add(i);
        }
        Collections.sort(resultList);
        Assert.assertEquals(expectedList, resultList);
    }

    @Test
    public void test01() throws InterruptedException, ExecutionException {
        test(1);
    }

    @Test
    public void test02() throws InterruptedException, ExecutionException {
        test(2);
    }

    @Test
    public void test04() throws InterruptedException, ExecutionException {
        test(4);
    }

    @Test
    public void test08() throws InterruptedException, ExecutionException {
        test(8);
    }

    @Test
    public void test16() throws InterruptedException, ExecutionException {
        test(16);
    }

    @Test
    public void test32() throws InterruptedException, ExecutionException {
        test(32);
    }
}
</pre></p>
<p>Note: I used Oracle Java 1.6.0_24 (64-bit) on Windows 7 (64-bit).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=104&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/09/09/multi-threaded-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
		<item>
		<title>Firefox 4 on Windows 7 Installation Madness</title>
		<link>http://garygregory.wordpress.com/2011/03/25/firefox-4-on-windows-7-installation-madness/</link>
		<comments>http://garygregory.wordpress.com/2011/03/25/firefox-4-on-windows-7-installation-madness/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 19:50:34 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=94</guid>
		<description><![CDATA[After pulling my hair out trying to install Firefox 4 on Windows 7, I found a solution to the installer disappearing after extracting files. Right-click on the installer and choose Run as administrator. This is not the same, apparently, as selecting the administrator account in the pop up dialog or choosing your account if it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=94&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After pulling my hair out trying to install Firefox 4 on Windows 7, I found a solution to the installer disappearing after extracting files. Right-click on the installer and choose <em>Run as administrator</em>. This is not the same, apparently, as selecting the administrator account in the pop up dialog or choosing your account if it happens to be an administrator account, which mine is. Nope, <em>Run as administrator</em> it must be.<em><br />
</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=94&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/03/25/firefox-4-on-windows-7-installation-madness/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
		<item>
		<title>Conditionally ignoring tests in JUnit</title>
		<link>http://garygregory.wordpress.com/2011/03/12/conditionally-ignoring-tests-in-junit/</link>
		<comments>http://garygregory.wordpress.com/2011/03/12/conditionally-ignoring-tests-in-junit/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 03:09:26 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=89</guid>
		<description><![CDATA[JUnit conveniently lets you annotate a test method with @Ignore. This causes JUnit to completely ignore the method. What if you want to only ignore the test under a condition determined at runtime? This would be nice: But Java and JUnit do not work like that. Instead, you need to use the Assume class. Voila!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=89&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>JUnit conveniently lets you annotate a test method with <span style="color:#003300;">@Ignore</span>.<br />
<pre class="brush: java;">
@Test
@Ignore
public void testAdd() {
   ...
}
</pre><br />
This causes JUnit to completely ignore the method.</p>
<p>What if you want to only ignore the test under a condition determined at runtime? This would be nice:<br />
<pre class="brush: java;">
@Test
@Ignore(someCondition())
public void testAdd() {
   ...
}
</pre><br />
But Java and JUnit do not work like that. Instead, you need to use the <span style="color:#003300;">Assume </span>class.<br />
<pre class="brush: java;">
@Test
public void testAdd() {
   Assume.assumeTrue(someCondition());
   ...
}
</pre><br />
Voila!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=89&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/03/12/conditionally-ignoring-tests-in-junit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
		<item>
		<title>Trunk vs. HEAD in Version Control Systems</title>
		<link>http://garygregory.wordpress.com/2011/02/03/trunk-vs-head-in-version-control-systems/</link>
		<comments>http://garygregory.wordpress.com/2011/02/03/trunk-vs-head-in-version-control-systems/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 16:41:13 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[CVS]]></category>
		<category><![CDATA[Subversion (SVN)]]></category>
		<category><![CDATA[Version Control System (VCS)]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=85</guid>
		<description><![CDATA[This aim of this note is to provide the shortest and simplest explanation of the concepts of trunk and HEAD in a Version Control System like CVS and Subversion (SVN.) Like in botany, trunk is a tree&#8217;s central superstructure. All branches come out of the trunk: Main development is performed in the trunk. Releases are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=85&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This aim of this note is to provide the shortest and simplest explanation of the concepts <em>of trunk</em> and <em>HEAD</em> in a Version Control System like CVS and Subversion (SVN.)</p>
<p>Like in botany, trunk is a tree&#8217;s central superstructure. All branches come out of the trunk:</p>
<div id="attachment_97" class="wp-caption aligncenter" style="width: 510px"><a href="//www.javaworld.com/javaworld/jw-01-2008/images/svn1.jpg"><img class="size-full wp-image-97  " title="Trunk and branches from http://www.javaworld.com/javaworld/jw-01-2008/images/svn1.jpg" src="http://garygregory.files.wordpress.com/2011/02/trunk-and-branches.jpg?w=500&#038;h=169" alt="Trunk and branches from http://www.javaworld.com/javaworld/jw-01-2008/images/svn1.jpg" width="500" height="169" /></a><p class="wp-caption-text">Trunk and branches from http://www.javaworld.com/javaworld/jw-01-2008/images/svn1.jpg</p></div>
<p>Main development is performed in the trunk. Releases are branched for bug fixes and maintenance releases.</p>
<p>In the next diagram, the tip of the arrows for trunk and a branches are HEADs. Each branch and trunk have a HEAD.</p>
<div class="wp-caption aligncenter" style="width: 331px"><img title="Heads on trunk and branches from http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.using" src="http://garygregory.files.wordpress.com/2011/02/heads.png?w=321&#038;h=135" alt="Heads on trunk and branches from http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.using" width="321" height="135" /><p class="wp-caption-text">Heads on trunk and branches from http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.using</p></div>
<p style="text-align:center;">
<p>That&#8217;s it!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=85&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/02/03/trunk-vs-head-in-version-control-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>

		<media:content url="http://garygregory.files.wordpress.com/2011/02/trunk-and-branches.jpg" medium="image">
			<media:title type="html">Trunk and branches from http://www.javaworld.com/javaworld/jw-01-2008/images/svn1.jpg</media:title>
		</media:content>

		<media:content url="http://garygregory.files.wordpress.com/2011/02/heads.png" medium="image">
			<media:title type="html">Heads on trunk and branches from http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.branchmerge.using</media:title>
		</media:content>
	</item>
		<item>
		<title>What are Java&#8217;s min and max values?</title>
		<link>http://garygregory.wordpress.com/2011/02/02/what-are-javas-min-and-max-values/</link>
		<comments>http://garygregory.wordpress.com/2011/02/02/what-are-javas-min-and-max-values/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 03:50:25 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=81</guid>
		<description><![CDATA[Why is this not Javadoc&#8217;d clearly?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=81&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Why is this not Javadoc&#8217;d clearly?<br />
<pre class="brush: java;">
Integer.MAX_VALUE =  2147483647
Integer.MIN_VALUE = -2147483648

Long.MAX_VALUE =  9223372036854775807
Long.MIN_VALUE = -9223372036854775808
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=81&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2011/02/02/what-are-javas-min-and-max-values/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
		<item>
		<title>A simple IIS 7 test set up should be simple</title>
		<link>http://garygregory.wordpress.com/2010/05/03/a-simple-iis-7-test-set-up-should-be-simple/</link>
		<comments>http://garygregory.wordpress.com/2010/05/03/a-simple-iis-7-test-set-up-should-be-simple/#comments</comments>
		<pubDate>Mon, 03 May 2010 22:02:13 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=76</guid>
		<description><![CDATA[For simple tests, I want to publish a local directory &#8220;dir&#8221; through IIS 7 as a virtual directory &#8220;vdir&#8221; and point my browser to http://localhost/vdir/myfile.xml. Does that work? No. You need to: Grant permission for the directory to the IIS group IIS_IUSRS. In the IIS Manager, in Authentication/Anonymous Authentication, change the setting to &#8220;Application pool [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=76&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For simple tests, I want to publish a local directory &#8220;dir&#8221; through IIS 7 as a virtual directory &#8220;vdir&#8221; and point my browser to http://localhost/vdir/myfile.xml.</p>
<p>Does that work?</p>
<p>No.</p>
<p>You need to:</p>
<ul>
<li> Grant permission for the directory to the IIS group IIS_IUSRS.</li>
<li>In the IIS Manager, in Authentication/Anonymous Authentication, change the setting to &#8220;Application pool identity&#8221;</li>
</ul>
<p>Then you can get IIS to serve you files locally.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=76&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2010/05/03/a-simple-iis-7-test-set-up-should-be-simple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing CXF java.lang.IllegalStateException: Unable to create JAXBContext for generated packages</title>
		<link>http://garygregory.wordpress.com/2010/03/25/fixing-cxf-java-lang-illegalstateexception-unable-to-create-jaxbcontext-for-generated-packages/</link>
		<comments>http://garygregory.wordpress.com/2010/03/25/fixing-cxf-java-lang-illegalstateexception-unable-to-create-jaxbcontext-for-generated-packages/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 19:49:02 +0000</pubDate>
		<dc:creator>Gary Gregory</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://garygregory.wordpress.com/?p=65</guid>
		<description><![CDATA[Our CXF client-server tests passed in Eclispe (3.6M6) but failed when invoked from the command line with Ant 1.7.1. This stack trace is a typical example: We use CXF 2.2.7 and JAXB 2.2 but this also applies for older versions of CXF and JAXB. The solution is to add the JDK bin directory to your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=65&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Our CXF client-server tests passed in Eclispe (3.6M6) but failed when invoked from the command line with Ant 1.7.1. This stack trace is a typical example:</p>
<p><pre class="brush: plain; highlight: [1,6]; wrap-lines: false;">
java.lang.IllegalStateException: Unable to create JAXBContext for generated packages: &amp;quot;appinterface.seagullsw.com.appinterfaceserver&amp;quot; doesnt contain ObjectFactory.class or jaxb.index
  at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:343)
  at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:196)
  at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:175)
  at com.seagullsw.appinterface.server.comm.soap.SoapCmCxfTests.testWssAll(SoapCmCxfTests.java:354)
Caused by: javax.xml.bind.JAXBException: &amp;quot;appinterface.seagullsw.com.appinterfaceserver&amp;quot; doesnt contain ObjectFactory.class or jaxb.index
  at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:197)
  at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:128)
  at javax.xml.bind.ContextFinder.find(ContextFinder.java:277)
  at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
  at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:340)
</pre></p>
<p>We use CXF 2.2.7 and JAXB 2.2 but this also applies for older versions of CXF and JAXB.</p>
<p>The solution is to add the JDK bin directory to your execution path (PATH on Windows), something like:</p>
<p><pre class="brush: bash; light: true;">
set PATH=%PATH%;%JAVA_HOME%\bin
</pre></p>
<p>where JAVA_HOME points to your JDK root directory.</p>
<p>Now all tests pass from Eclipse and Ant.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/garygregory.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/garygregory.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/garygregory.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/garygregory.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/garygregory.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/garygregory.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/garygregory.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/garygregory.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/garygregory.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/garygregory.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/garygregory.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/garygregory.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/garygregory.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/garygregory.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=garygregory.wordpress.com&amp;blog=5116194&amp;post=65&amp;subd=garygregory&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://garygregory.wordpress.com/2010/03/25/fixing-cxf-java-lang-illegalstateexception-unable-to-create-jaxbcontext-for-generated-packages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3592871bbdb2602a71326e287b7e687b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">garygregory</media:title>
		</media:content>
	</item>
	</channel>
</rss>
