<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-2690</id>
	<title>Nabble - JUnit - User</title>
	<updated>2009-11-21T16:18:48Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/JUnit---User-f2690.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JUnit---User-f2690.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26461911</id>
	<title>Re: Categories in JUnit 4.8</title>
	<published>2009-11-21T16:18:48Z</published>
	<updated>2009-11-21T16:18:48Z</updated>
	<author>
		<name>Georg-21</name>
	</author>
	<content type="html">&lt;br&gt;Hi David!
&lt;br&gt;&lt;br&gt;A minor thing: why did you decide to use an additional annotation and did not add a property to @SuiteClasses?
&lt;br&gt;&lt;br&gt;E.g., your example (on &lt;a href=&quot;http://saffgreenbar.blogspot.com/2009/11/heres-test-code-snippet-public.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://saffgreenbar.blogspot.com/2009/11/heres-test-code-snippet-public.html&lt;/a&gt;)
&lt;br&gt;&lt;br&gt;&lt;br&gt;@RunWith(Categories.class)
&lt;br&gt;&amp;nbsp;@IncludeCategory(SlowTests.class)
&lt;br&gt;&amp;nbsp;@SuiteClasses( { A.class, B.class, C.class })
&lt;br&gt;&amp;nbsp;public static class SlowTestSuite {
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&lt;br&gt;could read 
&lt;br&gt;&lt;br&gt;@RunWith(Suite.class) 
&lt;br&gt;&amp;nbsp;@SuiteClasses( { A.class, B.class, C.class },
&lt;br&gt;&amp;nbsp; categories={SlowTests.class})
&lt;br&gt;&amp;nbsp;public static class SlowTestSuite {
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;This would make it more visible which tests a suite includes and reduces the number of annotations.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Georg
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26461911.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26455641</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-21T03:24:38Z</published>
	<updated>2009-11-21T03:24:38Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">2009/11/20 Cédric Beust ♔ &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26455641&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cbeust@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Fri, Nov 20, 2009 at 7:07 PM, Georg &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26455641&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;le_garcon_enerve@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi David,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Did you gave thoughs to cases where one would like to exclude certain
&lt;br&gt;&amp;gt;&amp;gt; tests? E.g.: run all tests that are not in (a) certain category(s)? This is
&lt;br&gt;&amp;gt;&amp;gt; probably not difficult add in one way or another onto the concept of
&lt;br&gt;&amp;gt;&amp;gt; categories, but the answer to &amp;quot;which test is now acctually included&amp;quot; could
&lt;br&gt;&amp;gt;&amp;gt; become confusing in cases where a test is in an included and an excluded
&lt;br&gt;&amp;gt;&amp;gt; category. I would like to see something here that does not require a lot of
&lt;br&gt;&amp;gt;&amp;gt; browsing through hierarchies of suites nad categories. This may in my
&lt;br&gt;&amp;gt;&amp;gt; approach not well solved either as suites can extend on other suites: if a
&lt;br&gt;&amp;gt;&amp;gt; referenced suite includes a certain test, it is executed even if the
&lt;br&gt;&amp;gt;&amp;gt; extending suite excludes a test.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; And more fundamentally: is the idea/need of exclusion meaningfull or just a
&lt;br&gt;&amp;gt;&amp;gt; result of badly organising tests (I'd say no, but I may be wrong)?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For what it's worth, excluding tests is a very popular TestNG features.  For
&lt;br&gt;&amp;gt; example, I use it when a few tests are broken and need to remain so for a
&lt;br&gt;&amp;gt; while:  I put them in the group &amp;quot;broken&amp;quot;, which I always exclude during my
&lt;br&gt;&amp;gt; runs.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; When the time to ship approaches, I look at all the tests in the &amp;quot;broken&amp;quot;
&lt;br&gt;&amp;gt; category and I go fix them then.
&lt;/div&gt;&lt;br&gt;For this particular use case, I've found @Ignore generally useful. &amp;nbsp;I
&lt;br&gt;also really love Kevin Lawrence's idea of marking tests with bug
&lt;br&gt;numbers. &amp;nbsp;He does it like this:
&lt;br&gt;&lt;br&gt;@Test public void shouldntDeleteAllTheUsersFiles() {
&lt;br&gt;&amp;nbsp; bug(34456);
&lt;br&gt;&amp;nbsp; ...
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;The test only starts failing once bug 34456 is marked as fixed in the
&lt;br&gt;bug system. &amp;nbsp;Once we have failing assumptions working as they truly
&lt;br&gt;should, this will be easy to implement on the JUnit side, although the
&lt;br&gt;bug-system integration would still be up to individual extenders or
&lt;br&gt;teams.
&lt;br&gt;&lt;br&gt;All this is to say that I do get the idea of excluded categories, but
&lt;br&gt;this particular instance doesn't immediately convince me.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; ***Cédric
&lt;br&gt;&amp;gt; *
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26455641.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26455522</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-21T03:11:20Z</published>
	<updated>2009-11-21T03:11:20Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">On Fri, Nov 20, 2009 at 10:07 PM, Georg &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26455522&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;le_garcon_enerve@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Hi David,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Did you gave thoughs to cases where one would like to exclude certain tests? E.g.: run all  tests that are not in (a) certain category(s)? This is probably not difficult add in one way or another onto the concept of categories, but the answer to &amp;quot;which test is now acctually included&amp;quot; could become confusing in cases where a test is in an included and an excluded category. I would like to see something here that does not require a lot of browsing through hierarchies of suites nad categories. This may in my approach not well solved either as suites can extend on other suites: if a referenced suite includes a certain test, it is executed even if the extending suite excludes a test.
&lt;br&gt;&lt;br&gt;Georg,
&lt;br&gt;&lt;br&gt;We came very close to adding an ExcludeCategories annotation.
&lt;br&gt;However, we decided to stay at a minimal feature set for Categories in
&lt;br&gt;the initial release, figuring that if the whole API turned out to be
&lt;br&gt;wrong, or if users just shrugged, then any time put into perfecting
&lt;br&gt;the mini-language of category filter configuration would be wasted.
&lt;br&gt;If the feature takes off, I think we'll certainly revisit that
&lt;br&gt;decision (especially if a highly-voted github issue requests it, hint,
&lt;br&gt;hint.)
&lt;br&gt;&lt;br&gt;However, Iyou touch on another concern: a simple category feature set
&lt;br&gt;that is easy to understand, but leaves out 20% of valid use cases, may
&lt;br&gt;be preferable to a more &amp;quot;feature complete&amp;quot; feature implementation that
&lt;br&gt;requires pages of documentation to fully grok. &amp;nbsp;I don't know that
&lt;br&gt;we're in danger of either extreme yet.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; And more fundamentally: is the idea/need of exclusion meaningfull or just a result of badly organising tests (I'd say no, but I may be wrong)?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt;  Georg
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26455522.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26453836</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-20T20:59:48Z</published>
	<updated>2009-11-20T20:59:48Z</updated>
	<author>
		<name>Cédric Beust ♔</name>
	</author>
	<content type="html">On Fri, Nov 20, 2009 at 7:07 PM, Georg &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26453836&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;le_garcon_enerve@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi David,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Did you gave thoughs to cases where one would like to exclude certain
&lt;br&gt;&amp;gt; tests? E.g.: run all tests that are not in (a) certain category(s)? This is
&lt;br&gt;&amp;gt; probably not difficult add in one way or another onto the concept of
&lt;br&gt;&amp;gt; categories, but the answer to &amp;quot;which test is now acctually included&amp;quot; could
&lt;br&gt;&amp;gt; become confusing in cases where a test is in an included and an excluded
&lt;br&gt;&amp;gt; category. I would like to see something here that does not require a lot of
&lt;br&gt;&amp;gt; browsing through hierarchies of suites nad categories. This may in my
&lt;br&gt;&amp;gt; approach not well solved either as suites can extend on other suites: if a
&lt;br&gt;&amp;gt; referenced suite includes a certain test, it is executed even if the
&lt;br&gt;&amp;gt; extending suite excludes a test.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; And more fundamentally: is the idea/need of exclusion meaningfull or just a
&lt;br&gt;&amp;gt; result of badly organising tests (I'd say no, but I may be wrong)?
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;For what it's worth, excluding tests is a very popular TestNG features. &amp;nbsp;For
&lt;br&gt;example, I use it when a few tests are broken and need to remain so for a
&lt;br&gt;while: &amp;nbsp;I put them in the group &amp;quot;broken&amp;quot;, which I always exclude during my
&lt;br&gt;runs.
&lt;br&gt;&lt;br&gt;When the time to ship approaches, I look at all the tests in the &amp;quot;broken&amp;quot;
&lt;br&gt;category and I go fix them then.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;***Cédric
&lt;br&gt;*
&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26453836.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26453599</id>
	<title>Re: Categories in JUnit 4.8</title>
	<published>2009-11-20T19:07:28Z</published>
	<updated>2009-11-20T19:07:28Z</updated>
	<author>
		<name>Georg-21</name>
	</author>
	<content type="html">Hi David,
&lt;br&gt;&lt;br&gt;Did you gave thoughs to cases where one would like to exclude certain tests? E.g.: run all &amp;nbsp;tests that are not in (a) certain category(s)? This is probably not difficult add in one way or another onto the concept of categories, but the answer to &amp;quot;which test is now acctually included&amp;quot; could become confusing in cases where a test is in an included and an excluded category. I would like to see something here that does not require a lot of browsing through hierarchies of suites nad categories. This may in my approach not well solved either as suites can extend on other suites: if a referenced suite includes a certain test, it is executed even if the extending suite excludes a test.
&lt;br&gt;&lt;br&gt;And more fundamentally: is the idea/need of exclusion meaningfull or just a result of badly organising tests (I'd say no, but I may be wrong)? 
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&amp;nbsp; Georg
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26453599.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26453603</id>
	<title>Re: Categories in JUnit 4.8</title>
	<published>2009-11-20T18:41:44Z</published>
	<updated>2009-11-20T18:41:44Z</updated>
	<author>
		<name>Georg-21</name>
	</author>
	<content type="html">Sorry!
&lt;br&gt;&lt;br&gt;The URL is &lt;a href=&quot;http://github.com/KentBeck/junit/issues/#issue/37&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit/issues/#issue/37&lt;/a&gt;&amp;nbsp;(can the issue number change? I have memories of this being number 41). The title is: Feature request: Making test suites less tedious.
&lt;br&gt;&lt;br&gt;On a side note: this does not allow for direct inheritance like in the categories, but for a combination of tests and suites, which, IMHO, achieves the same flexibility.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&amp;nbsp; Georg
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26453603.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26453604</id>
	<title>Re: Gathering and displaying supplemental information about  test failures.</title>
	<published>2009-11-20T16:15:14Z</published>
	<updated>2009-11-20T16:15:14Z</updated>
	<author>
		<name>Sunburned Surveyor</name>
	</author>
	<content type="html">Thanks David. I'll give the assertThat a close look.
&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 2:17 PM, David Saff &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26453604&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Landon,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Definitely take a close look at the failure messages from the standard
&lt;br&gt;&amp;gt; assert methods, and also the assertThat method added in 4.4. Good
&lt;br&gt;&amp;gt; luck,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; David Saff
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 20, 2009 at 2:32 PM, Sunburned Surveyor
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26453604&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sunburned.surveyor@...&lt;/a&gt; &amp;lt;sunburned.surveyor%40gmail.com&amp;gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; David,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; In this particular case your technique would work.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I wonder, when testing return values that are slightly more complicated,
&lt;br&gt;&amp;gt; if
&lt;br&gt;&amp;gt; &amp;gt; this would start to fall apart. I don't have specific examples I can give
&lt;br&gt;&amp;gt; &amp;gt; you just yet.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I will give this some more thought, and maybe try some code. Before I
&lt;br&gt;&amp;gt; went
&lt;br&gt;&amp;gt; &amp;gt; very far I wanted to make sure there wasn't an existing system I should
&lt;br&gt;&amp;gt; use.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Thanks for the responses. I have listened to the JUnit group for a while,
&lt;br&gt;&amp;gt; &amp;gt; but this was my first post.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Landon (AKA The Sunburned Surveyor)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; On Fri, Nov 20, 2009 at 11:22 AM, David Saff &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26453604&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david@...&lt;/a&gt;&amp;lt;david%40saff.net&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Dear Sunburned,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; If I write
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; assertEquals(&amp;quot;(1,-1,0)&amp;quot;, point.toString());
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; and change the toString method, I get this (slightly garbled, but
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; mostly helpful) failure:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; org.junit.ComparisonFailure: expected:&amp;lt;[(1,-1,0)]&amp;gt; but was:&amp;lt;[[1, -1,
&lt;br&gt;&amp;gt; 0]]&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; at org.junit.Assert.assertEquals(Assert.java:123)...
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; This seems to cover the one example you cite. Are there others?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; David Saff
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; On Fri, Nov 20, 2009 at 1:06 PM, Sunburned Surveyor
&lt;br&gt;&amp;gt; &amp;nbsp;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26453604&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sunburned.surveyor@...&lt;/a&gt; &amp;lt;sunburned.surveyor%40gmail.com&amp;gt;&amp;lt;sunburned.surveyor%
&lt;br&gt;&amp;gt; 40gmail.com&amp;gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; I have a question about the options for gathering and displaying
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; supplemental information about test failures. Please allow me to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; illustrate my question with a simple example.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; coordinate system. I've overloaded the toString method of this class
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; String. Now I want to test my toString method using JUnit.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; If the Coordinate.toString test method fails (because the string was
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; not constructed in the correct format) I would like to provide the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; programmer running the test with a copy of the incorrect string, since
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; it provides valuable clues about what is broken with the method under
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; test. I typically do this by placing System.err.println statements in
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; my test method. However, I realize that using System.err.println isn't
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; the most portable or elegant way to provide this information to the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; programmer executing the test.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; What I really want is a GUI that allows the programmer to select a
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; test data I provide him/her.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; I was thinking I could do this by completing the following tasks:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; - Implementing the RunListener interface in JUnit.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; - Create an extension of Exception that could contain a HashMap of
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; simple parameters and that would be passed to the constructor of a
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; Failure object from within a test.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; - Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; failrure data.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; - Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; - Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; information in my RunListener implemenation to show the programmer
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; executing my tests the supplemental failure data as described above.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; (FailureProcessor would be an interface so that you could do different
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; do this. I know I could use a logging framework from within my test
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; method, but I really want to work within the JUnut framework, not
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; How are other programmers handling instances when they want to display
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; The Sunburned Surveyor
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; ------------------------------------
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ------------------------------------
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26453604.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26451154</id>
	<title>Re: Gathering and displaying supplemental information about  test failures.</title>
	<published>2009-11-20T14:17:47Z</published>
	<updated>2009-11-20T14:17:47Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">Landon,
&lt;br&gt;&lt;br&gt;Definitely take a close look at the failure messages from the standard
&lt;br&gt;assert methods, and also the assertThat method added in 4.4. &amp;nbsp;Good
&lt;br&gt;luck,
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 2:32 PM, Sunburned Surveyor
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26451154&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sunburned.surveyor@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; David,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In this particular case your technique would work.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I wonder, when testing return values that are slightly more complicated, if
&lt;br&gt;&amp;gt; this would start to fall apart. I don't have specific examples I can give
&lt;br&gt;&amp;gt; you just yet.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I will give this some more thought, and maybe try some code. Before I went
&lt;br&gt;&amp;gt; very far I wanted to make sure there wasn't an existing system I should use.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks for the responses. I have listened to the JUnit group for a while,
&lt;br&gt;&amp;gt; but this was my first post.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Landon (AKA The Sunburned Surveyor)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 20, 2009 at 11:22 AM, David Saff &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26451154&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Dear Sunburned,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If I write
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; assertEquals(&amp;quot;(1,-1,0)&amp;quot;, point.toString());
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; and change the toString method, I get this (slightly garbled, but
&lt;br&gt;&amp;gt;&amp;gt; mostly helpful) failure:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; org.junit.ComparisonFailure: expected:&amp;lt;[(1,-1,0)]&amp;gt; but was:&amp;lt;[[1, -1, 0]]&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; at org.junit.Assert.assertEquals(Assert.java:123)...
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This seems to cover the one example you cite. Are there others?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; David Saff
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On Fri, Nov 20, 2009 at 1:06 PM, Sunburned Surveyor
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26451154&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sunburned.surveyor@...&lt;/a&gt; &amp;lt;sunburned.surveyor%40gmail.com&amp;gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; I have a question about the options for gathering and displaying
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; supplemental information about test failures. Please allow me to
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; illustrate my question with a simple example.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; coordinate system. I've overloaded the toString method of this class
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; String. Now I want to test my toString method using JUnit.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; If the Coordinate.toString test method fails (because the string was
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; not constructed in the correct format) I would like to provide the
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; programmer running the test with a copy of the incorrect string, since
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; it provides valuable clues about what is broken with the method under
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; test. I typically do this by placing System.err.println statements in
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; my test method. However, I realize that using System.err.println isn't
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; the most portable or elegant way to provide this information to the
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; programmer executing the test.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; What I really want is a GUI that allows the programmer to select a
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; test data I provide him/her.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; I was thinking I could do this by completing the following tasks:
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; - Implementing the RunListener interface in JUnit.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; - Create an extension of Exception that could contain a HashMap of
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; simple parameters and that would be passed to the constructor of a
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; Failure object from within a test.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; - Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; failrure data.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; - Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; - Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; information in my RunListener implemenation to show the programmer
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; executing my tests the supplemental failure data as described above.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; (FailureProcessor would be an interface so that you could do different
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; do this. I know I could use a logging framework from within my test
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; method, but I really want to work within the JUnut framework, not
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; How are other programmers handling instances when they want to display
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; The Sunburned Surveyor
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26451154.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26449567</id>
	<title>Re: Gathering and displaying supplemental information about  test failures.</title>
	<published>2009-11-20T11:45:03Z</published>
	<updated>2009-11-20T11:45:03Z</updated>
	<author>
		<name>Sunburned Surveyor</name>
	</author>
	<content type="html">Big Mike,
&lt;br&gt;&lt;br&gt;Thanks for the info. I don't know that the system I have in mind will
&lt;br&gt;require any tweaks to JUnit. I think all of my code can run along side of
&lt;br&gt;it, so I won't need to fork JUnit at all. I will know more in a couple of
&lt;br&gt;days.
&lt;br&gt;&lt;br&gt;I'm very much a JUnit rookie, so I won't presume I can improve it. :]
&lt;br&gt;&lt;br&gt;If I get some code working I will post a link to it so other JUnit users can
&lt;br&gt;evaluate and make suggestions on improving it.
&lt;br&gt;&lt;br&gt;Landon
&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 11:33 AM, Forsberg, Mike &amp;lt;
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mike.forsberg@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You might consider extending/changing/refactoring JUnit itself using
&lt;br&gt;&amp;gt; github.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; There you can fork JUnit itself and submit your idea for inclusion for
&lt;br&gt;&amp;gt; everyone. It is a very easy system. Yet, Kent and David do an excellent job
&lt;br&gt;&amp;gt; keeping the code consistent. (Enhancements are considered, but there is a
&lt;br&gt;&amp;gt; high bar for inclusion into the code base.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; With all that said, I think David Saff response covers your initial
&lt;br&gt;&amp;gt; question.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Big Mike
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt; [mailto:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt;] On Behalf Of Sunburned
&lt;br&gt;&amp;gt; Surveyor
&lt;br&gt;&amp;gt; Sent: Friday, November 20, 2009 1:22 PM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt;
&lt;br&gt;&amp;gt; Subject: Re: [junit] Gathering and displaying supplemental information
&lt;br&gt;&amp;gt; about test failures.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Mike,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've never seen it. I am interested, but ultimately we are looking for a
&lt;br&gt;&amp;gt; solution that will work outside of Eclipse. We are working on an open
&lt;br&gt;&amp;gt; source
&lt;br&gt;&amp;gt; library, and we can't know what IDE/build environment other contributors
&lt;br&gt;&amp;gt; will be using.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Maybe if I get something worked up they would consider making it a
&lt;br&gt;&amp;gt; supplemental part of JUnit. In the worst case, I'll make a distro of my
&lt;br&gt;&amp;gt; code
&lt;br&gt;&amp;gt; available on SourceForge.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Landon
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 20, 2009 at 11:20 AM, Forsberg, Mike &amp;lt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mike.forsberg@...&lt;/a&gt; &amp;lt;mike.forsberg%40globalfoundries.com&amp;gt;
&lt;br&gt;&amp;gt; &amp;lt;mailto:mike.forsberg%40globalfoundries.com&amp;lt;mike.forsberg%2540globalfoundries.com&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Have you looked at how eclipse handles AssertEquals of two Strings.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Not sure if this is a JUnit core functionality or not. But eclipse
&lt;br&gt;&amp;gt; &amp;gt; highlights how the two strings differ.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Just wondering if you've ever seen this functionality... I'll send screen
&lt;br&gt;&amp;gt; &amp;gt; shots if not.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Big Mike
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt;&amp;lt;mailto:
&lt;br&gt;&amp;gt; junit%40yahoogroups.com &amp;lt;junit%2540yahoogroups.com&amp;gt;&amp;gt; &amp;lt;junit%
&lt;br&gt;&amp;gt; 40yahoogroups.com&amp;gt; [mailto:
&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt;&amp;lt;mailto:
&lt;br&gt;&amp;gt; junit%40yahoogroups.com &amp;lt;junit%2540yahoogroups.com&amp;gt;&amp;gt; &amp;lt;junit%
&lt;br&gt;&amp;gt; 40yahoogroups.com&amp;gt;] On Behalf Of Sunburned
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Surveyor
&lt;br&gt;&amp;gt; &amp;gt; Sent: Friday, November 20, 2009 12:06 PM
&lt;br&gt;&amp;gt; &amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449567&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt;&amp;lt;mailto:
&lt;br&gt;&amp;gt; junit%40yahoogroups.com &amp;lt;junit%2540yahoogroups.com&amp;gt;&amp;gt; &amp;lt;junit%
&lt;br&gt;&amp;gt; 40yahoogroups.com&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Cc: Martin Davis; Martin Davis
&lt;br&gt;&amp;gt; &amp;gt; Subject: [junit] Gathering and displaying supplemental information about
&lt;br&gt;&amp;gt; &amp;gt; test failures.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I have a question about the options for gathering and displaying
&lt;br&gt;&amp;gt; &amp;gt; supplemental information about test failures. Please allow me to
&lt;br&gt;&amp;gt; &amp;gt; illustrate my question with a simple example.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;&amp;gt; &amp;gt; coordinate system. I've overloaded the toString method of this class
&lt;br&gt;&amp;gt; &amp;gt; to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;&amp;gt; &amp;gt; String. Now I want to test my toString method using JUnit.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; If the Coordinate.toString test method fails (because the string was
&lt;br&gt;&amp;gt; &amp;gt; not constructed in the correct format) I would like to provide the
&lt;br&gt;&amp;gt; &amp;gt; programmer running the test with a copy of the incorrect string, since
&lt;br&gt;&amp;gt; &amp;gt; it provides valuable clues about what is broken with the method under
&lt;br&gt;&amp;gt; &amp;gt; test. I typically do this by placing System.err.println statements in
&lt;br&gt;&amp;gt; &amp;gt; my test method. However, I realize that using System.err.println isn't
&lt;br&gt;&amp;gt; &amp;gt; the most portable or elegant way to provide this information to the
&lt;br&gt;&amp;gt; &amp;gt; programmer executing the test.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; What I really want is a GUI that allows the programmer to select a
&lt;br&gt;&amp;gt; &amp;gt; failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;&amp;gt; &amp;gt; test data I provide him/her.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I was thinking I could do this by completing the following tasks:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; - Implementing the RunListener interface in JUnit.
&lt;br&gt;&amp;gt; &amp;gt; - Create an extension of Exception that could contain a HashMap of
&lt;br&gt;&amp;gt; &amp;gt; simple parameters and that would be passed to the constructor of a
&lt;br&gt;&amp;gt; &amp;gt; Failure object from within a test.
&lt;br&gt;&amp;gt; &amp;gt; - Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;&amp;gt; &amp;gt; failrure data.
&lt;br&gt;&amp;gt; &amp;gt; - Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;&amp;gt; &amp;gt; - Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;&amp;gt; &amp;gt; information in my RunListener implemenation to show the programmer
&lt;br&gt;&amp;gt; &amp;gt; executing my tests the supplemental failure data as described above.
&lt;br&gt;&amp;gt; &amp;gt; (FailureProcessor would be an interface so that you could do different
&lt;br&gt;&amp;gt; &amp;gt; things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;&amp;gt; &amp;gt; do this. I know I could use a logging framework from within my test
&lt;br&gt;&amp;gt; &amp;gt; method, but I really want to work within the JUnut framework, not
&lt;br&gt;&amp;gt; &amp;gt; outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; How are other programmers handling instances when they want to display
&lt;br&gt;&amp;gt; &amp;gt; supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The Sunburned Surveyor
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26449567.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26449094</id>
	<title>RE: Gathering and displaying supplemental information about test failures.</title>
	<published>2009-11-20T11:33:41Z</published>
	<updated>2009-11-20T11:33:41Z</updated>
	<author>
		<name>Forsberg, Mike-2</name>
	</author>
	<content type="html">You might consider extending/changing/refactoring JUnit itself using github.
&lt;br&gt;&lt;br&gt;There you can fork JUnit itself and submit your idea for inclusion for everyone. &amp;nbsp;It is a very easy system. &amp;nbsp;Yet, Kent and David do an excellent job keeping the code consistent. &amp;nbsp;(Enhancements are considered, but there is a high bar for inclusion into the code base.)
&lt;br&gt;&lt;br&gt;With all that said, I think David Saff response covers your initial question.
&lt;br&gt;&lt;br&gt;Big Mike
&lt;br&gt;&lt;br&gt;From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449094&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; [mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449094&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;] On Behalf Of Sunburned Surveyor
&lt;br&gt;Sent: Friday, November 20, 2009 1:22 PM
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449094&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;
&lt;br&gt;Subject: Re: [junit] Gathering and displaying supplemental information about test failures.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Mike,
&lt;br&gt;&lt;br&gt;I've never seen it. I am interested, but ultimately we are looking for a
&lt;br&gt;solution that will work outside of Eclipse. We are working on an open source
&lt;br&gt;library, and we can't know what IDE/build environment other contributors
&lt;br&gt;will be using.
&lt;br&gt;&lt;br&gt;Maybe if I get something worked up they would consider making it a
&lt;br&gt;supplemental part of JUnit. In the worst case, I'll make a distro of my code
&lt;br&gt;available on SourceForge.
&lt;br&gt;&lt;br&gt;Landon
&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 11:20 AM, Forsberg, Mike &amp;lt;
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449094&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mike.forsberg@...&lt;/a&gt;&amp;lt;mailto:mike.forsberg%40globalfoundries.com&amp;gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Have you looked at how eclipse handles AssertEquals of two Strings.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Not sure if this is a JUnit core functionality or not. But eclipse
&lt;br&gt;&amp;gt; highlights how the two strings differ.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Just wondering if you've ever seen this functionality... I'll send screen
&lt;br&gt;&amp;gt; shots if not.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Big Mike
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449094&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;&amp;lt;mailto:junit%40yahoogroups.com&amp;gt; &amp;lt;junit%40yahoogroups.com&amp;gt; [mailto:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449094&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;&amp;lt;mailto:junit%40yahoogroups.com&amp;gt; &amp;lt;junit%40yahoogroups.com&amp;gt;] On Behalf Of Sunburned
&lt;br&gt;&amp;gt; Surveyor
&lt;br&gt;&amp;gt; Sent: Friday, November 20, 2009 12:06 PM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26449094&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;&amp;lt;mailto:junit%40yahoogroups.com&amp;gt; &amp;lt;junit%40yahoogroups.com&amp;gt;
&lt;br&gt;&amp;gt; Cc: Martin Davis; Martin Davis
&lt;br&gt;&amp;gt; Subject: [junit] Gathering and displaying supplemental information about
&lt;br&gt;&amp;gt; test failures.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have a question about the options for gathering and displaying
&lt;br&gt;&amp;gt; supplemental information about test failures. Please allow me to
&lt;br&gt;&amp;gt; illustrate my question with a simple example.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;&amp;gt; coordinate system. I've overloaded the toString method of this class
&lt;br&gt;&amp;gt; to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;&amp;gt; String. Now I want to test my toString method using JUnit.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If the Coordinate.toString test method fails (because the string was
&lt;br&gt;&amp;gt; not constructed in the correct format) I would like to provide the
&lt;br&gt;&amp;gt; programmer running the test with a copy of the incorrect string, since
&lt;br&gt;&amp;gt; it provides valuable clues about what is broken with the method under
&lt;br&gt;&amp;gt; test. I typically do this by placing System.err.println statements in
&lt;br&gt;&amp;gt; my test method. However, I realize that using System.err.println isn't
&lt;br&gt;&amp;gt; the most portable or elegant way to provide this information to the
&lt;br&gt;&amp;gt; programmer executing the test.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What I really want is a GUI that allows the programmer to select a
&lt;br&gt;&amp;gt; failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;&amp;gt; test data I provide him/her.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I was thinking I could do this by completing the following tasks:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - Implementing the RunListener interface in JUnit.
&lt;br&gt;&amp;gt; - Create an extension of Exception that could contain a HashMap of
&lt;br&gt;&amp;gt; simple parameters and that would be passed to the constructor of a
&lt;br&gt;&amp;gt; Failure object from within a test.
&lt;br&gt;&amp;gt; - Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;&amp;gt; failrure data.
&lt;br&gt;&amp;gt; - Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;&amp;gt; - Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;&amp;gt; information in my RunListener implemenation to show the programmer
&lt;br&gt;&amp;gt; executing my tests the supplemental failure data as described above.
&lt;br&gt;&amp;gt; (FailureProcessor would be an interface so that you could do different
&lt;br&gt;&amp;gt; things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;&amp;gt; do this. I know I could use a logging framework from within my test
&lt;br&gt;&amp;gt; method, but I really want to work within the JUnut framework, not
&lt;br&gt;&amp;gt; outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How are other programmers handling instances when they want to display
&lt;br&gt;&amp;gt; supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The Sunburned Surveyor
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26449094.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26450291</id>
	<title>Re: Gathering and displaying supplemental information about  test failures.</title>
	<published>2009-11-20T11:32:23Z</published>
	<updated>2009-11-20T11:32:23Z</updated>
	<author>
		<name>Sunburned Surveyor</name>
	</author>
	<content type="html">David,
&lt;br&gt;&lt;br&gt;In this particular case your technique would work.
&lt;br&gt;&lt;br&gt;I wonder, when testing return values that are slightly more complicated, if
&lt;br&gt;this would start to fall apart. I don't have specific examples I can give
&lt;br&gt;you just yet.
&lt;br&gt;&lt;br&gt;I will give this some more thought, and maybe try some code. Before I went
&lt;br&gt;very far I wanted to make sure there wasn't an existing system I should use.
&lt;br&gt;&lt;br&gt;Thanks for the responses. I have listened to the JUnit group for a while,
&lt;br&gt;but this was my first post.
&lt;br&gt;&lt;br&gt;Landon (AKA The Sunburned Surveyor)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 11:22 AM, David Saff &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26450291&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Dear Sunburned,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If I write
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; assertEquals(&amp;quot;(1,-1,0)&amp;quot;, point.toString());
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; and change the toString method, I get this (slightly garbled, but
&lt;br&gt;&amp;gt; mostly helpful) failure:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; org.junit.ComparisonFailure: expected:&amp;lt;[(1,-1,0)]&amp;gt; but was:&amp;lt;[[1, -1, 0]]&amp;gt;
&lt;br&gt;&amp;gt; at org.junit.Assert.assertEquals(Assert.java:123)...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This seems to cover the one example you cite. Are there others?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; David Saff
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Fri, Nov 20, 2009 at 1:06 PM, Sunburned Surveyor
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26450291&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sunburned.surveyor@...&lt;/a&gt; &amp;lt;sunburned.surveyor%40gmail.com&amp;gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; I have a question about the options for gathering and displaying
&lt;br&gt;&amp;gt; &amp;gt; supplemental information about test failures. Please allow me to
&lt;br&gt;&amp;gt; &amp;gt; illustrate my question with a simple example.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;&amp;gt; &amp;gt; coordinate system. I've overloaded the toString method of this class
&lt;br&gt;&amp;gt; &amp;gt; to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;&amp;gt; &amp;gt; String. Now I want to test my toString method using JUnit.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; If the Coordinate.toString test method fails (because the string was
&lt;br&gt;&amp;gt; &amp;gt; not constructed in the correct format) I would like to provide the
&lt;br&gt;&amp;gt; &amp;gt; programmer running the test with a copy of the incorrect string, since
&lt;br&gt;&amp;gt; &amp;gt; it provides valuable clues about what is broken with the method under
&lt;br&gt;&amp;gt; &amp;gt; test. I typically do this by placing System.err.println statements in
&lt;br&gt;&amp;gt; &amp;gt; my test method. However, I realize that using System.err.println isn't
&lt;br&gt;&amp;gt; &amp;gt; the most portable or elegant way to provide this information to the
&lt;br&gt;&amp;gt; &amp;gt; programmer executing the test.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; What I really want is a GUI that allows the programmer to select a
&lt;br&gt;&amp;gt; &amp;gt; failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;&amp;gt; &amp;gt; test data I provide him/her.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I was thinking I could do this by completing the following tasks:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; - Implementing the RunListener interface in JUnit.
&lt;br&gt;&amp;gt; &amp;gt; - Create an extension of Exception that could contain a HashMap of
&lt;br&gt;&amp;gt; &amp;gt; simple parameters and that would be passed to the constructor of a
&lt;br&gt;&amp;gt; &amp;gt; Failure object from within a test.
&lt;br&gt;&amp;gt; &amp;gt; - Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;&amp;gt; &amp;gt; failrure data.
&lt;br&gt;&amp;gt; &amp;gt; - Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;&amp;gt; &amp;gt; - Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;&amp;gt; &amp;gt; information in my RunListener implemenation to show the programmer
&lt;br&gt;&amp;gt; &amp;gt; executing my tests the supplemental failure data as described above.
&lt;br&gt;&amp;gt; &amp;gt; (FailureProcessor would be an interface so that you could do different
&lt;br&gt;&amp;gt; &amp;gt; things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;&amp;gt; &amp;gt; do this. I know I could use a logging framework from within my test
&lt;br&gt;&amp;gt; &amp;gt; method, but I really want to work within the JUnut framework, not
&lt;br&gt;&amp;gt; &amp;gt; outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; How are other programmers handling instances when they want to display
&lt;br&gt;&amp;gt; &amp;gt; supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The Sunburned Surveyor
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ------------------------------------
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26450291.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26448976</id>
	<title>Re: Gathering and displaying supplemental information about  test failures.</title>
	<published>2009-11-20T11:22:28Z</published>
	<updated>2009-11-20T11:22:28Z</updated>
	<author>
		<name>Sunburned Surveyor</name>
	</author>
	<content type="html">Mike,
&lt;br&gt;&lt;br&gt;I've never seen it. I am interested, but ultimately we are looking for a
&lt;br&gt;solution that will work outside of Eclipse. We are working on an open source
&lt;br&gt;library, and we can't know what IDE/build environment other contributors
&lt;br&gt;will be using.
&lt;br&gt;&lt;br&gt;Maybe if I get something worked up they would consider making it a
&lt;br&gt;supplemental part of JUnit. In the worst case, I'll make a distro of my code
&lt;br&gt;available on SourceForge.
&lt;br&gt;&lt;br&gt;Landon
&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 11:20 AM, Forsberg, Mike &amp;lt;
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448976&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mike.forsberg@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Have you looked at how eclipse handles AssertEquals of two Strings.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Not sure if this is a JUnit core functionality or not. But eclipse
&lt;br&gt;&amp;gt; highlights how the two strings differ.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Just wondering if you've ever seen this functionality... I'll send screen
&lt;br&gt;&amp;gt; shots if not.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Big Mike
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448976&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt; [mailto:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448976&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt;] On Behalf Of Sunburned
&lt;br&gt;&amp;gt; Surveyor
&lt;br&gt;&amp;gt; Sent: Friday, November 20, 2009 12:06 PM
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448976&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; &amp;lt;junit%40yahoogroups.com&amp;gt;
&lt;br&gt;&amp;gt; Cc: Martin Davis; Martin Davis
&lt;br&gt;&amp;gt; Subject: [junit] Gathering and displaying supplemental information about
&lt;br&gt;&amp;gt; test failures.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have a question about the options for gathering and displaying
&lt;br&gt;&amp;gt; supplemental information about test failures. Please allow me to
&lt;br&gt;&amp;gt; illustrate my question with a simple example.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;&amp;gt; coordinate system. I've overloaded the toString method of this class
&lt;br&gt;&amp;gt; to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;&amp;gt; String. Now I want to test my toString method using JUnit.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If the Coordinate.toString test method fails (because the string was
&lt;br&gt;&amp;gt; not constructed in the correct format) I would like to provide the
&lt;br&gt;&amp;gt; programmer running the test with a copy of the incorrect string, since
&lt;br&gt;&amp;gt; it provides valuable clues about what is broken with the method under
&lt;br&gt;&amp;gt; test. I typically do this by placing System.err.println statements in
&lt;br&gt;&amp;gt; my test method. However, I realize that using System.err.println isn't
&lt;br&gt;&amp;gt; the most portable or elegant way to provide this information to the
&lt;br&gt;&amp;gt; programmer executing the test.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What I really want is a GUI that allows the programmer to select a
&lt;br&gt;&amp;gt; failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;&amp;gt; test data I provide him/her.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I was thinking I could do this by completing the following tasks:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - Implementing the RunListener interface in JUnit.
&lt;br&gt;&amp;gt; - Create an extension of Exception that could contain a HashMap of
&lt;br&gt;&amp;gt; simple parameters and that would be passed to the constructor of a
&lt;br&gt;&amp;gt; Failure object from within a test.
&lt;br&gt;&amp;gt; - Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;&amp;gt; failrure data.
&lt;br&gt;&amp;gt; - Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;&amp;gt; - Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;&amp;gt; information in my RunListener implemenation to show the programmer
&lt;br&gt;&amp;gt; executing my tests the supplemental failure data as described above.
&lt;br&gt;&amp;gt; (FailureProcessor would be an interface so that you could do different
&lt;br&gt;&amp;gt; things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;&amp;gt; do this. I know I could use a logging framework from within my test
&lt;br&gt;&amp;gt; method, but I really want to work within the JUnut framework, not
&lt;br&gt;&amp;gt; outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How are other programmers handling instances when they want to display
&lt;br&gt;&amp;gt; supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The Sunburned Surveyor
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26448976.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26448927</id>
	<title>Re: Gathering and displaying supplemental information about  test failures.</title>
	<published>2009-11-20T11:22:16Z</published>
	<updated>2009-11-20T11:22:16Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">Dear Sunburned,
&lt;br&gt;&lt;br&gt;If I write
&lt;br&gt;&lt;br&gt;assertEquals(&amp;quot;(1,-1,0)&amp;quot;, point.toString());
&lt;br&gt;&lt;br&gt;and change the toString method, I get this (slightly garbled, but
&lt;br&gt;mostly helpful) failure:
&lt;br&gt;&lt;br&gt;org.junit.ComparisonFailure: expected:&amp;lt;[(1,-1,0)]&amp;gt; but was:&amp;lt;[[1, -1, 0]]&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.junit.Assert.assertEquals(Assert.java:123)...
&lt;br&gt;&lt;br&gt;This seems to cover the one example you cite. &amp;nbsp;Are there others?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 1:06 PM, Sunburned Surveyor
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448927&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sunburned.surveyor@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I have a question about the options for gathering and displaying
&lt;br&gt;&amp;gt; supplemental information about test failures. Please allow me to
&lt;br&gt;&amp;gt; illustrate my question with a simple example.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;&amp;gt; coordinate system. I've overloaded the toString method of this class
&lt;br&gt;&amp;gt; to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;&amp;gt; String. Now I want to test my toString method using JUnit.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If the Coordinate.toString test method fails (because the string was
&lt;br&gt;&amp;gt; not constructed in the correct format) I would like to provide the
&lt;br&gt;&amp;gt; programmer running the test with a copy of the incorrect string, since
&lt;br&gt;&amp;gt; it provides valuable clues about what is broken with the method under
&lt;br&gt;&amp;gt; test. I typically do this by placing System.err.println statements in
&lt;br&gt;&amp;gt; my test method. However, I realize that using System.err.println isn't
&lt;br&gt;&amp;gt; the most portable or elegant way to provide this information to the
&lt;br&gt;&amp;gt; programmer executing the test.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What I really want is a GUI that allows the programmer to select a
&lt;br&gt;&amp;gt; failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;&amp;gt; test data I provide him/her.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I was thinking I could do this by completing the following tasks:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - Implementing the RunListener interface in JUnit.
&lt;br&gt;&amp;gt; - Create an extension of Exception that could contain a HashMap of
&lt;br&gt;&amp;gt; simple parameters and that would be passed to the constructor of a
&lt;br&gt;&amp;gt; Failure object from within a test.
&lt;br&gt;&amp;gt; - Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;&amp;gt; failrure data.
&lt;br&gt;&amp;gt; - Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;&amp;gt; - Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;&amp;gt; information in my RunListener implemenation to show the programmer
&lt;br&gt;&amp;gt; executing my tests the supplemental failure data as described above.
&lt;br&gt;&amp;gt; (FailureProcessor would be an interface so that you could do different
&lt;br&gt;&amp;gt; things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;&amp;gt; do this. I know I could use a logging framework from within my test
&lt;br&gt;&amp;gt; method, but I really want to work within the JUnut framework, not
&lt;br&gt;&amp;gt; outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; How are other programmers handling instances when they want to display
&lt;br&gt;&amp;gt; supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The Sunburned Surveyor
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26448927.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26448889</id>
	<title>RE: Gathering and displaying supplemental information about test 	failures.</title>
	<published>2009-11-20T11:20:15Z</published>
	<updated>2009-11-20T11:20:15Z</updated>
	<author>
		<name>Forsberg, Mike-2</name>
	</author>
	<content type="html">Have you looked at how eclipse handles AssertEquals of two Strings.
&lt;br&gt;&lt;br&gt;Not sure if this is a JUnit core functionality or not. &amp;nbsp;But eclipse highlights how the two strings differ.
&lt;br&gt;&lt;br&gt;Just wondering if you've ever seen this functionality... I'll send screen shots if not.
&lt;br&gt;&lt;br&gt;Big Mike
&lt;br&gt;&lt;br&gt;From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448889&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; [mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448889&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;] On Behalf Of Sunburned Surveyor
&lt;br&gt;Sent: Friday, November 20, 2009 12:06 PM
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26448889&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;
&lt;br&gt;Cc: Martin Davis; Martin Davis
&lt;br&gt;Subject: [junit] Gathering and displaying supplemental information about test failures.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;I have a question about the options for gathering and displaying
&lt;br&gt;supplemental information about test failures. Please allow me to
&lt;br&gt;illustrate my question with a simple example.
&lt;br&gt;&lt;br&gt;I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;coordinate system. I've overloaded the toString method of this class
&lt;br&gt;to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;String. Now I want to test my toString method using JUnit.
&lt;br&gt;&lt;br&gt;If the Coordinate.toString test method fails (because the string was
&lt;br&gt;not constructed in the correct format) I would like to provide the
&lt;br&gt;programmer running the test with a copy of the incorrect string, since
&lt;br&gt;it provides valuable clues about what is broken with the method under
&lt;br&gt;test. I typically do this by placing System.err.println statements in
&lt;br&gt;my test method. However, I realize that using System.err.println isn't
&lt;br&gt;the most portable or elegant way to provide this information to the
&lt;br&gt;programmer executing the test.
&lt;br&gt;&lt;br&gt;What I really want is a GUI that allows the programmer to select a
&lt;br&gt;failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;test data I provide him/her.
&lt;br&gt;&lt;br&gt;I was thinking I could do this by completing the following tasks:
&lt;br&gt;&lt;br&gt;- Implementing the RunListener interface in JUnit.
&lt;br&gt;- Create an extension of Exception that could contain a HashMap of
&lt;br&gt;simple parameters and that would be passed to the constructor of a
&lt;br&gt;Failure object from within a test.
&lt;br&gt;- Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;failrure data.
&lt;br&gt;- Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;- Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;information in my RunListener implemenation to show the programmer
&lt;br&gt;executing my tests the supplemental failure data as described above.
&lt;br&gt;(FailureProcessor would be an interface so that you could do different
&lt;br&gt;things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&lt;br&gt;Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;do this. I know I could use a logging framework from within my test
&lt;br&gt;method, but I really want to work within the JUnut framework, not
&lt;br&gt;outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&lt;br&gt;How are other programmers handling instances when they want to display
&lt;br&gt;supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&lt;br&gt;The Sunburned Surveyor
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26448889.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26448853</id>
	<title>Gathering and displaying supplemental information about test  failures.</title>
	<published>2009-11-20T10:06:22Z</published>
	<updated>2009-11-20T10:06:22Z</updated>
	<author>
		<name>Sunburned Surveyor</name>
	</author>
	<content type="html">I have a question about the options for gathering and displaying
&lt;br&gt;supplemental information about test failures. Please allow me to
&lt;br&gt;illustrate my question with a simple example.
&lt;br&gt;&lt;br&gt;I've got a class called Coordinate that represents a point in a 3D
&lt;br&gt;coordinate system. I've overloaded the toString method of this class
&lt;br&gt;to write out the X, Y, and Z values of the coordinate in a simple
&lt;br&gt;String. Now I want to test my toString method using JUnit.
&lt;br&gt;&lt;br&gt;If the Coordinate.toString test method fails (because the string was
&lt;br&gt;not constructed in the correct format) I would like to provide the
&lt;br&gt;programmer running the test with a copy of the incorrect string, since
&lt;br&gt;it provides valuable clues about what is broken with the method under
&lt;br&gt;test. I typically do this by placing System.err.println statements in
&lt;br&gt;my test method. However, I realize that using System.err.println isn't
&lt;br&gt;the most portable or elegant way to provide this information to the
&lt;br&gt;programmer executing the test.
&lt;br&gt;&lt;br&gt;What I really want is a GUI that allows the programmer to select a
&lt;br&gt;failed test from a list of failed tests, and then to view supplemental
&lt;br&gt;test data I provide him/her.
&lt;br&gt;&lt;br&gt;I was thinking I could do this by completing the following tasks:
&lt;br&gt;&lt;br&gt;- Implementing the RunListener interface in JUnit.
&lt;br&gt;- Create an extension of Exception that could contain a HashMap of
&lt;br&gt;simple parameters and that would be passed to the constructor of a
&lt;br&gt;Failure object from within a test.
&lt;br&gt;- Creating Failure objects in my tests that contain the supplemental
&lt;br&gt;failrure data.
&lt;br&gt;- Passing these failure objects to my RunListener implementaiton.
&lt;br&gt;- Creating a FailureProcessor class that displays a GUI with the
&lt;br&gt;information in my RunListener implemenation to show the programmer
&lt;br&gt;executing my tests the supplemental failure data as described above.
&lt;br&gt;(FailureProcessor would be an interface so that you could do different
&lt;br&gt;things with the supplemental failure data, not just show it in a GUI.)
&lt;br&gt;&lt;br&gt;Before I begin this work, I wanted to ask if there was a better way to
&lt;br&gt;do this. I know I could use a logging framework from within my test
&lt;br&gt;method, but I really want to work within the JUnut framework, not
&lt;br&gt;outside of it. I also want a nice little GUI, not a log file.
&lt;br&gt;&lt;br&gt;How are other programmers handling instances when they want to display
&lt;br&gt;supplemental data on failed tests? Does my approach sound reasonable?
&lt;br&gt;&lt;br&gt;The Sunburned Surveyor
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Gathering-and-displaying-supplemental-information-about-test--failures.-tp26448853p26448853.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26446238</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-20T08:28:30Z</published>
	<updated>2009-11-20T08:28:30Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">On Thu, Nov 19, 2009 at 11:24 AM, jlinkyh &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26446238&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jl@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26446238&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, Kent Beck &amp;lt;kentb@...&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I'm with David on being intrigued by the idea of using arbitrary
&lt;br&gt;&amp;gt;&amp;gt; classes. However, I'm much more interested in experiences than in
&lt;br&gt;&amp;gt;&amp;gt; votes. If someone said, &amp;quot;I went through my code and I could
&lt;br&gt;&amp;gt;&amp;gt; definitely use classes as categories because of X, Y and/or Z,&amp;quot; would
&lt;br&gt;&amp;gt;&amp;gt; be compelling to me. Even more compelling is if someone would write
&lt;br&gt;&amp;gt;&amp;gt; the test cases for the new scheme.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Just skimmed through two of my OS projects. 80% of the test cases refer to a single class under test. For about 20% of those CUTs I have more than one test class; those could benefit most since the naming convention doesn't help to show the connection.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The follow-up question is: What would I do with this meta info?
&lt;/div&gt;&lt;br&gt;Some (many) people have asked for categories as a way of running only
&lt;br&gt;some of their tests, and our primary goal is to help them. &amp;nbsp;If you
&lt;br&gt;were ever tempted to run only the subset of your tests that shared
&lt;br&gt;some given CUT, this annotation strategy would let you do that. &amp;nbsp;Does
&lt;br&gt;that make your life better?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26446238.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26446089</id>
	<title>Re: An &quot;after all tests&quot; event</title>
	<published>2009-11-20T08:18:49Z</published>
	<updated>2009-11-20T08:18:49Z</updated>
	<author>
		<name>yme0987654321</name>
	</author>
	<content type="html">Stolsvik,
&lt;br&gt;&lt;br&gt;What you want (annotate some random class somewhere) isn't currently supported by JUnit (as far as I know).
&lt;br&gt;&lt;br&gt;But what you can do is make a suite. So you pick some random class somewhere and you annotated it with the @RunWith(Suite.class), add the class to the suite with @Suite.SuiteClasses annotation, and then on that class define a @BeforeClass and an @AfterClass method. Those @BeforeClass and @AfterClass methods will get run before and after all the other tests in the suite, respectively.
&lt;br&gt;&lt;br&gt;What you don't get from using this method is the nice convenient use of your IDE to just run all the tests. You have to put them together yourself. Right now in JUnit literally by specifying them, although David has promised some idea for allowing the Suite classes to be generated programatically.
&lt;br&gt;&lt;br&gt;In the mean time if you need something generated programatically, you can make a custom runner that extends Suite and pass an array of the classes that you construct programatically to the Suite constructor.
&lt;br&gt;&lt;br&gt;Even with this solution, you lose the ability to have your IDE just find all tests in the project, but since I need those tests run during the build anyway, that was not a loss for me.
&lt;br&gt;&lt;br&gt;--- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26446089&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, &amp;quot;stolsvik&amp;quot; &amp;lt;online@...&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Folks, thanks for your answers.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; --- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26446089&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, David Saff &amp;lt;david@&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Stolsvik,
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; You can use @BeforeClass and @AfterClass on a suite to get this
&lt;br&gt;&amp;gt; &amp;gt; behavior, in many circumstances.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Could you tell me directly, or point to some resource, of how I set that up? Your sentence didn't immediately ring understanding with me.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Basically, what I am requesting, is that I'd like to annotate some random method on some random class anywhere in the project with some annotation like @AfterTestRun - so that when I run either one single test class, or a package, or the entire project, with the Eclipse runner, this specific method would be invoked after the requested test(s) are run.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So: How do I accomplish that with &amp;quot;@AfterClass on a suite&amp;quot;?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Do I have to annotate all my test classes with some specific Suite-annotation? That would be doable. However, it would be just as awkward as I do with my logging init: Having to do some boilerplate bs on every single test class - only that forgetting to do this would not give me any immediate indication, as with the logging init; For the logging init, I immediately see if I have forgotten those three boilerplate lines (&amp;quot;static { TestHelper.setupLogging() }&amp;quot;), because log4j spews out some noise on Std.err if any part of the system starts to log on an uninitialized logging system.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; On Thu, Nov 19, 2009 at 7:09 AM, stolsvik &amp;lt;online@&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; I need some way to run a certain test after all other tests.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; I run my tests in Eclipse, and do not yet have a build system outside of it. I understand that had I done this programmatically, I could have attached a RunListener, implementing the testRunFinished(Result) method.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Is there any way to achieve a similar effect within the JUnit runner in Eclipse?
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Rationale: I have actual unit tests, then bigger tests, then full-fledged &amp;quot;integration tests&amp;quot; or whatever one call them, where I take up my entire application-local server thingy and process a bunch of items, letting JUnit check after the dust settles whether the items was processed correctly. However, the internals are multi threaded, and also, this being a Swing app, lots of Runnables are sent over to the EDT. This is all good.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; However, I've sometimes seen that a thread crashes (uncaught exception), without this being noticed by any of the tests running (I've e.g. seen a ConcurrentModificationException take down the EDT, without having a clue as to why I got that - and the next event posted just brings up a new EDT, so I get a green bar, but with an uncaught error). What I'd want to achieve, is to install an uncaught exception handler, and then, as a final step to ALL permutations of tests (e.g. both for a single unit test, and also for the project-wide test run), run a test that checks whether any thread-killing exception was caught by the handler, and if so, fails the run. (I'd throw the exception that was caught, and in any case also log-dump any and all such exceptions).
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; (As a very similar question, I'd also like to have a &amp;quot;before any tests&amp;quot; thing, like the RunListener.testRunStarted(Description) method, where I could set up logging. Now I do that by letting ALL tests have a static block that calls a specific static method which has a static boolean that tells whether the log system already is set up. This also works just nicely, but is a hassle nevertheless. However, it is not possible, as I see it, to solve the above question in the same manner.)
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; ------------------------------------
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26446089.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26443225</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-20T05:24:49Z</published>
	<updated>2009-11-20T05:24:49Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">All,
&lt;br&gt;&lt;br&gt;I can see that a short code snippet has been misleading about what our
&lt;br&gt;proposal makes easy, possible, and impossible. &amp;nbsp;I'll try to post a
&lt;br&gt;longer feature summary soon.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;br&gt;On Fri, Nov 20, 2009 at 3:24 AM, Bogdan
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26443225&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bogdan.mocanu.notifications@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I agree with Georg. I prefer an annotation where I can specify the subcategories where a test fits. Something like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; @Category( &amp;quot;database.mysql.local&amp;quot; )
&lt;br&gt;&amp;gt; public class MySQLDBTest {
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cons:
&lt;br&gt;&amp;gt; - allows for typos to happen
&lt;br&gt;&amp;gt; - no support from the IDE (this could be improvode if you define a list of constants in a class, such as DATABASE, DATABASE_MYSQL, DATABASE_MYSQL_LOCAL, etc)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Pros:
&lt;br&gt;&amp;gt; - allows for regex to be used when defining the Suites
&lt;br&gt;&amp;gt; - allows for hierarchies of categories.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The hierarchy of categories, I think, is the hardest part to implement with interfaces or base classes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Bogdan
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26443225&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, &amp;quot;Georg&amp;quot; &amp;lt;le_garcon_enerve@...&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Hi!
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Something like this is nice to have, but, I don't quite like the idea of the interface. I see the danger of having to introduce an unmanagable number of interfaces lurking around the corner. That the compiler does some checking is certainly appreciable, though.
&lt;br&gt;&amp;gt;&amp;gt; I this sense, I like the extension to Suite I proposed better (see &lt;a href=&quot;http://github.com/KentBeck/junit&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit&lt;/a&gt;), as it allows to name tests in a certain way and then use regexps to run them as groups. With very little effort, all tests (in a package), or class names matching some convention, can be run easily (it takes a bit of consistency in naming tests, though).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt;&amp;gt;    Georg
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26443225.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26443264</id>
	<title>Re: An &quot;after all tests&quot; event</title>
	<published>2009-11-20T05:18:09Z</published>
	<updated>2009-11-20T05:18:09Z</updated>
	<author>
		<name>Endre Stølsvik-6</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;br&gt;Folks, thanks for your answers.
&lt;br&gt;&lt;br&gt;--- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26443264&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, David Saff &amp;lt;david@...&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Stolsvik,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; You can use @BeforeClass and @AfterClass on a suite to get this
&lt;br&gt;&amp;gt; behavior, in many circumstances.
&lt;br&gt;&lt;br&gt;Could you tell me directly, or point to some resource, of how I set that up? Your sentence didn't immediately ring understanding with me.
&lt;br&gt;&lt;br&gt;Basically, what I am requesting, is that I'd like to annotate some random method on some random class anywhere in the project with some annotation like @AfterTestRun - so that when I run either one single test class, or a package, or the entire project, with the Eclipse runner, this specific method would be invoked after the requested test(s) are run.
&lt;br&gt;&lt;br&gt;So: How do I accomplish that with &amp;quot;@AfterClass on a suite&amp;quot;?
&lt;br&gt;&lt;br&gt;Do I have to annotate all my test classes with some specific Suite-annotation? That would be doable. However, it would be just as awkward as I do with my logging init: Having to do some boilerplate bs on every single test class - only that forgetting to do this would not give me any immediate indication, as with the logging init; For the logging init, I immediately see if I have forgotten those three boilerplate lines (&amp;quot;static { TestHelper.setupLogging() }&amp;quot;), because log4j spews out some noise on Std.err if any part of the system starts to log on an uninitialized logging system.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Thu, Nov 19, 2009 at 7:09 AM, stolsvik &amp;lt;online@...&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; I need some way to run a certain test after all other tests.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I run my tests in Eclipse, and do not yet have a build system outside of it. I understand that had I done this programmatically, I could have attached a RunListener, implementing the testRunFinished(Result) method.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Is there any way to achieve a similar effect within the JUnit runner in Eclipse?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Rationale: I have actual unit tests, then bigger tests, then full-fledged &amp;quot;integration tests&amp;quot; or whatever one call them, where I take up my entire application-local server thingy and process a bunch of items, letting JUnit check after the dust settles whether the items was processed correctly. However, the internals are multi threaded, and also, this being a Swing app, lots of Runnables are sent over to the EDT. This is all good.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; However, I've sometimes seen that a thread crashes (uncaught exception), without this being noticed by any of the tests running (I've e.g. seen a ConcurrentModificationException take down the EDT, without having a clue as to why I got that - and the next event posted just brings up a new EDT, so I get a green bar, but with an uncaught error). What I'd want to achieve, is to install an uncaught exception handler, and then, as a final step to ALL permutations of tests (e.g. both for a single unit test, and also for the project-wide test run), run a test that checks whether any thread-killing exception was caught by the handler, and if so, fails the run. (I'd throw the exception that was caught, and in any case also log-dump any and all such exceptions).
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; (As a very similar question, I'd also like to have a &amp;quot;before any tests&amp;quot; thing, like the RunListener.testRunStarted(Description) method, where I could set up logging. Now I do that by letting ALL tests have a static block that calls a specific static method which has a static boolean that tells whether the log system already is set up. This also works just nicely, but is a hassle nevertheless. However, it is not possible, as I see it, to solve the above question in the same manner.)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ------------------------------------
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26443264.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26439915</id>
	<title>Re: Categories in JUnit 4.8</title>
	<published>2009-11-20T00:24:33Z</published>
	<updated>2009-11-20T00:24:33Z</updated>
	<author>
		<name>Bogdan Mocanu-3</name>
	</author>
	<content type="html">I agree with Georg. I prefer an annotation where I can specify the subcategories where a test fits. Something like:
&lt;br&gt;&lt;br&gt;@Category( &amp;quot;database.mysql.local&amp;quot; )
&lt;br&gt;public class MySQLDBTest {
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;Cons:
&lt;br&gt;- allows for typos to happen
&lt;br&gt;- no support from the IDE (this could be improvode if you define a list of constants in a class, such as DATABASE, DATABASE_MYSQL, DATABASE_MYSQL_LOCAL, etc)
&lt;br&gt;&lt;br&gt;Pros:
&lt;br&gt;- allows for regex to be used when defining the Suites
&lt;br&gt;- allows for hierarchies of categories.
&lt;br&gt;&lt;br&gt;The hierarchy of categories, I think, is the hardest part to implement with interfaces or base classes.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Bogdan
&lt;br&gt;&lt;br&gt;--- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26439915&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, &amp;quot;Georg&amp;quot; &amp;lt;le_garcon_enerve@...&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Something like this is nice to have, but, I don't quite like the idea of the interface. I see the danger of having to introduce an unmanagable number of interfaces lurking around the corner. That the compiler does some checking is certainly appreciable, though.
&lt;br&gt;&amp;gt; I this sense, I like the extension to Suite I proposed better (see &lt;a href=&quot;http://github.com/KentBeck/junit&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit&lt;/a&gt;), as it allows to name tests in a certain way and then use regexps to run them as groups. With very little effort, all tests (in a package), or class names matching some convention, can be run easily (it takes a bit of consistency in naming tests, though).
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Cheers, 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;Georg
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26439915.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26432940</id>
	<title>Re: An &quot;after all tests&quot; event</title>
	<published>2009-11-19T11:48:58Z</published>
	<updated>2009-11-19T11:48:58Z</updated>
	<author>
		<name>Cédric Beust ♔</name>
	</author>
	<content type="html">On Thu, Nov 19, 2009 at 11:44 AM, David Saff &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26432940&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As synonyms for BeforeClass and AfterClass?
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;No, as wrappers of an entire test suite:
&lt;br&gt;&lt;br&gt;BeforeSuite
&lt;br&gt;BeforeClass
&lt;br&gt;...
&lt;br&gt;AfterClass
&lt;br&gt;BeforeClass
&lt;br&gt;AfterClass
&lt;br&gt;...
&lt;br&gt;AfterSuite
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;***Cédric
&lt;br&gt;*
&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26432940.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26432861</id>
	<title>Re: An &quot;after all tests&quot; event</title>
	<published>2009-11-19T11:45:18Z</published>
	<updated>2009-11-19T11:45:18Z</updated>
	<author>
		<name>yme0987654321</name>
	</author>
	<content type="html">Cedric,
&lt;br&gt;&lt;br&gt;That is what you get out of @BeforeClass and @AfterClass when you define them on the class with the @RunWith(Suite.class) annotation. It is the same effect.
&lt;br&gt;&lt;br&gt;Yishai
&lt;br&gt;&lt;br&gt;--- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26432861&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, CÃ©dric Beust â&amp;quot; &amp;lt;cbeust@...&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Thu, Nov 19, 2009 at 11:24 AM, David Saff &amp;lt;david@...&amp;gt; wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Stolsvik,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; You can use @BeforeClass and @AfterClass on a suite to get this
&lt;br&gt;&amp;gt; &amp;gt; behavior, in many circumstances.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; @BeforeSuite and @AfterSuite would be nice :-)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; ***Cédric
&lt;br&gt;&amp;gt; *
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26432861.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26432829</id>
	<title>Re: An &quot;after all tests&quot; event</title>
	<published>2009-11-19T11:44:12Z</published>
	<updated>2009-11-19T11:44:12Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">As synonyms for BeforeClass and AfterClass?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;br&gt;2009/11/19 Cédric Beust ♔ &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26432829&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cbeust@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Thu, Nov 19, 2009 at 11:24 AM, David Saff &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26432829&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Stolsvik,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; You can use @BeforeClass and @AfterClass on a suite to get this
&lt;br&gt;&amp;gt;&amp;gt; behavior, in many circumstances.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; @BeforeSuite and @AfterSuite would be nice :-)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; ***Cédric
&lt;br&gt;&amp;gt; *
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26432829.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26432656</id>
	<title>Re: An &quot;after all tests&quot; event</title>
	<published>2009-11-19T11:34:25Z</published>
	<updated>2009-11-19T11:34:25Z</updated>
	<author>
		<name>Cédric Beust ♔</name>
	</author>
	<content type="html">On Thu, Nov 19, 2009 at 11:24 AM, David Saff &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26432656&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Stolsvik,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You can use @BeforeClass and @AfterClass on a suite to get this
&lt;br&gt;&amp;gt; behavior, in many circumstances.
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;@BeforeSuite and @AfterSuite would be nice :-)
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;***Cédric
&lt;br&gt;*
&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26432656.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26432474</id>
	<title>Re: An &quot;after all tests&quot; event</title>
	<published>2009-11-19T11:24:25Z</published>
	<updated>2009-11-19T11:24:25Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">Stolsvik,
&lt;br&gt;&lt;br&gt;You can use @BeforeClass and @AfterClass on a suite to get this
&lt;br&gt;behavior, in many circumstances.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;br&gt;On Thu, Nov 19, 2009 at 7:09 AM, stolsvik &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26432474&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;online@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I need some way to run a certain test after all other tests.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I run my tests in Eclipse, and do not yet have a build system outside of it. I understand that had I done this programmatically, I could have attached a RunListener, implementing the testRunFinished(Result) method.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Is there any way to achieve a similar effect within the JUnit runner in Eclipse?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Rationale: I have actual unit tests, then bigger tests, then full-fledged &amp;quot;integration tests&amp;quot; or whatever one call them, where I take up my entire application-local server thingy and process a bunch of items, letting JUnit check after the dust settles whether the items was processed correctly. However, the internals are multi threaded, and also, this being a Swing app, lots of Runnables are sent over to the EDT. This is all good.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, I've sometimes seen that a thread crashes (uncaught exception), without this being noticed by any of the tests running (I've e.g. seen a ConcurrentModificationException take down the EDT, without having a clue as to why I got that - and the next event posted just brings up a new EDT, so I get a green bar, but with an uncaught error). What I'd want to achieve, is to install an uncaught exception handler, and then, as a final step to ALL permutations of tests (e.g. both for a single unit test, and also for the project-wide test run), run a test that checks whether any thread-killing exception was caught by the handler, and if so, fails the run. (I'd throw the exception that was caught, and in any case also log-dump any and all such exceptions).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; (As a very similar question, I'd also like to have a &amp;quot;before any tests&amp;quot; thing, like the RunListener.testRunStarted(Description) method, where I could set up logging. Now I do that by letting ALL tests have a static block that calls a specific static method which has a static boolean that tells whether the log system already is set up. This also works just nicely, but is a hassle nevertheless. However, it is not possible, as I see it, to solve the above question in the same manner.)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26432474.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26431397</id>
	<title>Re: Categories in JUnit 4.8</title>
	<published>2009-11-19T10:21:03Z</published>
	<updated>2009-11-19T10:21:03Z</updated>
	<author>
		<name>yme0987654321</name>
	</author>
	<content type="html">Well, of course the feature already has my vote ;), but in terms of concrete code, sure.
&lt;br&gt;&lt;br&gt;I have an DAOBase for the general persistence classes, and then specific DAOBase implementations for their respective DataObject.
&lt;br&gt;&lt;br&gt;So I could certainly see categorizing all general persistence tests to be about DAOBase and specific tests to be categorized according to the specific subclass that they exercise.
&lt;br&gt;&lt;br&gt;In addition, in certain hairy parts of the data model, the DAOBase subclass has itself subclasses, allowing me to categorize tests according to that area.
&lt;br&gt;&lt;br&gt;The advantage of such categories is that since all of the relevant tests on these are slow (they actually hit the database), I could test a specific area I'm working on before check-in in a reasonable time, and then rely on the build server to run everything after check in just in case, without a long wait (currently the tests take over an hour on the Build server).
&lt;br&gt;&lt;br&gt;Of course I could make my own arbitrary categories, whether interfaces or Strings, but it is just a parallel duplicate system. Or I could implement the JUnit interface on DAOBase, introducing a JUnit dependency I would rather not have on production code, and get the same effect.
&lt;br&gt;&lt;br&gt;In terms of a test case, I'd be happy to put one together, but I'm just not fully sure what you are looking for. The real value would seem to be shown in having a real class hierarchy that fits well, more than in just demonstrating it with a hypothetical test hierarchy. So the question is what characteristics would such a test have that would be compelling for you?
&lt;br&gt;&lt;br&gt;--- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26431397&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, Kent Beck &amp;lt;kentb@...&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm with David on being intrigued by the idea of using arbitrary classes. However, I'm much more interested in experiences than in votes. If someone said, &amp;quot;I went through my code and I could definitely use classes as categories because of X, Y and/or Z,&amp;quot; would be compelling to me. Even more compelling is if someone would write the test cases for the new scheme.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Kent
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Nov 19, 2009, at 7:33 AM, David Saff wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; On Wed, Nov 18, 2009 at 7:46 PM, yme0987654321 &amp;lt;yme0987654321@...&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; The decision to use types to define categories is definitely surprising to see, so that has to count against it.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; However, after the initial shock wears off, I definitely see the power in it, using Java inheritance and static checking rather than free form strings and some arbitrary hierarchy delimiter in the string.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; However, I think the decision to use a specific new interface as the super type is not a good idea. It would seem you gain the same power by allowing any Class&amp;lt;?&amp;gt;. The advantage of doing this is it would allow real classes within the project to act as Categories, so that if, for example, I am testing a DAO framework, I can categorize individual tests with the specific DAO subclass they are targeting, and then run a category based on the DAO supertype. Much nicer than just calling it all SlowTests. In practice that won't happen often if a custom interface is required because it will introduce a dependency on a JUnit type in the production code.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; Huh. The first time through, I thought &amp;quot;that's ridiculous&amp;quot;. The
&lt;br&gt;&amp;gt; &amp;gt; second time, I wondered if there's not something to this...
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; Totally musing out loud, but you could rename the annotation as
&lt;br&gt;&amp;gt; &amp;gt; TestOf, so that you'd have
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; @TestOf(CustomStreamingPlatform.class)
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; Hmm...
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; I'm also curious if you considered using an annotation as the category? That is having the category take a Class&amp;lt;?&amp;gt; that represents an annotation? You could support meta-annotations to allow a hierarchy of categories as well as supporting any subclasses or implementations of types so annotated. Coding for that would be nasty business, but it wouldn't be complicated from a client point of view, and would allow the same flexibility of inheritance without the dependency on a JUnit type.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I wanted to stay away from meta-annotations unless the reasons were
&lt;br&gt;&amp;gt; &amp;gt; _really_ compelling.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; I would prefer just an arbitrary Class&amp;lt;?&amp;gt;, though. Inheritance is well understood by any Java programmer (unlike meta-annotations) and opens up a synergy between the category hierarchy and the code hierarchy.
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; Can I get another vote on this extension idea?
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; David
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; [Non-text portions of this message have been removed]
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26431397.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26430795</id>
	<title>RE: Categories in JUnit 4.8</title>
	<published>2009-11-19T09:45:30Z</published>
	<updated>2009-11-19T09:45:30Z</updated>
	<author>
		<name>Pigneri, Rocco-2</name>
	</author>
	<content type="html">&amp;gt;To my way of thinking, categories should be handled by the IDE--they are meta-data
&lt;br&gt;&amp;gt;that belongs with the test runner, not with the tests themselves. Since IDEs don't
&lt;br&gt;&amp;gt;provide a good solution to running subsets of tests, we can add some value by *an*
&lt;br&gt;&amp;gt;implementation.
&lt;br&gt;&lt;br&gt;I am sure that you guys spent a lot of time debating this point back in the day, but I would like to point out that this is one of the hidden drawbacks of not providing your own graphical test runner. &amp;nbsp;With your own test runner, users could evaluate new features quickly and easily and then apply pressure to their IDE's to provide support, thus expanding your user base.
&lt;br&gt;&lt;br&gt;Also, it does help those of us who prefer Emacs over Eclipse feel a little less left out in the cold :-).
&lt;br&gt;&lt;br&gt;Rocco
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;br&gt;From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26430795&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt; [mailto:&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26430795&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;] On Behalf Of Kent Beck
&lt;br&gt;Sent: Tuesday, November 17, 2009 4:44 PM
&lt;br&gt;To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26430795&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;
&lt;br&gt;Subject: Re: [junit] Categories in JUnit 4.8
&lt;br&gt;&lt;br&gt;Malte,
&lt;br&gt;&lt;br&gt;Thank you for the question. We went back and forth on this. The two positive features of using interfaces as &amp;quot;tags&amp;quot; is that the compiler can check them and inheritance works. The need for otherwise useless interfaces is the cost of this decision.
&lt;br&gt;&lt;br&gt;To my way of thinking, categories should be handled by the IDE--they are meta-data that belongs with the test runner, not with the tests themselves. Since IDEs don't provide a good solution to running subsets of tests, we can add some value by *an* implementation.
&lt;br&gt;&lt;br&gt;That said, we are open to changing to strings if experience shows that the interface-based categories don't work in practice.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;Kent
&lt;br&gt;&lt;br&gt;On Nov 17, 2009, at 1:34 PM, Malte Finsterwalder wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Hi David,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Why are the categories interfaces? I don't really like, that I have to
&lt;br&gt;&amp;gt; create empty interfaces. Would it be easier to use strings? Even
&lt;br&gt;&amp;gt; though this opens up the possibilites for typos.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Greetings,
&lt;br&gt;&amp;gt; Malte
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------
&lt;br&gt;&lt;br&gt;Yahoo! Groups Links
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26430795.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26429345</id>
	<title>Re: Categories in JUnit 4.8</title>
	<published>2009-11-19T08:24:51Z</published>
	<updated>2009-11-19T08:24:51Z</updated>
	<author>
		<name>Johannes Link-2</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;--- In &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26429345&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit@...&lt;/a&gt;, Kent Beck &amp;lt;kentb@...&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm with David on being intrigued by the idea of using arbitrary 
&lt;br&gt;&amp;gt; classes. However, I'm much more interested in experiences than in 
&lt;br&gt;&amp;gt; votes. If someone said, &amp;quot;I went through my code and I could 
&lt;br&gt;&amp;gt; definitely use classes as categories because of X, Y and/or Z,&amp;quot; would 
&lt;br&gt;&amp;gt; be compelling to me. Even more compelling is if someone would write 
&lt;br&gt;&amp;gt; the test cases for the new scheme.
&lt;br&gt;&lt;br&gt;Just skimmed through two of my OS projects. 80% of the test cases refer to a single class under test. For about 20% of those CUTs I have more than one test class; those could benefit most since the naming convention doesn't help to show the connection. 
&lt;br&gt;&lt;br&gt;The follow-up question is: What would I do with this meta info?
&lt;br&gt;&lt;br&gt;Johannes
&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26429345.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26429064</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-19T08:10:56Z</published>
	<updated>2009-11-19T08:10:56Z</updated>
	<author>
		<name>Malte Finsterwalder-2</name>
	</author>
	<content type="html">2009/11/19 Kent Beck &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26429064&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kentb@...&lt;/a&gt;&amp;gt;:
&lt;br&gt;&amp;gt; I'm with David on being intrigued by the idea of using arbitrary classes. However, I'm much more interested in experiences than in votes. If someone said, &amp;quot;I went through my code and I could definitely use classes as categories because of X, Y and/or Z,&amp;quot; would be compelling to me. Even more compelling is if someone would write the test cases for the new scheme.
&lt;br&gt;&lt;br&gt;In my corrent codebase I could think of something like this:
&lt;br&gt;&lt;br&gt;Some of our tests use a class &amp;quot;PersistentTestSupport&amp;quot;, that helps in
&lt;br&gt;setting up tests that use a database.
&lt;br&gt;I could use the same class as a marker for tests that need persistence
&lt;br&gt;and are as such slower.
&lt;br&gt;&lt;br&gt;Greetings,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Malte
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26429064.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26428889</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-19T08:02:03Z</published>
	<updated>2009-11-19T08:02:03Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">Georg,
&lt;br&gt;&lt;br&gt;Can you recheck that URL? &amp;nbsp;The one you sent just points to the junit
&lt;br&gt;home page on github.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David Saff
&lt;br&gt;&lt;br&gt;On Wed, Nov 18, 2009 at 9:32 PM, Georg &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26428889&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;le_garcon_enerve@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Something like this is nice to have, but, I don't quite like the idea of the interface. I see the danger of having to introduce an unmanagable number of interfaces lurking around the corner. That the compiler does some checking is certainly appreciable, though.
&lt;br&gt;&amp;gt; I this sense, I like the extension to Suite I proposed better (see &lt;a href=&quot;http://github.com/KentBeck/junit&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/KentBeck/junit&lt;/a&gt;), as it allows to name tests in a certain way and then use regexps to run them as groups. With very little effort, all tests (in a package), or class names matching some convention, can be run easily (it takes a bit of consistency in naming tests, though).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt;   Georg
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26428889.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26428401</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-19T07:38:51Z</published>
	<updated>2009-11-19T07:38:51Z</updated>
	<author>
		<name>kentb</name>
	</author>
	<content type="html">I'm with David on being intrigued by the idea of using arbitrary classes. However, I'm much more interested in experiences than in votes. If someone said, &amp;quot;I went through my code and I could definitely use classes as categories because of X, Y and/or Z,&amp;quot; would be compelling to me. Even more compelling is if someone would write the test cases for the new scheme.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&lt;br&gt;Kent
&lt;br&gt;&lt;br&gt;On Nov 19, 2009, at 7:33 AM, David Saff wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Nov 18, 2009 at 7:46 PM, yme0987654321 &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26428401&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yme0987654321@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; The decision to use types to define categories is definitely surprising to see, so that has to count against it.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; However, after the initial shock wears off, I definitely see the power in it, using Java inheritance and static checking rather than free form strings and some arbitrary hierarchy delimiter in the string.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; However, I think the decision to use a specific new interface as the super type is not a good idea. It would seem you gain the same power by allowing any Class&amp;lt;?&amp;gt;. The advantage of doing this is it would allow real classes within the project to act as Categories, so that if, for example, I am testing a DAO framework, I can categorize individual tests with the specific DAO subclass they are targeting, and then run a category based on the DAO supertype. Much nicer than just calling it all SlowTests. In practice that won't happen often if a custom interface is required because it will introduce a dependency on a JUnit type in the production code.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Huh. The first time through, I thought &amp;quot;that's ridiculous&amp;quot;. The
&lt;br&gt;&amp;gt; second time, I wondered if there's not something to this...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Totally musing out loud, but you could rename the annotation as
&lt;br&gt;&amp;gt; TestOf, so that you'd have
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; @TestOf(CustomStreamingPlatform.class)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hmm...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I'm also curious if you considered using an annotation as the category? That is having the category take a Class&amp;lt;?&amp;gt; that represents an annotation? You could support meta-annotations to allow a hierarchy of categories as well as supporting any subclasses or implementations of types so annotated. Coding for that would be nasty business, but it wouldn't be complicated from a client point of view, and would allow the same flexibility of inheritance without the dependency on a JUnit type.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I wanted to stay away from meta-annotations unless the reasons were
&lt;br&gt;&amp;gt; _really_ compelling.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; I would prefer just an arbitrary Class&amp;lt;?&amp;gt;, though. Inheritance is well understood by any Java programmer (unlike meta-annotations) and opens up a synergy between the category hierarchy and the code hierarchy.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Can I get another vote on this extension idea?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; David
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;[Non-text portions of this message have been removed]
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;------------------------------------
&lt;br&gt;&lt;br&gt;Yahoo! Groups Links
&lt;br&gt;&lt;br&gt;&amp;lt;*&amp;gt; To visit your group on the web, go to:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://groups.yahoo.com/group/junit/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://groups.yahoo.com/group/junit/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;lt;*&amp;gt; Your email settings:
&lt;br&gt;&amp;nbsp; &amp;nbsp; Individual Email | Traditional
&lt;br&gt;&lt;br&gt;&amp;lt;*&amp;gt; To change settings online go to:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://groups.yahoo.com/group/junit/join&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://groups.yahoo.com/group/junit/join&lt;/a&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; (Yahoo! ID required)
&lt;br&gt;&lt;br&gt;&amp;lt;*&amp;gt; To change settings via email:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26428401&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit-digest@...&lt;/a&gt; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26428401&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit-fullfeatured@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&amp;lt;*&amp;gt; To unsubscribe from this group, send an email to:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26428401&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;junit-unsubscribe@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&amp;lt;*&amp;gt; Your use of Yahoo! Groups is subject to:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://docs.yahoo.com/info/terms/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://docs.yahoo.com/info/terms/&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26428401.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26428321</id>
	<title>Re: Re: Categories in JUnit 4.8</title>
	<published>2009-11-19T07:33:13Z</published>
	<updated>2009-11-19T07:33:13Z</updated>
	<author>
		<name>David Saff</name>
	</author>
	<content type="html">On Wed, Nov 18, 2009 at 7:46 PM, yme0987654321 &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26428321&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;yme0987654321@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; The decision to use types to define categories is definitely surprising to see, so that has to count against it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, after the initial shock wears off, I definitely see the power in it, using Java inheritance and static checking rather than free form strings and some arbitrary hierarchy delimiter in the string.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; However, I think the decision to use a specific new interface as the super type is not a good idea. It would seem you gain the same power by allowing any Class&amp;lt;?&amp;gt;. The advantage of doing this is it would allow real classes within the project to act as Categories, so that if, for example, I am testing a DAO framework, I can categorize individual tests with the specific DAO subclass they are targeting, and then run a category based on the DAO supertype. Much nicer than just calling it all SlowTests. In practice that won't happen often if a custom interface is required because it will introduce a dependency on a JUnit type in the production code.
&lt;br&gt;&lt;br&gt;Huh. &amp;nbsp;The first time through, I thought &amp;quot;that's ridiculous&amp;quot;. &amp;nbsp;The
&lt;br&gt;second time, I wondered if there's not something to this...
&lt;br&gt;&lt;br&gt;Totally musing out loud, but you could rename the annotation as
&lt;br&gt;TestOf, so that you'd have
&lt;br&gt;&lt;br&gt;@TestOf(CustomStreamingPlatform.class)
&lt;br&gt;&lt;br&gt;Hmm...
&lt;br&gt;&lt;br&gt;&amp;gt; I'm also curious if you considered using an annotation as the category? That is having the category take a Class&amp;lt;?&amp;gt; that represents an annotation? You could support meta-annotations to allow a hierarchy of categories as well as supporting any subclasses or implementations of types so annotated. Coding for that would be nasty business, but it wouldn't be complicated from a client point of view, and would allow the same flexibility of inheritance without the dependency on a JUnit type.
&lt;br&gt;&lt;br&gt;I wanted to stay away from meta-annotations unless the reasons were
&lt;br&gt;_really_ compelling.
&lt;br&gt;&lt;br&gt;&amp;gt; I would prefer just an arbitrary Class&amp;lt;?&amp;gt;, though. Inheritance is well understood by any Java programmer (unlike meta-annotations) and opens up a synergy between the category hierarchy and the code hierarchy.
&lt;br&gt;&lt;br&gt;Can I get another vote on this extension idea?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;David
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Categories-in-JUnit-4.8-tp26395582p26428321.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26431314</id>
	<title>An &quot;after all tests&quot; event</title>
	<published>2009-11-19T04:09:37Z</published>
	<updated>2009-11-19T04:09:37Z</updated>
	<author>
		<name>Endre Stølsvik-6</name>
	</author>
	<content type="html">I need some way to run a certain test after all other tests.
&lt;br&gt;&lt;br&gt;I run my tests in Eclipse, and do not yet have a build system outside of it. I understand that had I done this programmatically, I could have attached a RunListener, implementing the testRunFinished(Result) method.
&lt;br&gt;&lt;br&gt;Is there any way to achieve a similar effect within the JUnit runner in Eclipse?
&lt;br&gt;&lt;br&gt;Rationale: I have actual unit tests, then bigger tests, then full-fledged &amp;quot;integration tests&amp;quot; or whatever one call them, where I take up my entire application-local server thingy and process a bunch of items, letting JUnit check after the dust settles whether the items was processed correctly. However, the internals are multi threaded, and also, this being a Swing app, lots of Runnables are sent over to the EDT. This is all good.
&lt;br&gt;&lt;br&gt;However, I've sometimes seen that a thread crashes (uncaught exception), without this being noticed by any of the tests running (I've e.g. seen a ConcurrentModificationException take down the EDT, without having a clue as to why I got that - and the next event posted just brings up a new EDT, so I get a green bar, but with an uncaught error). What I'd want to achieve, is to install an uncaught exception handler, and then, as a final step to ALL permutations of tests (e.g. both for a single unit test, and also for the project-wide test run), run a test that checks whether any thread-killing exception was caught by the handler, and if so, fails the run. (I'd throw the exception that was caught, and in any case also log-dump any and all such exceptions).
&lt;br&gt;&lt;br&gt;(As a very similar question, I'd also like to have a &amp;quot;before any tests&amp;quot; thing, like the RunListener.testRunStarted(Description) method, where I could set up logging. Now I do that by letting ALL tests have a static block that calls a specific static method which has a static boolean that tells whether the log system already is set up. This also works just nicely, but is a hassle nevertheless. However, it is not possible, as I see it, to solve the above question in the same manner.)
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/An-%22after-all-tests%22-event-tp26431314p26431314.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26422338</id>
	<title>Re: Any way to multi-thread tests?</title>
	<published>2009-11-19T00:18:13Z</published>
	<updated>2009-11-19T00:18:13Z</updated>
	<author>
		<name>Malte Finsterwalder-2</name>
	</author>
	<content type="html">Just to give you another idea to think about:
&lt;br&gt;&lt;br&gt;Is it possible to simulate time and speed up the tests that way?
&lt;br&gt;&lt;br&gt;Just a simple idea: Replace new Date() with something like
&lt;br&gt;TimeServer.now() and make that configurable.
&lt;br&gt;Or can you explicitly call the mark-logik, so it's not time dependent?
&lt;br&gt;Or alike?
&lt;br&gt;&lt;br&gt;Greetings,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Malte
&lt;br&gt;&lt;br&gt;2009/11/19 Pat Farrell &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26422338&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pfarrell@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I've got a suite of tests for assorted classes, and its all working
&lt;br&gt;&amp;gt; fine. except it takes too long. By clock, not by resources.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; One of the classes I'm testing is a working set cache, and in order to
&lt;br&gt;&amp;gt; test it, you have to wait until a cycle or two have gone by to let the
&lt;br&gt;&amp;gt; mark logic work.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This takes a long time, during which the main JUnit test is just doing a
&lt;br&gt;&amp;gt; Thread.sleep(bignumber);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What I'd love to do is start the cache testing code, and then continue
&lt;br&gt;&amp;gt; with other tests that are not time dependant while the cache test is
&lt;br&gt;&amp;gt; doing the big sleep();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It would not be hard to use Java's concurancy tests to resync things,
&lt;br&gt;&amp;gt; but I don't have any idea if, or how, to get subsequent tests to fire off.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Is this possible?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks
&lt;br&gt;&amp;gt; Pat
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Pat Farrell
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.pfarrell.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.pfarrell.com/&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Yahoo! Groups Links
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Any-way-to-multi-thread-tests--tp26420379p26422338.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26420379</id>
	<title>Any way to multi-thread tests?</title>
	<published>2009-11-18T20:49:26Z</published>
	<updated>2009-11-18T20:49:26Z</updated>
	<author>
		<name>Pat Farrell</name>
	</author>
	<content type="html">I've got a suite of tests for assorted classes, and its all working
&lt;br&gt;fine. except it takes too long. By clock, not by resources.
&lt;br&gt;&lt;br&gt;One of the classes I'm testing is a working set cache, and in order to
&lt;br&gt;test it, you have to wait until a cycle or two have gone by to let the
&lt;br&gt;mark logic work.
&lt;br&gt;&lt;br&gt;This takes a long time, during which the main JUnit test is just doing a
&lt;br&gt;Thread.sleep(bignumber);
&lt;br&gt;&lt;br&gt;What I'd love to do is start the cache testing code, and then continue
&lt;br&gt;with other tests that are not time dependant while the cache test is
&lt;br&gt;doing the big sleep();
&lt;br&gt;&lt;br&gt;It would not be hard to use Java's concurancy tests to resync things,
&lt;br&gt;but I don't have any idea if, or how, to get subsequent tests to fire off.
&lt;br&gt;&lt;br&gt;Is this possible?
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;Pat
&lt;br&gt;-- 
&lt;br&gt;Pat Farrell
&lt;br&gt;&lt;a href=&quot;http://www.pfarrell.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.pfarrell.com/&lt;/a&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Any-way-to-multi-thread-tests--tp26420379p26420379.html" />
</entry>

</feed>
