<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Watij and running JUnit test methods in the order that you want</title>
	<atom:link href="http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/feed/" rel="self" type="application/rss+xml" />
	<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/</link>
	<description>Peter Thomas</description>
	<lastBuildDate>Thu, 05 Nov 2009 03:10:42 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 6as0fb</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-13632</link>
		<dc:creator>6as0fb</dc:creator>
		<pubDate>Sun, 17 May 2009 06:26:00 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-13632</guid>
		<description>asdsadadsa</description>
		<content:encoded><![CDATA[<p>asdsadadsa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Click</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-12678</link>
		<dc:creator>Click</dc:creator>
		<pubDate>Tue, 15 Apr 2008 22:30:19 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-12678</guid>
		<description>Selenium RC IS much better. Good move.</description>
		<content:encoded><![CDATA[<p>Selenium RC IS much better. Good move.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: naisioxerloro</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-11909</link>
		<dc:creator>naisioxerloro</dc:creator>
		<pubDate>Wed, 28 Nov 2007 21:15:16 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-11909</guid>
		<description>Hi. 
Good design, who make it?</description>
		<content:encoded><![CDATA[<p>Hi.<br />
Good design, who make it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Thomas</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-8993</link>
		<dc:creator>Peter Thomas</dc:creator>
		<pubDate>Tue, 24 Jul 2007 14:31:11 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-8993</guid>
		<description>Yep, I recently switched to Selenium RC and it is much better than Watij.  Maybe a detailed blog post on that later.</description>
		<content:encoded><![CDATA[<p>Yep, I recently switched to Selenium RC and it is much better than Watij.  Maybe a detailed blog post on that later.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ivan</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-8991</link>
		<dc:creator>ivan</dc:creator>
		<pubDate>Tue, 24 Jul 2007 10:13:39 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-8991</guid>
		<description>I would actually prefer to use Selenium RC for the https protocol which can be used via junit as I find its extremely easy to implement compared to watij -- anyways thats my side of the coin :)</description>
		<content:encoded><![CDATA[<p>I would actually prefer to use Selenium RC for the https protocol which can be used via junit as I find its extremely easy to implement compared to watij &#8212; anyways thats my side of the coin :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SS</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-405</link>
		<dc:creator>SS</dc:creator>
		<pubDate>Tue, 29 Aug 2006 19:03:47 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-405</guid>
		<description>My bad -- pls. ignore all the private method stuff. I shouldve read your post more carefully BEFORE replying (duh!) :&#124;</description>
		<content:encoded><![CDATA[<p>My bad &#8212; pls. ignore all the private method stuff. I shouldve read your post more carefully BEFORE replying (duh!) :|</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SS</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-404</link>
		<dc:creator>SS</dc:creator>
		<pubDate>Tue, 29 Aug 2006 18:33:17 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-404</guid>
		<description>We have run into the problem Jim indicated above. Development was on Windows boxes and the CI environment was on AIX. The AIX JDK returned the methods in exactly the reverse order to that by the Sun JDK on Windows! Bottom-line - believe the Javadoc -- dont depend on the reflected order :)

Similarly, if the Suite.addTest contract doesnt indicate that they will be run in order -- even though the current implementation might be running it in-order, the implementors are free to change that if they want to.

Also, if all you always want to do is run all the tests every time - have 1 public test method and call your individual private test methods in the order you want. 
Yes - the order goes into the code and you have to recompile to change - but if you are always running the full suite - what difference!

(BTW, as unit-test-purists will point out - you are running integration tests here not unit-tests per se and hence your test-dependencies. In short (ok its too late for that :) ) -- dont blame the framework since it was not meant for those ends! )</description>
		<content:encoded><![CDATA[<p>We have run into the problem Jim indicated above. Development was on Windows boxes and the CI environment was on AIX. The AIX JDK returned the methods in exactly the reverse order to that by the Sun JDK on Windows! Bottom-line &#8211; believe the Javadoc &#8212; dont depend on the reflected order :)</p>
<p>Similarly, if the Suite.addTest contract doesnt indicate that they will be run in order &#8212; even though the current implementation might be running it in-order, the implementors are free to change that if they want to.</p>
<p>Also, if all you always want to do is run all the tests every time &#8211; have 1 public test method and call your individual private test methods in the order you want.<br />
Yes &#8211; the order goes into the code and you have to recompile to change &#8211; but if you are always running the full suite &#8211; what difference!</p>
<p>(BTW, as unit-test-purists will point out &#8211; you are running integration tests here not unit-tests per se and hence your test-dependencies. In short (ok its too late for that :) ) &#8212; dont blame the framework since it was not meant for those ends! )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake Dempsey</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-401</link>
		<dc:creator>Jake Dempsey</dc:creator>
		<pubDate>Fri, 25 Aug 2006 14:50:44 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-401</guid>
		<description>Peter,

Glad to hear you have decided to use Watij. Let us know if you have any quesions.  If you haven&#039;t already, make sure to sign up on the Google Group at http://groups.google.com/group/watij.  Let us know if you have any questions.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Glad to hear you have decided to use Watij. Let us know if you have any quesions.  If you haven&#8217;t already, make sure to sign up on the Google Group at <a href="http://groups.google.com/group/watij" rel="nofollow">http://groups.google.com/group/watij</a>.  Let us know if you have any questions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Thomas</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-398</link>
		<dc:creator>Peter Thomas</dc:creator>
		<pubDate>Thu, 24 Aug 2006 17:51:06 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-398</guid>
		<description>It is working fine on a JUnit test case with quite a few methods on it. :\  $%&amp;*# Java Specification :).

Maybe this is why even JUnit 4 and TestNG don&#039;t provide a simple way to do what I want.

Really appreciate the feedback Jim :)

&lt;em&gt;[update: For now, as I said it is working fine for me (JDK 1.5.0_06 - Windows XP SP2 -JUnit 3.8.1) and I will update this post in case I see any need to change this approach.]&lt;/em&gt;

So maybe this approach needs more work to be foolproof.  For ordering of the methods I&#039;ll probably try something like what the Ruby unit test framework does, which is to sort the test methods alphanumerically.  So maybe I&#039;ll end up naming the methods test10_DoSomething, test20_DoSomethingElse etc.

I really hope you are wrong on the TestSuite.addTest() concept, and I&#039;ve seen in &lt;a href=&quot;http://www.awprofessional.com/articles/article.asp?p=101374&amp;seqNum=5&amp;rl=1&quot; rel=&quot;nofollow&quot;&gt;quite&lt;/a&gt; a &lt;a href=&quot;http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit.html&quot; rel=&quot;nofollow&quot;&gt;few&lt;/a&gt; places that the order is guaranteed.

Oh well I could always extend TestSuite...</description>
		<content:encoded><![CDATA[<p>It is working fine on a JUnit test case with quite a few methods on it. :\  $%&amp;*# Java Specification :).</p>
<p>Maybe this is why even JUnit 4 and TestNG don&#8217;t provide a simple way to do what I want.</p>
<p>Really appreciate the feedback Jim :)</p>
<p><em>[update: For now, as I said it is working fine for me (JDK 1.5.0_06 - Windows XP SP2 -JUnit 3.8.1) and I will update this post in case I see any need to change this approach.]</em></p>
<p>So maybe this approach needs more work to be foolproof.  For ordering of the methods I&#8217;ll probably try something like what the Ruby unit test framework does, which is to sort the test methods alphanumerically.  So maybe I&#8217;ll end up naming the methods test10_DoSomething, test20_DoSomethingElse etc.</p>
<p>I really hope you are wrong on the TestSuite.addTest() concept, and I&#8217;ve seen in <a href="http://www.awprofessional.com/articles/article.asp?p=101374&amp;seqNum=5&amp;rl=1" rel="nofollow">quite</a> a <a href="http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit.html" rel="nofollow">few</a> places that the order is guaranteed.</p>
<p>Oh well I could always extend TestSuite&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-397</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Thu, 24 Aug 2006 15:09:38 +0000</pubDate>
		<guid isPermaLink="false">https://ptrthomas.wordpress.com/2006/08/23/watij-and-running-junit-test-methods-in-the-order-that-you-want/#comment-397</guid>
		<description>(Hopefully) constructive feedback:

I don&#039;t think that you solved your problem.  It may work, but it&#039;s not (from what I read) guaranteed by the docs.

From the documentation for getMethods(), it says &quot;The elements in the array returned are not sorted and are not in any particular order.&quot;
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#getMethods()

And in the TestSuite class, I can&#039;t find it saying that the order in which tests are added is the order that it will be performed in.
http://junit.sourceforge.net/javadoc/junit/framework/TestSuite.html#addTest(junit.framework.Test)

I&#039;m not knocking that what you wrote works for your needs, but just to let you know that if the implementation of getMethods or JUnit is different from what you&#039;re working with, your code *could* break (but it&#039;s not likely).

In an older version of a java testing framework (strutstestcase?  junit?  cactus?  I can&#039;t rememeber) it would run the tests from the bottom of the java file to the top.  I upgraded the lib and they ran top down. :-(</description>
		<content:encoded><![CDATA[<p>(Hopefully) constructive feedback:</p>
<p>I don&#8217;t think that you solved your problem.  It may work, but it&#8217;s not (from what I read) guaranteed by the docs.</p>
<p>From the documentation for getMethods(), it says &#8220;The elements in the array returned are not sorted and are not in any particular order.&#8221;<br />
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#getMethods()" rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#getMethods()</a></p>
<p>And in the TestSuite class, I can&#8217;t find it saying that the order in which tests are added is the order that it will be performed in.<br />
<a href="http://junit.sourceforge.net/javadoc/junit/framework/TestSuite.html#addTest(junit.framework.Test)" rel="nofollow">http://junit.sourceforge.net/javadoc/junit/framework/TestSuite.html#addTest(junit.framework.Test)</a></p>
<p>I&#8217;m not knocking that what you wrote works for your needs, but just to let you know that if the implementation of getMethods or JUnit is different from what you&#8217;re working with, your code *could* break (but it&#8217;s not likely).</p>
<p>In an older version of a java testing framework (strutstestcase?  junit?  cactus?  I can&#8217;t rememeber) it would run the tests from the bottom of the java file to the top.  I upgraded the lib and they ran top down. :-(</p>
]]></content:encoded>
	</item>
</channel>
</rss>
