<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>surefire-dev@maven.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/"/>
<id>http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/</id>
<updated>2009-12-08T12:28:52Z</updated>
<entry>
<title>Re: Concurrent Junit (SUREFIRE-555)</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200910.mbox/%3calpine.WNT.2.00.0910072104020.5896@danfabulich.rf.lan%3e"/>
<id>urn:uuid:%3calpine-WNT-2-00-0910072104020-5896@danfabulich-rf-lan%3e</id>
<updated>2009-10-08T04:04:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I think this list is no longer in use.  Instead just use the main 
maven-dev list.

-Dan



</pre>
</div>
</content>
</entry>
<entry>
<title>Concurrent Junit (SUREFIRE-555)</title>
<author><name>Kristian Rosenvold &lt;kristian.rosenvold@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200910.mbox/%3c42a010a60910071330q46031083y5af13976bc009c00@mail.gmail.com%3e"/>
<id>urn:uuid:%3c42a010a60910071330q46031083y5af13976bc009c00@mail-gmail-com%3e</id>
<updated>2009-10-07T20:30:37Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I am the author of the patches in
http://jira.codehaus.org/browse/SUREFIRE-555. I was wondering if anyone
would have the time to review this patch and hopefully accept it for
inclusion in surefire. I am more than willing to make further adjustments if
necessary.

The patch initially had some external dependencies that were a bit
complicated, and these have been removed.

The only known issue with this patch at the moment is that the execution
times for the tests are totally incorrect. This will require a bigger
rewrite of the reporting module. (I can do this as a separate patch if
needed, but this patch is large enough already)

Regards,

Kristian Rosenvold


</pre>
</div>
</content>
</entry>
<entry>
<title>Surefilre configuration in profile won't override testSourceDirectory</title>
<author><name>vicki &lt;vicki_kozel@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200807.mbox/%3c18492320.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c18492320-post@talk-nabble-com%3e</id>
<updated>2008-07-16T17:15:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi,
I have a test integration profile in the project's main pom, where I am
trying to override the testSourceDirectory specified in the project tag. The
surefire ignores the new value of the testSourceDirectory. Please, help.
Vicki
-- 
View this message in context: http://www.nabble.com/Surefilre-configuration-in-profile-won%27t-override-testSourceDirectory-tp18492320p18492320.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Surefire reports on Junit Parameterized tests</title>
<author><name>vicki &lt;vicki_kozel@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200807.mbox/%3c18412308.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c18412308-post@talk-nabble-com%3e</id>
<updated>2008-07-11T20:50:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi,
I am using surefire to run Junit's 4.x parametrerized tests. Surefire
reports them as 1 test. If one test out of the parameterized bundle fails -
Surefire fails the entire encapsulating test. Is there a way to set the
Surefire in such a way that it reports all the parameterized tests?
Thanks,
Vicki
-- 
View this message in context: http://www.nabble.com/Surefire-reports-on-Junit-Parameterized-tests-tp18412308p18412308.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: TestNG @BeforeMethod not working on subclasses.</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3calpine.WNT.1.00.0802111135081.6044@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3calpine-WNT-1-00-0802111135081-6044@sfeng02-rf-lan%3e</id>
<updated>2008-02-11T19:39:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
roadtripryan wrote:

&gt; I am trying to test using TestNG/Spring/ and Maven Surefire 2.4.1.
&gt;
&gt; My test suite runs great from within eclipse as individual tests or as a
&gt; whole suite. When I try and run the tests in Maven Surefire, however, they
&gt; fail. It appears Surefire is not calling the correct @BeforeMethod method.
&gt; (When running the whole suite, or an individual test.)

As you might expect, all Surefire does is call TestNG directly; we don't 
directly call @BeforeMethod, @Test, etc.

&gt; From testing it, it seems Surefire calls the @BeforeMethod in the base
&gt; class, but not in extending classes if they override it. I am extending
&gt; Springs AbstractTestNGSpringContextTests, and it is calling the base class
&gt; methods, not my extending classes @BeforeMethod and @AfterMethod.
&gt; Interestingly, it seems to call the correct @BeforeClass method.

If you're having a problem with a TestNG test that you believe should be 
working, please file a bug on jira.codehaus.org; please also attach a 
minimal Maven project that reproduces the problem.  Ideally a test like 
this should be nothing more than a pom.xml file and a couple of TestNG 
classes in appropriate directories.  (Please don't include any spring 
classes in this test case unless it's absolutely necessary to do so.)

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>TestNG @BeforeMethod not working on subclasses.</title>
<author><name>roadtripryan &lt;rcornia@myriad.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3c15418799.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15418799-post@talk-nabble-com%3e</id>
<updated>2008-02-11T19:30:16Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I am trying to test using TestNG/Spring/ and Maven Surefire 2.4.1. 

My test suite runs great from within eclipse as individual tests or as a
whole suite. When I try and run the tests in Maven Surefire, however, they
fail. It appears Surefire is not calling the correct @BeforeMethod method.
(When running the whole suite, or an individual test.)

&gt;From testing it, it seems Surefire calls the @BeforeMethod in the base
class, but not in extending classes if they override it. I am extending
Springs AbstractTestNGSpringContextTests, and it is calling the base class
methods, not my extending classes @BeforeMethod and @AfterMethod.
Interestingly, it seems to call the correct @BeforeClass method. 

Any ideas?

-- 
View this message in context: http://www.nabble.com/TestNG-%40BeforeMethod-not-working-on-subclasses.-tp15418799p15418799.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: testng, surefire, and forkMode=always</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3c15324832.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15324832-post@talk-nabble-com%3e</id>
<updated>2008-02-07T00:15:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


brettporter wrote:
&gt; 
&gt; I don't know why people even use it with JUnit
&gt; 
I am not really after forking all my tests, they already take long enough...
As Dan already guessed, I was more after a way to hack me through to
single-class test-suites. If forkMode=always would have worked, I would have
argued, "well, I want this behavior but without the JVM forking, please" ;-)


Benjamin Bentmann


-- 
View this message in context: http://www.nabble.com/testng%2C-surefire%2C-and-forkMode%3Dalways-tp15323782p15324832.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: testng, surefire, and forkMode=always</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3c15324776.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15324776-post@talk-nabble-com%3e</id>
<updated>2008-02-07T00:10:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


dfabulich wrote:
&gt; 
&gt; What should I do here?  Put in the hack and let the user figure out the 
&gt; TestNGException if they try to use multi-class dependent methods?
Please, give us the exception from TestNG if the setup is invalid, give us
the mere test results if the setup is valid because no inter-class
dependencies exist. I mean somebody who can setup a config file for a build
tool is smart enough to figure out what an exception means or do you
disagree? Just in case, a few lines of doc about the forkMode=always setting
should successfully shield Surefire from users filling in unjustified
issues.

To me, it seems this discussion is primarily concerned about making Surefire
bullet-proof against bad user config. As for me, I have this slightly
arrogant attitude to feel superior to a machine and hence always feel kind
of angry if a program wants to tell what I should better not do because it
might fail.


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/testng%2C-surefire%2C-and-forkMode%3Dalways-tp15323782p15324776.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [testng-users] testng, surefire, and forkMode=always</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3c15324537.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15324537-post@talk-nabble-com%3e</id>
<updated>2008-02-06T23:52:42Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


CÃ©dric Beust â™” wrote:
&gt; 
&gt; Creating a TestNG instance for every @Test method?  Seems completely
&gt; useless
&gt; to me.
&gt; 

The intent is not to fork once per test method but once per test class. Just
like I can say in the TestNG Eclipse plugin "run class XY" instead of
selecting a group.


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/testng%2C-surefire%2C-and-forkMode%3Dalways-tp15323782p15324537.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: testng, surefire, and forkMode=always</title>
<author><name>Brett Porter &lt;brett@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3cCA004DB9-C0A9-4DE0-B449-B05A5794CDFA@apache.org%3e"/>
<id>urn:uuid:%3cCA004DB9-C0A9-4DE0-B449-B05A5794CDFA@apache-org%3e</id>
<updated>2008-02-06T23:08:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
My inclination would be towards just an error that says its not  
supported under TestNG.

I don't know why people even use it with JUnit, except when they have  
memory leaks in their tests, or tests that affect the state of the JVM  
that they don't tear down :)

- Brett

On 07/02/2008, at 9:59 AM, Dan Fabulich wrote:

&gt;
&gt; Benjamin Bentmann has filed bug SUREFIRE-446 http://jira.codehaus.org/browse/SUREFIRE-446
&gt;
&gt; Maven Surefire provides a facility for various "fork modes":
&gt;
&gt; * forkMode=once: The default mode, spawns a separate TestNG process  
&gt; (like the TestNG Ant task)
&gt;
&gt; * forkMode=never: run TestNG in the same process as Maven, in an  
&gt; isolated classloader
&gt;
&gt; * forkMode=always: launch TestNG N times for N tests; if one test  
&gt; segfaults or calls System.exit or something, the other tests can run  
&gt; to completion safely.
&gt;
&gt; I didn't test forkMode=always with TestNG in Surefire 2.4, and sure  
&gt; enough it doesn't work at all.  (It runs the tests but reports 0  
&gt; tests passed/failed.)
&gt;
&gt; It does work basically OK for JUnit, where classes are normally  
&gt; isolated from each other, but I'm not sure it even makes sense for  
&gt; TestNG tests, where one test may depend on tests in other classes  
&gt; (multi-class dependent methods).
&gt;
&gt; I can kind of hack it so it works OK if you don't have multi-class  
&gt; dependent methods, but if you DO have multi-class dependent methods,  
&gt; it fails with a TestNGException: "MyTest.testFoo() is depending on  
&gt; nonexistent method otherClassSetUp".
&gt;
&gt; What should I do here?  Put in the hack and let the user figure out  
&gt; the TestNGException if they try to use multi-class dependent  
&gt; methods?  Fail with a clean error if the user tries to use  
&gt; forkMode=always with TestNG? Something else?
&gt;
&gt; Should forkMode=always be a feature of TestNG somehow?
&gt;
&gt; -Dan



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [testng-users] Re: testng, surefire, and forkMode=always</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3cPine.WNT.4.64.0802061506110.2808@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0802061506110-2808@sfeng02-rf-lan%3e</id>
<updated>2008-02-06T23:07:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
CÃ©dric Beust â™” wrote:

&gt; Creating a TestNG instance for every @Test method?  Seems completely useless
&gt; to me.

No, once for every test class.

&gt; Especially when you can control the threading behavior with the parallel
&gt; attribute.

Well, the point is crash protection, not threading.  (Also, Benjamin would 
like to keep separate XML files for every class, separate stdout files for 
every class, etc.)

-Dan

</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [testng-users] testng, surefire, and forkMode=always</title>
<author><name>&quot;=?UTF-8?Q?C=C3=A9dric_Beust_=E2=99=94?=&quot; &lt;cbeust@google.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3cb86b6a9c0802061504r858feedr759f83a19dfaaab7@mail.gmail.com%3e"/>
<id>urn:uuid:%3cb86b6a9c0802061504r858feedr759f83a19dfaaab7@mail-gmail-com%3e</id>
<updated>2008-02-06T23:04:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Creating a TestNG instance for every @Test method?  Seems completely useless
to me.

Especially when you can control the threading behavior with the parallel
attribute.

-- 
Cédric


On Wed, Feb 6, 2008 at 2:59 PM, Dan Fabulich &lt;dan@fabulich.com&gt; wrote:

&gt;
&gt;
&gt; Benjamin Bentmann has filed bug SUREFIRE-446
&gt; http://jira.codehaus.org/browse/SUREFIRE-446
&gt;
&gt; Maven Surefire provides a facility for various "fork modes":
&gt;
&gt; * forkMode=once: The default mode, spawns a separate TestNG process (like
&gt; the TestNG Ant task)
&gt;
&gt; * forkMode=never: run TestNG in the same process as Maven, in an isolated
&gt; classloader
&gt;
&gt; * forkMode=always: launch TestNG N times for N tests; if one test
&gt; segfaults or calls System.exit or something, the other tests can run to
&gt; completion safely.
&gt;
&gt; I didn't test forkMode=always with TestNG in Surefire 2.4, and sure enough
&gt; it doesn't work at all.  (It runs the tests but reports 0 tests
&gt; passed/failed.)
&gt;
&gt; It does work basically OK for JUnit, where classes are normally isolated
&gt; from each other, but I'm not sure it even makes sense for TestNG tests,
&gt; where one test may depend on tests in other classes (multi-class dependent
&gt; methods).
&gt;
&gt; I can kind of hack it so it works OK if you don't have multi-class
&gt; dependent methods, but if you DO have multi-class dependent methods, it
&gt; fails with a TestNGException: "MyTest.testFoo() is depending on
&gt; nonexistent method otherClassSetUp".
&gt;
&gt; What should I do here?  Put in the hack and let the user figure out the
&gt; TestNGException if they try to use multi-class dependent methods?  Fail
&gt; with a clean error if the user tries to use forkMode=always with TestNG?
&gt; Something else?
&gt;
&gt; Should forkMode=always be a feature of TestNG somehow?
&gt;
&gt; -Dan
&gt;
&gt; --~--~---------~--~----~------------~-------~--~----~
&gt; You received this message because you are subscribed to the Google Groups
&gt; "testng-users" group.
&gt; To post to this group, send email to testng-users@googlegroups.com
&gt; To unsubscribe from this group, send email to
&gt; testng-users-unsubscribe@googlegroups.com
&gt; For more options, visit this group at
&gt; http://groups.google.com/group/testng-users?hl=en
&gt; -~----------~----~----~----~------~----~------~--~---
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>testng, surefire, and forkMode=always</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200802.mbox/%3cPine.WNT.4.64.0802061434120.2808@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0802061434120-2808@sfeng02-rf-lan%3e</id>
<updated>2008-02-06T22:59:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Benjamin Bentmann has filed bug SUREFIRE-446 
http://jira.codehaus.org/browse/SUREFIRE-446

Maven Surefire provides a facility for various "fork modes":

* forkMode=once: The default mode, spawns a separate TestNG process (like 
the TestNG Ant task)

* forkMode=never: run TestNG in the same process as Maven, in an isolated 
classloader

* forkMode=always: launch TestNG N times for N tests; if one test 
segfaults or calls System.exit or something, the other tests can run to 
completion safely.

I didn't test forkMode=always with TestNG in Surefire 2.4, and sure enough 
it doesn't work at all.  (It runs the tests but reports 0 tests 
passed/failed.)

It does work basically OK for JUnit, where classes are normally isolated 
from each other, but I'm not sure it even makes sense for TestNG tests, 
where one test may depend on tests in other classes (multi-class dependent 
methods).

I can kind of hack it so it works OK if you don't have multi-class 
dependent methods, but if you DO have multi-class dependent methods, it 
fails with a TestNGException: "MyTest.testFoo() is depending on 
nonexistent method otherClassSetUp".

What should I do here?  Put in the hack and let the user figure out the 
TestNGException if they try to use multi-class dependent methods?  Fail 
with a clean error if the user tries to use forkMode=always with TestNG? 
Something else?

Should forkMode=always be a feature of TestNG somehow?

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801281058230.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801281058230-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-28T19:00:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Benjamin Bentmann wrote:

&gt; TestNG is not designed only for the fancy tests, it can run the simple unit
&gt; tests, too. Dan, to me it looks you/Surefire are pushing something like "If
&gt; you want unit tests, use JUnit, if you want function/integration tests, use
&gt; TestNG" by punishing those that employ TestNG for the simple use-case. I am
&gt; neither a JUnit nor TestNG fanatic but I can't follow your XOR-like argument
&gt; here.

You CAN use TestNG for unit tests; the simple use case does work.  It's 
just not as nice as you might wish it were.  My argument is that this 
isn't very important because there's a better alternative available for 
unit tests.

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c15138325.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15138325-post@talk-nabble-com%3e</id>
<updated>2008-01-28T15:54:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


dfabulich wrote:
&gt; 
&gt; As I said, I don't think you're using the right tool for the job here. 
&gt; 
Hm, I am not really in the mood to start off a discussion with my project
manager ;-)


dfabulich wrote:
&gt; 
&gt; You can get the exact behavior you want from JUnit.
&gt; 
And I could get it from TestNG if I passed each class in as an individual
suite, couldn't I?


dfabulich wrote:
&gt; 
&gt; Again, if you want class-level logging, I encourage you to take up the 
&gt; matter with the TestNG team.
&gt; 
Might be a good idea. As some kind of explanation why I started this
discussion on the Surefire corner at all: Surefire 2.3.1 did what I wanted
so the first impression after updating to Surefire 2.4 was that it got
messed up.


dfabulich wrote:
&gt; 
&gt; Doesn't this option smell bad to you?
&gt; 

It's a rather technical/sophisticated option, I agree about that. But aren't
"useSystemClassLoader", "childDelegation" and "forkMode" likewise? Whoever
develops tests needs to have proper knowledge about their requirements on
the execution runtime and hence, needs to configure the test runner
appropriately. The same would apply for this option, default it to "all",
let the experts change it to meet their special needs.


dfabulich wrote:
&gt; 
&gt; Instead of making this option, wouldn't it be nice if it just logged 
&gt; correctly?  If TestNG notified us when to log, we could log anything we 
&gt; wanted.
&gt; 
I fear having just another lister in the TestNG framework is not enough. The
problem I see here is the following: If Sufefire passes all test classes
(say A and B) as a single suite to TestNG, what would TestNG prevent from
running them like this:
  A.testOne
  B.testOne
  A.testTwo
  B.testTwo
  A.testThree
  B.testThree
Our test methods have no dependencies that would require a deterministic
order. Even if TestNG exposed events for starting/stopping a test class, I
still would not get a guarantee that all methods from a single class are run
without inter-leaving with methods from other classes to give me that
class-level testing feeling. I hardly can see an argument how one could
request a change on this behavior. A suite is the outer-most group of tests
and as long as I do not specify dependencies, TestNG is free in ordering
them.


dfabulich wrote:
&gt; 
&gt; Surefire is meant to be a wrapper around the underlying test framework; 
&gt; 
No problems with that. But it's Surefire and not the test framework that
aggregates my test classes into a single suite. I am basically asking for an
option to control the way how Surefire assembles the suites *before* it
passes control to the test framework.


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/Test-Suites%2C-Ant%2C-Surefire%2C-and-JunitReport-tp15076378p15138325.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c15136338.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15136338-post@talk-nabble-com%3e</id>
<updated>2008-01-28T14:45:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


dfabulich wrote:
&gt; 
&gt; Inter-class dependencies are one of TestNG's fundamental features 
&gt; 

Use of this feature is optional. For my sake, call it an "abuse" of TestNG
if I run that simple unit tests without inter-class dependencies ;-)


dfabulich wrote:
&gt; 
&gt; [...] but TestNG is meant to support functional/integration tests.
&gt; 

If I may requote the TestNG marketing slogan, again:
&gt; TestNG is designed to cover all categories of tests: *unit*, [...]

TestNG is not designed only for the fancy tests, it can run the simple unit
tests, too. Dan, to me it looks you/Surefire are pushing something like "If
you want unit tests, use JUnit, if you want function/integration tests, use
TestNG" by punishing those that employ TestNG for the simple use-case. I am
neither a JUnit nor TestNG fanatic but I can't follow your XOR-like argument
here.


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/Test-Suites%2C-Ant%2C-Surefire%2C-and-JunitReport-tp15076378p15136338.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801271737260.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801271737260-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-28T02:06:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Benjamin Bentmann wrote:

&gt; But what I really want is to avoid bothering with suites at all. Sure, 
&gt; TestNG has a powerful suite concept, nice, maybe we may want to use it 
&gt; someday in the future but for now, we have just the simple use-case with 
&gt; non-related test classes, i.e. we are happy by grouping at the class 
&gt; level.

As I said, I don't think you're using the right tool for the job here. 
TestNG is meant to support all that fancy stuff, and behaves a little 
differently for that reason.  You can get the exact behavior you want from 
JUnit.

&gt; We have no suite(s), only a directory with some unrelated test classes. 
&gt; Now Surefire goes ahead and creates a suite, automatically, without my 
&gt; control, assuming the entire directory is a single suite. This 
&gt; assumption does not fit our needs.

That's fair, but I claim that this assumption is a good one for people who 
are using TestNG, most of whom pick TestNG over JUnit because they need to 
do that weird stuff.

Again, if you want class-level logging, I encourage you to take up the 
matter with the TestNG team.  TestNG isn't meant to work this way today.

&gt; dfabulich wrote:
&gt;&gt;
&gt;&gt; That option sounds really confusing.  What would you call it?  How would
&gt;&gt; you document it?  You'd have to know a lot about the guts of Surefire and
&gt;&gt; TestNG for an option like that to make much sense.
&gt;&gt;
&gt; Could think of something like "suiteMode=class|package|all":
&gt; This option controls how Surefire will assemble your test classes into a
&gt; suite. "class" means to run each class individually in its own suite.
&gt; "package" groups all classes from the same package into a separate suite.
&gt; "all" will aggregate all found test classes in a single suite. Each created
&gt; suite will then be passed to the testing framework for execution and will be
&gt; run independently of the other suites. Note that test classes that have
&gt; dependencies on each other, must be executed in the same suite. Therefore,
&gt; the values "class" and "package" should be used with care because Surefire
&gt; itself cannot detect such inter-class dependencies.

Doesn't this option smell bad to you?  It does to me!

Instead of making this option, wouldn't it be nice if it just logged 
correctly?  If TestNG notified us when to log, we could log anything we 
wanted.

Surefire is meant to be a wrapper around the underlying test framework; 
it's not meant to provide features that the frameworks lack.  I think this 
is one of those cases where trying to provide the feature in Surefire 
would be way harder, and would also be fighting the framework.

&gt; Say one starts of with JUnit, where Surefire executes classes 
&gt; individually. Then one goes and converts his tests to use TestNG (they 
&gt; have a tool for this). Conceptually, you have the same test design, but 
&gt; now Surefire insists on running all classes in a single job/black-box. I 
&gt; am sorry, but I still find this odd since I am lacking the required 
&gt; knowledge about the guts of Surefire and TestNG ;-)

For the record, I agree that the difference between TestNG and JUnit is 
strange.  I claim that we only find it odd BECAUSE we have painfully 
learned about these guts... most people don't notice or care about the 
difference.

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801271700390.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801271700390-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-28T01:37:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Jason van Zyl wrote:

&gt; Correct me if I'm wrong here Benjamin but I think he's talking about 
&gt; stating what tests you want to run, and how they are grouped 
&gt; declaratively. As a best practice don't use suites and come up with a 
&gt; way in Surefire to group things and avoid grouping of things in code.

Inter-class dependencies are one of TestNG's fundamental features; it's 
arguably the most important architectural difference between TestNG and 
JUnit.  As Benjamin pointed out, they are declarative.

&gt; I think it would just be a practice for class to be self-contained, test 
&gt; one thing, and allow wiring up of sets/groups externally.

That's a good practice for unit tests, but TestNG is meant to support 
functional/integration tests.  Unlike unit tests, which are meant to be 
isolated and test one thing, TestNG tests are supposed to test more than 
one thing together, and are therefore designed to inter-depend on one 
another.

It's a pretty significant philosophical shift; the TestNG guys wrote a 
whole book about it, blah blah blah.  :-)

Dependent test methods
http://beust.com/weblog/archives/000171.html
Are dependent test methods really evil?
http://beust.com/weblog/archives/000259.html
Why unit tests are disappearing
http://beust.com/weblog/archives/000319.html

&gt; If this model breaks down then maybe, as I've asked before, it makes sense to 
&gt; create separate plugins for the various test tools.

I'm still on the fence about that, but regardless I don't think this is a 
good candidate reason.  Surefire has to handle this problem in the case of 
JUnit suites as well as TestNG suites; the only difference is that in 
JUnit this problem is less important because we think people mostly 
shouldn't write unit tests like that.

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Jason van Zyl &lt;jason@maven.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c06E3C072-FFA3-4731-B922-B66564E7AAA5@maven.org%3e"/>
<id>urn:uuid:%3c06E3C072-FFA3-4731-B922-B66564E7AAA5@maven-org%3e</id>
<updated>2008-01-28T01:10:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On 27-Jan-08, at 12:31 PM, Benjamin Bentmann wrote:

&gt;
&gt;
&gt; Jason van Zyl-2 wrote:
&gt;&gt;
&gt;&gt; Correct me if I'm wrong here Benjamin but I think he's talking about
&gt;&gt; stating what tests you want to run, and how they are grouped
&gt;&gt; declaratively. As a best practice don't use suites and come up with a
&gt;&gt; way in Surefire to group things and avoid grouping of things in code.
&gt;&gt;
&gt;
&gt; Not quite sure if I understand you correctly. A TestNG suite XML  
&gt; file is
&gt; quite declarative so I already have the possibility to declaratively  
&gt; select
&gt; and group tests. In fear that I can't get Surefire where I wished
&gt; (one-class-per-suite), I opened http://jira.codehaus.org/browse/SUREFIRE-438
&gt; which would allow to easily feed a bunch of suite XML files into the  
&gt; plugin.
&gt;
&gt; But what I really want is to avoid bothering with suites at all.

Sorry if I didn't explain it well but we are in 100% agreement. Make  
tests simple, no suites, and group declaratively.

&gt; Sure,
&gt; TestNG has a powerful suite concept, nice, maybe we may want to use it
&gt; someday in the future but for now, we have just the simple use-case  
&gt; with
&gt; non-related test classes, i.e. we are happy by grouping at the class  
&gt; level.
&gt; Explicitly maintaining suites, either in code or via XML, would just  
&gt; be lost
&gt; worktime here (although I already thought about a plugin that  
&gt; automatically
&gt; creates single-class suites from the existing test classes and  
&gt; prepares the
&gt; dozens of suite files before the actual Surefire run...)
&gt;
&gt; We have no suite(s), only a directory with some unrelated test  
&gt; classes. Now
&gt; Surefire goes ahead and creates a suite, automatically, without my  
&gt; control,
&gt; assuming the entire directory is a single suite. This assumption  
&gt; does not
&gt; fit our needs.
&gt;
&gt;
&gt; dfabulich wrote:
&gt;&gt;
&gt;&gt; That option sounds really confusing.  What would you call it?  How  
&gt;&gt; would
&gt;&gt; you document it?  You'd have to know a lot about the guts of  
&gt;&gt; Surefire and
&gt;&gt; TestNG for an option like that to make much sense.
&gt;&gt;
&gt; Could think of something like "suiteMode=class|package|all":
&gt; This option controls how Surefire will assemble your test classes  
&gt; into a
&gt; suite. "class" means to run each class individually in its own suite.
&gt; "package" groups all classes from the same package into a separate  
&gt; suite.
&gt; "all" will aggregate all found test classes in a single suite. Each  
&gt; created
&gt; suite will then be passed to the testing framework for execution and  
&gt; will be
&gt; run independently of the other suites. Note that test classes that  
&gt; have
&gt; dependencies on each other, must be executed in the same suite.  
&gt; Therefore,
&gt; the values "class" and "package" should be used with care because  
&gt; Surefire
&gt; itself cannot detect such inter-class dependencies.
&gt;
&gt;
&gt;
&gt; dfabulich wrote:
&gt;&gt;
&gt;&gt; "TestNG is designed to cover all categories of tests:  unit, [...]"
&gt;&gt; [...]
&gt;&gt; If all you're doing is unit tests, you may prefer to use JUnit 4. :-)
&gt;&gt;
&gt;
&gt; Well, no comments ;-)
&gt;
&gt; Say one starts of with JUnit, where Surefire executes classes  
&gt; individually.
&gt; Then one goes and converts his tests to use TestNG (they have a tool  
&gt; for
&gt; this). Conceptually, you have the same test design, but now Surefire  
&gt; insists
&gt; on running all classes in a single job/black-box. I am sorry, but I  
&gt; still
&gt; find this odd since I am lacking the required knowledge about the  
&gt; guts of
&gt; Surefire and TestNG ;-)
&gt;
&gt; Regards,
&gt;
&gt;
&gt; Benjamin Bentmann
&gt; -- 
&gt; View this message in context: http://www.nabble.com/Test-Suites%2C-Ant%2C-Surefire%2C-and-JunitReport-tp15076378p15123679.html
&gt; Sent from the Surefire - Developer mailing list archive at Nabble.com.
&gt;

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

Simplex sigillum veri. (Simplicity is the seal of truth.)





</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c15123679.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15123679-post@talk-nabble-com%3e</id>
<updated>2008-01-27T20:31:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


Jason van Zyl-2 wrote:
&gt; 
&gt; Correct me if I'm wrong here Benjamin but I think he's talking about  
&gt; stating what tests you want to run, and how they are grouped  
&gt; declaratively. As a best practice don't use suites and come up with a  
&gt; way in Surefire to group things and avoid grouping of things in code.
&gt; 

Not quite sure if I understand you correctly. A TestNG suite XML file is
quite declarative so I already have the possibility to declaratively select
and group tests. In fear that I can't get Surefire where I wished
(one-class-per-suite), I opened http://jira.codehaus.org/browse/SUREFIRE-438
which would allow to easily feed a bunch of suite XML files into the plugin.

But what I really want is to avoid bothering with suites at all. Sure,
TestNG has a powerful suite concept, nice, maybe we may want to use it
someday in the future but for now, we have just the simple use-case with
non-related test classes, i.e. we are happy by grouping at the class level.
Explicitly maintaining suites, either in code or via XML, would just be lost
worktime here (although I already thought about a plugin that automatically
creates single-class suites from the existing test classes and prepares the
dozens of suite files before the actual Surefire run...)

We have no suite(s), only a directory with some unrelated test classes. Now
Surefire goes ahead and creates a suite, automatically, without my control,
assuming the entire directory is a single suite. This assumption does not
fit our needs.


dfabulich wrote:
&gt; 
&gt; That option sounds really confusing.  What would you call it?  How would 
&gt; you document it?  You'd have to know a lot about the guts of Surefire and 
&gt; TestNG for an option like that to make much sense.
&gt; 
Could think of something like "suiteMode=class|package|all":
This option controls how Surefire will assemble your test classes into a
suite. "class" means to run each class individually in its own suite.
"package" groups all classes from the same package into a separate suite.
"all" will aggregate all found test classes in a single suite. Each created
suite will then be passed to the testing framework for execution and will be
run independently of the other suites. Note that test classes that have
dependencies on each other, must be executed in the same suite. Therefore,
the values "class" and "package" should be used with care because Surefire
itself cannot detect such inter-class dependencies.



dfabulich wrote:
&gt; 
&gt; "TestNG is designed to cover all categories of tests:  unit, [...]"
&gt; [...]
&gt; If all you're doing is unit tests, you may prefer to use JUnit 4. :-)
&gt; 

Well, no comments ;-)

Say one starts of with JUnit, where Surefire executes classes individually.
Then one goes and converts his tests to use TestNG (they have a tool for
this). Conceptually, you have the same test design, but now Surefire insists
on running all classes in a single job/black-box. I am sorry, but I still
find this odd since I am lacking the required knowledge about the guts of
Surefire and TestNG ;-)

Regards,


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/Test-Suites%2C-Ant%2C-Surefire%2C-and-JunitReport-tp15076378p15123679.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Jason van Zyl &lt;jason@maven.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c1526A791-E23C-492A-B460-7B078A46C0C2@maven.org%3e"/>
<id>urn:uuid:%3c1526A791-E23C-492A-B460-7B078A46C0C2@maven-org%3e</id>
<updated>2008-01-27T18:53:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On 25-Jan-08, at 10:59 AM, Dan Fabulich wrote:

&gt; Benjamin Bentmann wrote:
&gt;
&gt;&gt; I see. Now, if the user can provide an option to Surefire,  
&gt;&gt; indicating that the unit tests do not have inter-class  
&gt;&gt; dependencies, wouldn't this allow to get back the old behavior?  
&gt;&gt; I.e. enabling Surefire to pass test classes individually into TestNG?
&gt;
&gt; That option sounds really confusing.  What would you call it?  How  
&gt; would you document it?  You'd have to know a lot about the guts of  
&gt; Surefire and TestNG for an option like that to make much sense.
&gt;

Correct me if I'm wrong here Benjamin but I think he's talking about  
stating what tests you want to run, and how they are grouped  
declaratively. As a best practice don't use suites and come up with a  
way in Surefire to group things and avoid grouping of things in code.

If this model breaks down then maybe, as I've asked before, it makes  
sense to create separate plugins for the various test tools.

&gt; Not to mention that it'd be error prone.

I think it would just be a practice for class to be self-contained,  
test one thing, and allow wiring up of sets/groups externally.

&gt; Developer X would assess the tests, verifying that there are no  
&gt; inter-class dependencies, and turn on the flag.  Later, developer Y  
&gt; could introduce an inter-class dependency and go to run the tests,  
&gt; but find that it's not working.  It'd be hard to figure out why  
&gt; without knowing a lot about how Surefire is doing its job.
&gt;
&gt; More generally, I don't think class-level reporting really makes  
&gt; sense in TestNG as it's designed today.  Right now, TestNG provides  
&gt; listeners with the following notifications:
&gt;
&gt; onStart
&gt; onTestStart
&gt; onTestSuccess
&gt; onTestFailure
&gt; onTestSkipped
&gt; onTestFailedButWithinSuccessPercentage
&gt; onConfigurationSuccess
&gt; onConfigurationFailure
&gt; onConfigurationSkip
&gt; onFinish
&gt;
&gt; Note that there's nothing here about "onClassStart/Finish" or even  
&gt; "onGroupStart/Finish".
&gt;
&gt; If TestNG exposed a listener, we could easily attach to it, but I  
&gt; see that as a feature of TestNG.  We could certainly try to write  
&gt; TestNG features in Surefire, but the TestNG code knows best whether,  
&gt; for example, your classes have any inter-dependencies, when your  
&gt; classes start and stop, and more generally how to construct a full  
&gt; test run comprised of suites, groups, classes and tests.
&gt;
&gt; Surefire shouldn't be in the business of reimplementing that logic,  
&gt; especially since we expect this feature to be generally useful.  It  
&gt; should be a part of TestNG, if it matters at all.
&gt;
&gt;&gt; I would not have any problems with a single file per method.  
&gt;&gt; Indeed, I think
&gt;&gt; I like the idea: Test methods are the units that succeed or fail,  
&gt;&gt; so if test
&gt;&gt; method TestClass.testFoo() fails, I would investigate
&gt;&gt; TestClass.testFoo-output.txt and can easily concentrate on its output
&gt;&gt; without any need to skip over the output from all the other  
&gt;&gt; successful
&gt;&gt; methods. I think that would be worth another option ;-)
&gt;
&gt; "TestNG is designed to cover all categories of tests:  unit,  
&gt; functional, end-to-end, integration, etc..."
&gt;
&gt; In TestNG, especially when one method @dependsOn another method, the  
&gt; test failures aren't units, and aren't even meant to be units.   
&gt; (This can be a huge benefit for slow integration tests, where  
&gt; earlier tests leave behind fixtures that later tests are meant to  
&gt; consume.)
&gt;
&gt; If all you're doing is unit tests, you may prefer to use JUnit 4. :-)
&gt;
&gt; Anyway, in thinking about it a little harder I realized that we  
&gt; can't even necessarily split the stdout into one file per method,  
&gt; since the tests may be run in parallel!
&gt;
&gt; I'm pretty sure we can do that logging thing, at least. :-p
&gt;
&gt; -Dan

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

We know what we are, but know not what we may be.

-- Shakespeare 





</pre>
</div>
</content>
</entry>
<entry>
<title>Re: SUREFIRE-428: integration test to check class path order</title>
<author><name>Brett Porter &lt;bporter@exist.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c1A6EEB3F-BAC6-4367-89CF-4836152C469C@apache.org%3e"/>
<id>urn:uuid:%3c1A6EEB3F-BAC6-4367-89CF-4836152C469C@apache-org%3e</id>
<updated>2008-01-26T01:34:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
It would seem to be best in Surefire to me - the assertion in Maven  
should really be covered by a unit test?

On 26/01/2008, at 5:25 AM, Dan Fabulich wrote:

&gt;
&gt; Class path ordering is tricky, and changed recently.  Benjamin  
&gt; Bentmann provides a regression test in SUREFIRE-428.
&gt;
&gt; However, I'm not certain if I should apply it in Surefire, because  
&gt; we use those integration tests to verify backwards compatibility  
&gt; with older versions of Maven.
&gt;
&gt; My initial thought was that perhaps the test should be applied in  
&gt; core-integration-testing; there are a few small Surefire integration  
&gt; tests there (which I think is correct), and I think this could join  
&gt; them to prevent regression for MNG-3118.
&gt;
&gt; Then again, since it's fundamentally an integration test, it doesn't  
&gt; specifically belong to either side, so maybe Surefire is the best  
&gt; place to install it...?
&gt;
&gt; Thoughts?
&gt;
&gt; -Dan



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [testng-users] Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>&quot;Steve Loughran&quot; &lt;steve.loughran@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cc84a50780801251515x252e841fye580b2137a648f0e@mail.gmail.com%3e"/>
<id>urn:uuid:%3cc84a50780801251515x252e841fye580b2137a648f0e@mail-gmail-com%3e</id>
<updated>2008-01-25T23:15:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Jan 25, 2008 5:04 PM, Dan Fabulich &lt;dan@fabulich.com&gt; wrote:
&gt;
&gt; Steve Loughran wrote:
&gt;
&gt; &gt;&gt; What I propose is that, in order to avoid destroying information, Surefire
&gt; &gt;&gt; should generate XML that looks like Example 7 (all-in-one-file), and not
&gt; &gt;&gt; try to fake it to look like Example 2 (one-file-per-class).  (TestNG's
&gt; &gt;&gt; junit-like output also generates files like Example 7.)  However, when it
&gt; &gt;&gt; comes time to generate an HTML report, surefire-reports will discard
&gt; &gt;&gt; suite-level information, and treat large suites like Example 7 as if they
&gt; &gt;&gt; had been presented in separate files like Example 2.  I'd argue that all
&gt; &gt;&gt; of the other JunitReport-like tools (including Ant) should probably follow
&gt; &gt;&gt; the same lead.
&gt; &gt;
&gt; &gt; I think that if everyone else has a bug, its hard to call it a bug. More
&gt; &gt; a presentation choice :)
&gt;
&gt; I'd thought somebody might say that! :-)  Still, do you think TestNG and
&gt; other tools should therefore generate multiple XML files, to be compatible
&gt; with the other (arguably broken) reporting tools?

No,

* junit report will take other sets of XSL sheets than those built in
to Ant's own JAR. This allows anyone to fix the XSLs without waiting
for ant's (fairly mature) release cycle.
* CI tools are a separate issue. Don't know there

Looking at the reports -and trying to imagine a time where I ever get
to stop making meta-RPM-RPMs (don't ask), I do want to push the test
formats forward in a way everyone is happy. I really dont like the way
the current stuff sticks summary info as toplevel attributes (time,
results), as it stops us streaming out the XML as we go. I'm starting
to wonder if we couldnt move to a new format, and have the option of
XSL generation of the legacy stuff, purely for those tools that havent
been upgraded in sync.

-steve


</pre>
</div>
</content>
</entry>
<entry>
<title>SUREFIRE-428: integration test to check class path order</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801251322450.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801251322450-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-25T21:25:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Class path ordering is tricky, and changed recently.  Benjamin Bentmann 
provides a regression test in SUREFIRE-428.

However, I'm not certain if I should apply it in Surefire, because we use 
those integration tests to verify backwards compatibility with older 
versions of Maven.

My initial thought was that perhaps the test should be applied in 
core-integration-testing; there are a few small Surefire integration tests 
there (which I think is correct), and I think this could join them to 
prevent regression for MNG-3118.

Then again, since it's fundamentally an integration test, it doesn't 
specifically belong to either side, so maybe Surefire is the best place to 
install it...?

Thoughts?

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801251035590.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801251035590-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-25T18:59:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Benjamin Bentmann wrote:

&gt; I see. Now, if the user can provide an option to Surefire, indicating 
&gt; that the unit tests do not have inter-class dependencies, wouldn't this 
&gt; allow to get back the old behavior? I.e. enabling Surefire to pass test 
&gt; classes individually into TestNG?

That option sounds really confusing.  What would you call it?  How would 
you document it?  You'd have to know a lot about the guts of Surefire and 
TestNG for an option like that to make much sense.

Not to mention that it'd be error prone.  Developer X would assess the 
tests, verifying that there are no inter-class dependencies, and turn on 
the flag.  Later, developer Y could introduce an inter-class dependency 
and go to run the tests, but find that it's not working.  It'd be hard to 
figure out why without knowing a lot about how Surefire is doing its job.

More generally, I don't think class-level reporting really makes sense in 
TestNG as it's designed today.  Right now, TestNG provides listeners with 
the following notifications:

onStart
onTestStart
onTestSuccess
onTestFailure
onTestSkipped
onTestFailedButWithinSuccessPercentage
onConfigurationSuccess
onConfigurationFailure
onConfigurationSkip
onFinish

Note that there's nothing here about "onClassStart/Finish" or even 
"onGroupStart/Finish".

If TestNG exposed a listener, we could easily attach to it, but I see that 
as a feature of TestNG.  We could certainly try to write TestNG features 
in Surefire, but the TestNG code knows best whether, for example, your 
classes have any inter-dependencies, when your classes start and stop, and 
more generally how to construct a full test run comprised of suites, 
groups, classes and tests.

Surefire shouldn't be in the business of reimplementing that logic, 
especially since we expect this feature to be generally useful.  It should 
be a part of TestNG, if it matters at all.

&gt; I would not have any problems with a single file per method. Indeed, I think
&gt; I like the idea: Test methods are the units that succeed or fail, so if test
&gt; method TestClass.testFoo() fails, I would investigate
&gt; TestClass.testFoo-output.txt and can easily concentrate on its output
&gt; without any need to skip over the output from all the other successful
&gt; methods. I think that would be worth another option ;-)

"TestNG is designed to cover all categories of tests:  unit, functional, 
end-to-end, integration, etc..."

In TestNG, especially when one method @dependsOn another method, the test 
failures aren't units, and aren't even meant to be units.  (This can be a 
huge benefit for slow integration tests, where earlier tests leave behind 
fixtures that later tests are meant to consume.)

If all you're doing is unit tests, you may prefer to use JUnit 4. :-)

Anyway, in thinking about it a little harder I realized that we can't even 
necessarily split the stdout into one file per method, since the tests may 
be run in parallel!

I'm pretty sure we can do that logging thing, at least. :-p

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c15093881.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15093881-post@talk-nabble-com%3e</id>
<updated>2008-01-25T18:26:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


dfabulich wrote:
&gt; 
&gt; Typically it's used for slow tests; you can identify a subset of tests 
&gt; that you want to run and just run those.  (You can even pull just one 
&gt; method from Class X, and another method from Class Y, and so on.)
&gt; 
Thanks for the explanation. To me, this seems more useful for ad-hoc
testing. During an automated build, I want all existing tests for maximum
test coverage of the artifact.


dfabulich wrote:
&gt; 
&gt; For TestNG, we have to hand it the entire directory, because any one class
&gt; may @dependsOn methods in other classes.
&gt; 
I see. Now, if the user can provide an option to Surefire, indicating that
the unit tests do not have inter-class dependencies, wouldn't this allow to
get back the old behavior? I.e. enabling Surefire to pass test classes
individually into TestNG?


dfabulich wrote:
&gt; 
&gt; As for splitting them all up into separate txt files, the only way we 
&gt; could do it would be to split the tests up into one txt file per METHOD, 
&gt; which is way too many files IMO.
&gt; 
I would not have any problems with a single file per method. Indeed, I think
I like the idea: Test methods are the units that succeed or fail, so if test
method TestClass.testFoo() fails, I would investigate
TestClass.testFoo-output.txt and can easily concentrate on its output
without any need to skip over the output from all the other successful
methods. I think that would be worth another option ;-)


dfabulich wrote:
&gt; 
&gt; It's odd that you describe this as a 2.3.1 regression...  I couldn't get 
&gt; TestNG to work at all in Surefire 2.3.x, hence my work on Surefire 2.4.
&gt; 

Using Surefire 2.3.x together with TestNG 5.1 worked for me. Nevertheless,
it's good to have Surefire 2.4 now!

Regards,


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/Test-Suites%2C-Ant%2C-Surefire%2C-and-JunitReport-tp15076378p15093881.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [testng-users] Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801250903120.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801250903120-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-25T17:04:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Steve Loughran wrote:

&gt;&gt; What I propose is that, in order to avoid destroying information, Surefire
&gt;&gt; should generate XML that looks like Example 7 (all-in-one-file), and not
&gt;&gt; try to fake it to look like Example 2 (one-file-per-class).  (TestNG's
&gt;&gt; junit-like output also generates files like Example 7.)  However, when it
&gt;&gt; comes time to generate an HTML report, surefire-reports will discard
&gt;&gt; suite-level information, and treat large suites like Example 7 as if they
&gt;&gt; had been presented in separate files like Example 2.  I'd argue that all
&gt;&gt; of the other JunitReport-like tools (including Ant) should probably follow
&gt;&gt; the same lead.
&gt;
&gt; I think that if everyone else has a bug, its hard to call it a bug. More 
&gt; a presentation choice :)

I'd thought somebody might say that! :-)  Still, do you think TestNG and 
other tools should therefore generate multiple XML files, to be compatible 
with the other (arguably broken) reporting tools?

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801250841400.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801250841400-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-25T17:01:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Benjamin Bentmann wrote:

&gt; For my curiosity: What would be the benefit of setting up a hand-crafted
&gt; test suite? I am a lazy guy and prefer the dumb machine to do the nasty
&gt; things for me so I really like the idea of just dropping a test class into
&gt; src/test/java without bothering to additionally maintain some test suite,
&gt; too.

Typically it's used for slow tests; you can identify a subset of tests 
that you want to run and just run those.  (You can even pull just one 
method from Class X, and another method from Class Y, and so on.)

&gt; My personal concerns are
&gt; a) the console output from Surefire during test execution and
&gt; b) the redirected test output files (*-output.txt)

Surefire's design is to hand off control to the testing framework 
(JUnit/TestNG) and then report on the console when we get control back. 
For JUnit, we hand off control on a "class" level, so we get control back 
after every class.  For TestNG, we have to hand it the entire directory, 
because any one class may @dependsOn methods in other classes.

Furthermore, TestNG doesn't notify us at the start/end of every class; 
indeed, it's easy to configure TestNG so that individual class methods run 
out of order (so that some of Class X runs and then some of Class Y, and 
then back to Class X, then Class Y finishes, etc.) and that's without 
considering parallelized testing.

We could log to the console on individual test methods as they run, though 
I'm sure we'd want to make it a configurable option.  I've filed 
SUREFIRE-437 for the console logging issue.

As for splitting them all up into separate txt files, the only way we 
could do it would be to split the tests up into one txt file per METHOD, 
which is way too many files IMO.

&gt; With Surefire 2.3.1, I got a result feedback every half minute when a 
&gt; test class finished.

It's odd that you describe this as a 2.3.1 regression...  I couldn't get 
TestNG to work at all in Surefire 2.3.x, hence my work on Surefire 2.4.

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [testng-users] Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>&quot;Steve Loughran&quot; &lt;steve.loughran@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cc84a50780801250655v6543510fs83f07fadd7a11459@mail.gmail.com%3e"/>
<id>urn:uuid:%3cc84a50780801250655v6543510fs83f07fadd7a11459@mail-gmail-com%3e</id>
<updated>2008-01-25T14:55:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Jan 24, 2008 10:12 PM, Dan Fabulich &lt;dan@fabulich.com&gt; wrote:
&gt;

&gt; Most of the JUnit reporting tools, including Ant's JunitReport task and
&gt; Maven's surefire-report plugin (but also including Hudson and others)
&gt; incorrectly assume that all of those testcases are methods of MyTestSuite.
&gt; As a result, it makes it look like all of your tests are methods of one
&gt; class in one package.  If you've got two "testOutput" methods, they'll be
&gt; indistinguishable (except by stacktrace, if one is present).
&gt;
&gt; The same thing happens when you run TestNG tests: it always generates all
&gt; of the test results in one XML file.  (Though it contains more
&gt; information, see below.)
&gt;
&gt; More generally, both Ant's JunitReport and surefire-report incorrectly
&gt; assume a one-to-one relationship between TestCase classes, XML files, and
&gt; "suites" of tests.  They assume that every XML file contains one suite of
&gt; tests, which is the same thing as a TestCase class, and all of the tests
&gt; in the suite are just methods of the TestCase class.  This assumption is
&gt; wrong.


I guess the reason for the assumption is that nobody normally writes a
test suite for JUnit, as it is needless coding that a pattern like
**/*Test.class could do at the build file level, where you can also
turn different tests on and off. But as you point out, it doesnt hold
for other test systems.

 &gt; Ant 1.6 (I think?) introduced a helpful attribute on all of its &lt;testcase&gt;
&gt; classes to include the class name of the class on every &lt;testcase&gt;
&gt; element:
&gt;
&gt; Example 7
&gt;      &lt;testsuite name="com.mycompany.MyTestSuite" failures="0" errors="0" tests="4"
time="0.031"&gt;
&gt;        &lt;properties&gt;&lt;!-- ... --&gt;&lt;/properties
&gt;        &lt;testcase name="test1a" time="0.0" classname="com.mycompany.Test1" /&gt;
&gt;        &lt;testcase name="test1b" time="0.0" classname="com.mycompany.Test1" /&gt;
&gt;        &lt;testcase name="test2a" time="0.0" classname="com.mycompany.Test2" /&gt;
&gt;        &lt;testcase name="test2b" time="0.0" classname="com.mycompany.Test2" /&gt;
&gt;        &lt;testcase name="test3a" time="0.0" classname="com.mycompany.Test3" /&gt;
&gt;        &lt;testcase name="test3b" time="0.0" classname="com.mycompany.Test3" /&gt;
&gt;      &lt;/testsuite&gt;

I forget when, but take your word for it.

&gt; This is good, because it allows you to figure out which class the method
&gt; really belongs to.  This is what TestNG outputs when it generates
&gt; JUnit-like results.  Unfortunately, nobody honors the "classname"
&gt; attribute, including Ant 1.7's JunitReport task!

You contributions to the XSL file are welcome :)

&gt;
&gt; Even if we did try to honor that information and report on it in the HTML,
&gt; how would we do it?  Right now, the reports are organized in terms of
&gt; packages, and within the packages you'll get a list of classes (assumed
&gt; incorrectly to be the same thing as "suites"), and within the list of
&gt; classes you'll get a list of test method names.  There's no room for
&gt; "suites" (as distinct from classes) in these reports at all.
&gt;
&gt; And arguably there shouldn't be a place for this information, because
&gt; apparently 80-90% of the time suites aren't being used; adding a "suites"
&gt; section would be redundant in those cases.
&gt;
&gt; We could throw away the "suite" wrapper and pretend as if the tests were
&gt; just classes and methods, but note something else: the sum of the "time"
&gt; attribute on the &lt;testcase&gt; elements is normally different from the "time"
&gt; attribute on the &lt;testsuite&gt;.  That's because the timer has a 16ms
&gt; resolution on most operating systems.

&gt;
&gt; In bug SUREFIRE-433, it was argued that we should generate separate JUnit
&gt; XML files for every class.  You could even imagine converting the results
&gt; from Example 7 into results that looked like Example 2, throwing away all
&gt; of the suite-level information.
&gt;
&gt; I certainly want to be conservative in what I emit and liberal in what I
&gt; accept, but I *really* don't want to throw away information, especially at
&gt; the XML level.  With that said, as we're trying to make the report look
&gt; something like the way it looks today, we're going to lose suite-level
&gt; information in the HTML.
&gt;
&gt; What I propose is that, in order to avoid destroying information, Surefire
&gt; should generate XML that looks like Example 7 (all-in-one-file), and not
&gt; try to fake it to look like Example 2 (one-file-per-class).  (TestNG's
&gt; junit-like output also generates files like Example 7.)  However, when it
&gt; comes time to generate an HTML report, surefire-reports will discard
&gt; suite-level information, and treat large suites like Example 7 as if they
&gt; had been presented in separate files like Example 2.  I'd argue that all
&gt; of the other JunitReport-like tools (including Ant) should probably follow
&gt; the same lead.

I think that  if everyone else has a bug, its hard to call it a bug.
More a presentation choice :)

&gt; My proposal is not obviously right, because, again, most other JUnit
&gt; report tools also have this reporting bug; when they try to format TestNG
&gt; output or Surefire output, they'll incorrectly report all methods to be
&gt; members of the suite class.  Maybe since we expect EVERYONE to have this
&gt; bug, we should be even more conservative in what we emit and generate
&gt; multi-file output, just so the other tools will know how to interpret it
&gt; correctly.  That would make it more likely that the HTML output would
&gt; contain complete information.
&gt;
&gt; What do other people think?  Agree, disagree?

I do need to allocate time to fix reporting in Ant, both what we
generate (assuming a junit4 task), and what the tool processes. Me,
I'm more concerned with the problem of trying to merge log results
from a server and a client, as the current reports only pick the
stdout and stderr from one side of the party,

-steve


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Benjamin Bentmann &lt;benjamin.bentmann@udo.edu&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3c15084183.post@talk.nabble.com%3e"/>
<id>urn:uuid:%3c15084183-post@talk-nabble-com%3e</id>
<updated>2008-01-25T09:32:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>


dfabulich wrote:
&gt; 
&gt; First, it seems like most people don't even use test suites, preferring to 
&gt; simply run every test in their src/test/java directory.
&gt; 
For my curiosity: What would be the benefit of setting up a hand-crafted
test suite? I am a lazy guy and prefer the dumb machine to do the nasty
things for me so I really like the idea of just dropping a test class into
src/test/java without bothering to additionally maintain some test suite,
too.


dfabulich wrote:
&gt; 
&gt; What I propose is that, in order to avoid destroying information, Surefire 
&gt; should generate XML that looks like Example 7 (all-in-one-file), and not 
&gt; try to fake it to look like Example 2 (one-file-per-class).
&gt; 
At least for me, I do not care about the structure/contents of the XML
report files (never read nor parse them by myself). Having a central file
with all information sounds like a reasonable approach for me, no problems
so far.

My personal concerns are
a) the console output from Surefire during test execution and
b) the redirected test output files (*-output.txt)

I am the kind of guy who prefers washing machines with a window, so I really
dislike the situation with Surefire 2.4 and TestNG where I see *nothing* on
the console until the suite completes (which takes roughly 5 minutes in one
of our modules). It is in general no good ui design if the user doesn't get
any feedback for long running tasks. With Surefire 2.3.1, I got a result
feedback every half minute when a test class finished.

Our tests use log4j with debug level logging on the console to track the
test execution and to evaluate it in case of failures. Therefore, we have
&lt;redirectTestOutputToFile&gt;true&lt;/redirectTestOutputToFile&gt;. Now image a test
suite with say n test classes, every class producing X KB output. If test
class A fails, we go inspect and A-output.txt with an acceptable size of X
KB. This becomes less pleasant when you have to inspect the all-in-one
TestSuite-output.txt which has a total size of n * X KB and n being a
growing factor as the test suite is extended.

I hope these illustrations help to understand the intended use-case.

Regards,


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/Test-Suites%2C-Ant%2C-Surefire%2C-and-JunitReport-tp15076378p15084183.html
Sent from the Surefire - Developer mailing list archive at Nabble.com.



</pre>
</div>
</content>
</entry>
<entry>
<title>Test Suites, Ant, Surefire, and JunitReport</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801241406490.5284@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801241406490-5284@sfeng02-rf-lan%3e</id>
<updated>2008-01-24T22:12:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

I spent some time solving a thorny problem over the last couple of days; 
I'm not 100% sure I like the solution to it, so I wanted to write a bit 
about it to see what other people think.

The problem occurs in cases where one test suite incorporates tests from 
multiple test classes.  This is the normal use case for a JUnit TestSuite. 
You'll typically write a JUnit suite like this:

Example 1
     public class MyTestSuite extends TestSuite {
       public static Test suite() {
         MyTestSuite suite = new MyTestSuite();
         suite.addTestSuite(FooTestCase.class);
         suite.addTest(BarTestSuite.suite());
         return suite;
       }
     }

(In TestNG, suites are defined using XML files, and are considerably more 
common in TestNG-land.)

The question I'm trying to answer is: how should the results of running a 
TestSuite be represented in XML, and how should that XML be represented in 
HTML?  You might think this would be a solved problem, but it doesn't 
appear to be.  :-( Bugs SUREFIRE-433 and TESTNG-204 all relate to this, as 
well as Ant bug 24106.

http://jira.codehaus.org/browse/SUREFIRE-433
http://jira.opensymphony.com/browse/TESTNG-204
http://issues.apache.org/bugzilla/show_bug.cgi?id=24106

First, it seems like most people don't even use test suites, preferring to 
simply run every test in their src/test/java directory.  If you do this, 
you get a bunch of XML files, one file per TestCase class, like this:

Example 2
     TEST-com.mycompany.Test1.xml
     TEST-com.mycompany.Test2.xml
     TEST-com.mycompany.Test3.xml

The individual XML files look like this:

Example 3
     &lt;testsuite name="com.mycompany.Test1" failures="1" errors="0" tests="2" time="0.031"&gt;
       &lt;properties&gt;&lt;!-- ... --&gt;&lt;/properties
       &lt;testcase name="test1a" time="0.0" /&gt;
       &lt;testcase name="test1b" time="0.0"&gt;
         &lt;failure type="java.lang.AssertionError" message="I don't like this movie!"&gt;java.lang.AssertionError:
I don't like this movie!
     	at org.testng.Assert.fail(Assert.java:84)
     	at org.testng.Assert.fail(Assert.java:91)
     	at com.mycompany.Test1.test1b(Test1.java:14)
     &lt;/failure&gt;
       &lt;/testcase&gt;
     &lt;/testsuite&gt;

That's all fine, but what if you want to use a test suite?  When you do 
that in Ant or in Maven today, you get just one XML file:

Example 4
     TEST-com.mycompany.MyTestSuite.xml

In Surefire 2.4, the XML unfortunately looks like this:

Example 5
     &lt;testsuite name="com.mycompany.MyTestSuite" failures="0" errors="0" tests="4" time="0.031"&gt;
       &lt;properties&gt;&lt;!-- ... --&gt;&lt;/properties
       &lt;testcase name="test1a" time="0.0" /&gt;
       &lt;testcase name="test1b" time="0.0" /&gt;
       &lt;testcase name="test2a" time="0.0" /&gt;
       &lt;testcase name="test2b" time="0.0" /&gt;
       &lt;testcase name="test3a" time="0.0" /&gt;
       &lt;testcase name="test3b" time="0.0" /&gt;
     &lt;/testsuite&gt;

Note that information has been lost here, and the information that *is* 
provided is misleading.  Specifically, we lost the fact that test1a was a 
method of com.mycompany.Test1; all we know is its method name. 
Furthermore, the report misleadingly seems to suggest that test1a is a 
method of MyTestSuite, whereas in fact MyTestSuite just has a suite() 
method and no test methods of its own.

Most of the JUnit reporting tools, including Ant's JunitReport task and 
Maven's surefire-report plugin (but also including Hudson and others) 
incorrectly assume that all of those testcases are methods of MyTestSuite. 
As a result, it makes it look like all of your tests are methods of one 
class in one package.  If you've got two "testOutput" methods, they'll be 
indistinguishable (except by stacktrace, if one is present).

The same thing happens when you run TestNG tests: it always generates all 
of the test results in one XML file.  (Though it contains more 
information, see below.)

More generally, both Ant's JunitReport and surefire-report incorrectly 
assume a one-to-one relationship between TestCase classes, XML files, and 
"suites" of tests.  They assume that every XML file contains one suite of 
tests, which is the same thing as a TestCase class, and all of the tests 
in the suite are just methods of the TestCase class.  This assumption is 
wrong.

Ant 1.6 (I think?) introduced a helpful attribute on all of its &lt;testcase&gt; 
classes to include the class name of the class on every &lt;testcase&gt; 
element:

Example 7
     &lt;testsuite name="com.mycompany.MyTestSuite" failures="0" errors="0" tests="4" time="0.031"&gt;
       &lt;properties&gt;&lt;!-- ... --&gt;&lt;/properties
       &lt;testcase name="test1a" time="0.0" classname="com.mycompany.Test1" /&gt;
       &lt;testcase name="test1b" time="0.0" classname="com.mycompany.Test1" /&gt;
       &lt;testcase name="test2a" time="0.0" classname="com.mycompany.Test2" /&gt;
       &lt;testcase name="test2b" time="0.0" classname="com.mycompany.Test2" /&gt;
       &lt;testcase name="test3a" time="0.0" classname="com.mycompany.Test3" /&gt;
       &lt;testcase name="test3b" time="0.0" classname="com.mycompany.Test3" /&gt;
     &lt;/testsuite&gt;

This is good, because it allows you to figure out which class the method 
really belongs to.  This is what TestNG outputs when it generates 
JUnit-like results.  Unfortunately, nobody honors the "classname" 
attribute, including Ant 1.7's JunitReport task!

Even if we did try to honor that information and report on it in the HTML, 
how would we do it?  Right now, the reports are organized in terms of 
packages, and within the packages you'll get a list of classes (assumed 
incorrectly to be the same thing as "suites"), and within the list of 
classes you'll get a list of test method names.  There's no room for 
"suites" (as distinct from classes) in these reports at all.

And arguably there shouldn't be a place for this information, because 
apparently 80-90% of the time suites aren't being used; adding a "suites" 
section would be redundant in those cases.

We could throw away the "suite" wrapper and pretend as if the tests were 
just classes and methods, but note something else: the sum of the "time" 
attribute on the &lt;testcase&gt; elements is normally different from the "time" 
attribute on the &lt;testsuite&gt;.  That's because the timer has a 16ms 
resolution on most operating systems.  By starting the timer at the 
beginning of the entire suite, we can capture overall time that we lose 
when we turn the timer on and off.  (And what if the tests had been run in 
parallel?)

In bug SUREFIRE-433, it was argued that we should generate separate JUnit 
XML files for every class.  You could even imagine converting the results 
from Example 7 into results that looked like Example 2, throwing away all 
of the suite-level information.

I certainly want to be conservative in what I emit and liberal in what I 
accept, but I *really* don't want to throw away information, especially at 
the XML level.  With that said, as we're trying to make the report look 
something like the way it looks today, we're going to lose suite-level 
information in the HTML.

What I propose is that, in order to avoid destroying information, Surefire 
should generate XML that looks like Example 7 (all-in-one-file), and not 
try to fake it to look like Example 2 (one-file-per-class).  (TestNG's 
junit-like output also generates files like Example 7.)  However, when it 
comes time to generate an HTML report, surefire-reports will discard 
suite-level information, and treat large suites like Example 7 as if they 
had been presented in separate files like Example 2.  I'd argue that all 
of the other JunitReport-like tools (including Ant) should probably follow 
the same lead.

My proposal is not obviously right, because, again, most other JUnit 
report tools also have this reporting bug; when they try to format TestNG 
output or Surefire output, they'll incorrectly report all methods to be 
members of the suite class.  Maybe since we expect EVERYONE to have this 
bug, we should be even more conservative in what we emit and generate 
multi-file output, just so the other tools will know how to interpret it 
correctly.  That would make it more likely that the HTML output would 
contain complete information.

What do other people think?  Agree, disagree?

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: svn commit: r596894 - /maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cPine.WNT.4.64.0801141119140.6036@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0801141119140-6036@sfeng02-rf-lan%3e</id>
<updated>2008-01-14T20:47:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Brett Porter wrote:

&gt; Hi Dan,
&gt;
&gt; I'm just flipping back through the commits by way of a quick review and had a 
&gt; question about this one.
&gt;
&gt; Does TestNG set a default thread count once parallel is enabled?
&gt;
&gt; I assume the problematic configuration is parallel = false + any thread 
&gt; count, so maybe a better alternative is to set the default, and manually 
&gt; unset it if parallel is false?

"-parallel" doesn't mean what you think it means... in fact, this value 
was confusing TestNG because it's not a boolean (any more).

Since 5.5(?) it would be better to call it "-parallelmode"; its values can 
be either "methods" or "tests" or it can be undefined.  It has no effect 
whatsoever if -threadcount isn't set.  Furthermore, -threadcount has no 
effect unless -parallel is set to something.

Does this make sense?  No, not really.  But I also don't think it would be 
a good idea for Surefire to get into the business of managing this.  In 
2.4 we just pass the string along to TestNG and hope for the best.

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: svn commit: r596894 - /maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java</title>
<author><name>Brett Porter &lt;brett@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200801.mbox/%3cFEDF8980-4D38-4FFA-B3CA-A88EAC797EC2@apache.org%3e"/>
<id>urn:uuid:%3cFEDF8980-4D38-4FFA-B3CA-A88EAC797EC2@apache-org%3e</id>
<updated>2008-01-14T05:51:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Dan,

I'm just flipping back through the commits by way of a quick review  
and had a question about this one.

Does TestNG set a default thread count once parallel is enabled?

I assume the problematic configuration is parallel = false + any  
thread count, so maybe a better alternative is to set the default, and  
manually unset it if parallel is false?

Cheers,
Brett

On 21/11/2007, at 8:58 AM, dfabulich@apache.org wrote:

&gt; Author: dfabulich
&gt; Date: Tue Nov 20 16:58:42 2007
&gt; New Revision: 596894
&gt;
&gt; URL: http://svn.apache.org/viewvc?rev=596894&amp;view=rev
&gt; Log:
&gt; [SUREFIRE-361] Don't set threadcount or parallel by default; these  
&gt; defaults confuse TestNG 5.7
&gt;
&gt; Modified:
&gt;    maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/ 
&gt; apache/maven/plugin/surefire/SurefirePlugin.java
&gt;
&gt; Modified: maven/surefire/trunk/maven-surefire-plugin/src/main/java/ 
&gt; org/apache/maven/plugin/surefire/SurefirePlugin.java
&gt; URL: http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java?rev=596894&amp;r1=596893&amp;r2=596894&amp;view=diff
&gt; = 
&gt; = 
&gt; = 
&gt; = 
&gt; = 
&gt; = 
&gt; = 
&gt; = 
&gt; ======================================================================
&gt; --- maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/ 
&gt; apache/maven/plugin/surefire/SurefirePlugin.java (original)
&gt; +++ maven/surefire/trunk/maven-surefire-plugin/src/main/java/org/ 
&gt; apache/maven/plugin/surefire/SurefirePlugin.java Tue Nov 20 16:58:42  
&gt; 2007
&gt; @@ -328,7 +328,7 @@
&gt;      * (TestNG only) The attribute thread-count allows you to  
&gt; specify how many threads should be allocated for this execution. Only
&gt;      * makes sense to use in conjunction with parallel.
&gt;      *
&gt; -     * @parameter expression="${threadCount}" default-value="5"
&gt; +     * @parameter expression="${threadCount}"
&gt;      */
&gt;     private int threadCount;
&gt;
&gt; @@ -337,7 +337,7 @@
&gt;      * methods that depend on each other, which will be run in the  
&gt; same thread in order to respect their order of
&gt;      * execution.
&gt;      *
&gt; -     * @parameter expression="${parallel}" default-value="false"
&gt; +     * @parameter expression="${parallel}"
&gt;      * @todo test how this works with forking, and console/file  
&gt; output parallelism
&gt;      */
&gt;     private String parallel;
&gt;
&gt;



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: maven.test.skip.exec</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200712.mbox/%3cPine.WNT.4.64.0712201622180.4596@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0712201622180-4596@sfeng02-rf-lan%3e</id>
<updated>2007-12-21T03:35:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Stephen Connolly wrote:

&gt; Can we make the property shorter and easier to remember...
&gt;
&gt; that's what I liked about the -Dtest=0 hack

Just for you, I've filed SUREFIRE-417 (Make new "skipTests" parameter to 
replace skipExec). ;-)

I've got to fix SUREFIRE-416 anyway, and I'd forgotten that this has 
always bothered me. :-)

"mvn -DskipTests" is short enough, right?  I thought about making it 
"skipTest" but I thought it might sound like we were skipping the entire 
"test" lifecycle phase...?

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>[VOTE] Release Maven Surefire version 2.4</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200712.mbox/%3cPine.WNT.4.64.0712192143290.4364@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0712192143290-4364@sfeng02-rf-lan%3e</id>
<updated>2007-12-20T06:01:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

Hi,

Maven Surefire version 2.4 is on the runway.  Hopefully folks have spent 
some time trying out the SNAPSHOT version, because we expect ordinary 
users to get auto-upgraded to version 2.4 when we decide to release.

This version fixes numerous long-outstanding bugs, notably in TestNG 
support.

We solved 71 issues: 
http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=10541&amp;styleName=Html&amp;version=13243

There are still 31 issues left in JIRA:
http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&amp;pid=10541&amp;status=1

Staging repo:
http://people.apache.org/~dfabulich/staging-repo/

Vote open for 72 hours.

[ ] +1
[ ] +0
[ ] -1

PS This is my first call for a release.  Be gentle. ;-)


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Surefire 2.4 is coming</title>
<author><name>Brett Porter &lt;brett@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200712.mbox/%3c6927237A-FCB5-4995-B373-912AAB4CF480@apache.org%3e"/>
<id>urn:uuid:%3c6927237A-FCB5-4995-B373-912AAB4CF480@apache-org%3e</id>
<updated>2007-12-12T05:56:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On 12/12/2007, at 6:52 AM, Dan Fabulich wrote:

&gt; Brett Porter wrote:
&gt;
&gt;&gt; I'm just catching up again. I am planning to scan through all the  
&gt;&gt; commits and see if anything catches my eye. I also saw an issue  
&gt;&gt; reported on the users list that I'll drop into JIRA about the new  
&gt;&gt; code working with 2.0.6 - which versions of Maven have you been  
&gt;&gt; testing with? (I've tended to test with 2.0.4 and 2.0.6, but now  
&gt;&gt; 2.0.7 and 2.0.8 made sometimes funky changes that are worth running  
&gt;&gt; the integration tests with).
&gt;
&gt; I've been pretty much exclusively testing with 2.0.7.  I just ran  
&gt; the 2.4 integration tests with 2.0.6 and 2.0.8 with no problems.
&gt;
&gt; maven-surefire-plugin lists 2.0.6 as a prerequisite, as of revision  
&gt; 598160.  "mkleint: plexus-utils version 1.4.x means the plugins  
&gt; requires 2.0.6 at least".  Not entirely certain why that is, but  
&gt; there you have it.

2.0.6 was the first version to shade the plexus-utils dependency away  
from the plugins.

&gt;
&gt;
&gt;&gt; WDYT about continuing with the 2.3.1 release immediately, and  
&gt;&gt; giving 2.4 a short time more to simmer? If for any reason 2.4 does  
&gt;&gt; break certain builds, there is still a better-than-2.3 fallback.  
&gt;&gt; You can also use the release ann. to re-encourage testing of 2.4.
&gt;
&gt; +0 on letting 2.4 simmer; -0 on releasing 2.3.1 now.  I think I  
&gt; wouldn't want to let 2.4 simmer for more than two weeks, at the  
&gt; maximum.
&gt;
&gt; What concerns me about 2.3.1 is that it doesn't have integration  
&gt; tests like 2.4, so it's hard to know for sure whether it really *is*  
&gt; better than 2.3 or whether new bugs have creeped in.  (Surefire has  
&gt; a lot of corner cases and gotchas.)

That was kind of the intent of 2.3.1 - limited fixes for known  
regressions and small issues in 2.3... at least with the work I did on  
it I felt pretty confident. I see your point though, and I'm happy  
either way, just thought I'd throw the suggestion out there.

Cheers,
Brett


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Surefire 2.4 is coming</title>
<author><name>Dan Fabulich &lt;dan@fabulich.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200712.mbox/%3cPine.WNT.4.64.0712110958130.5080@sfeng02.rf.lan%3e"/>
<id>urn:uuid:%3cPine-WNT-4-64-0712110958130-5080@sfeng02-rf-lan%3e</id>
<updated>2007-12-11T19:52:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Brett Porter wrote:

&gt; I'm just catching up again. I am planning to scan through all the commits and 
&gt; see if anything catches my eye. I also saw an issue reported on the users 
&gt; list that I'll drop into JIRA about the new code working with 2.0.6 - which 
&gt; versions of Maven have you been testing with? (I've tended to test with 2.0.4 
&gt; and 2.0.6, but now 2.0.7 and 2.0.8 made sometimes funky changes that are 
&gt; worth running the integration tests with).

I've been pretty much exclusively testing with 2.0.7.  I just ran the 2.4 
integration tests with 2.0.6 and 2.0.8 with no problems.

maven-surefire-plugin lists 2.0.6 as a prerequisite, as of revision 
598160.  "mkleint: plexus-utils version 1.4.x means the plugins requires 
2.0.6 at least".  Not entirely certain why that is, but there you have it.

&gt; WDYT about continuing with the 2.3.1 release immediately, and giving 2.4 
&gt; a short time more to simmer? If for any reason 2.4 does break certain 
&gt; builds, there is still a better-than-2.3 fallback. You can also use the 
&gt; release ann. to re-encourage testing of 2.4.

+0 on letting 2.4 simmer; -0 on releasing 2.3.1 now.  I think I wouldn't 
want to let 2.4 simmer for more than two weeks, at the maximum.

What concerns me about 2.3.1 is that it doesn't have integration tests 
like 2.4, so it's hard to know for sure whether it really *is* better than 
2.3 or whether new bugs have creeped in.  (Surefire has a lot of corner 
cases and gotchas.)

On the other hand, I feel pretty good about 2.4-SNAPSHOT because it has 
been getting a lot of incidental testing through users who want/need 
TestNG support.  TestNG recommends using 2.4-SNAPSHOT on their website; 
pretty much everyone using TestNG and Maven has been using 2.4-SNAPSHOT 
all along.

If Surefire didn't automatically grab the latest release, I'd cheerfully 
agree to release both and let users sort out what works best for them, but 
as it stands I'd prefer to destabilize Surefire infrequently and put all 
of our testing eggs in one basket.

With that said, if there's a need for 2.3.1 [Mauro suggested he'd like it 
last week :-)] then I certainly won't stand in its way.  I'd strongly 
suggest that whoever wanted to try this should run the 2.4 integration 
tests against 2.3 and then again against 2.3.1 to identify regressions. 
Seems like a lot of trouble for not much benefit, IMO.

-Dan


</pre>
</div>
</content>
</entry>
<entry>
<title>Fwd: Backwards incompatibility with 2.0.8?</title>
<author><name>&quot;Brett Porter&quot; &lt;brett.porter@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200712.mbox/%3c9e3862d80712102217j63b5f344v16a2ea4d6b868ed0@mail.gmail.com%3e"/>
<id>urn:uuid:%3c9e3862d80712102217j63b5f344v16a2ea4d6b868ed0@mail-gmail-com%3e</id>
<updated>2007-12-11T06:17:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Guys,

This is the issue I was referring to - looks like just the classpath
ordering, and so can just be documented.

Or is that overlooking a potential issue with 2.3.1 on 2.0.6?

Cheers,
Brett

---------- Forwarded message ----------
From: Ronn.Chinowutthichai@toyota.com.au &lt;Ronn.Chinowutthichai@toyota.com.au&gt;
Date: 10 Dec 2007 16:45
Subject: Re: Backwards incompatibility with 2.0.8?
To: Maven Users List &lt;users@maven.apache.org&gt;
Cc: Maven Users List &lt;users@maven.apache.org&gt;


I've worked out what happened. Surefire 2.3.1 is not in the central
repository yet but apparantly it has been tagged
(http://jira.codehaus.org/browse/MNG-3118).

Last Friday, I've downloaded maven source and build it on my local machine
(and added apache snapshot into Artifactory). As a result, surefire
2.3.1-SNAPSHOT got into our Artifactory.

This is what I've found.

Maven 2.0.6 + surefire 2.3 works.
Maven 2.0.6 + surefire 2.3.1-SNAPSHOT doesn't work.
Maven 2.0.8 + surefire 2.3 doesn't work
Maven 2.0.8 + surefire 2.3.1-SNAPSHOT works.

I'm not sure what differences there are in surefire  2.3.1-SNAPSHOT and
2.3.1.  I can't find surefire 2.3.1 anywhere so I'll wait and see.

Thanks for your help.

Cheers,
rOnn c.





"Brett Porter" &lt;brett.porter@gmail.com&gt;
12/10/2007 11:24 AM
Please respond to
"Maven Users List" &lt;users@maven.apache.org&gt;


To
"Maven Users List" &lt;users@maven.apache.org&gt;
cc

Subject
Re: Backwards incompatibility with 2.0.8?






Your act of upgrading certainly can't have broken his environment :)

There are two possibilities:
a) something changed in a surefire snapshot. This is possible as its
under active development, though I'm not sure if new snapshots are
being deployed regularly.
b) a test was added to your environment that relied on the classpath
ordering.

b) still sounds like the most likely based on your original message -
note that 2.0.6 always had main-first ordering, while 2.0.8 has
test-first ordering.

If you have a sample case where 2.0.6 + surefire 2.3 succeeds and
2.0.6 + 2.3.1 fails, please file it in the surefire JIRA. Otherwise, I
would look at the test cases as above.

Note you can also use the enforcer to force a Maven version to require
people to upgrade to 2.0.8 - consistency is likely to give you less
headaches, though I can understand that this is not something you
would want to jump to quite so soon perhaps given it is a recent
release. I'm still using 2.0.7 myself :)

Cheers,
Brett

On 10/12/2007, Ronn.Chinowutthichai@toyota.com.au
&lt;Ronn.Chinowutthichai@toyota.com.au&gt; wrote:
&gt; Ok, but our problem is not a simple backward compatibility.
&gt;
&gt; I was  working on project A on my machine. I upgraded to 2.0.8. Nothing
&gt; breaks here but it it break then fair enough.
&gt;
&gt; A colleauge was working on project B and still using 2.0.6.
&gt;
&gt; Some how my action of upgrading to 2.0.8 in my machine has cause his
build
&gt; environment  to break in his  machine.
&gt;
&gt; Both build machine uses surefire 2.3.1-SNAPSHOT. So perhaps surefure
2.3.1
&gt; doesn't work with Maven 2.0.6 ?
&gt;
&gt;
&gt; rOnn c.
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; "Brett Porter" &lt;brett.porter@gmail.com&gt;
&gt; 12/10/2007 10:42 AM
&gt; Please respond to
&gt; "Maven Users List" &lt;users@maven.apache.org&gt;
&gt;
&gt;
&gt; To
&gt; "Maven Users List" &lt;users@maven.apache.org&gt;
&gt; cc
&gt;
&gt; Subject
&gt; Re: Backwards incompatibility with 2.0.8?
&gt;
&gt;
&gt;
&gt;
&gt;
&gt;
&gt; No, it's because 2.0.8 is not backwards compatible with 2.0.6, as
&gt; documented in the release notes.
&gt;
&gt; On 10/12/2007, Michael McCallum &lt;gholam@apache.org&gt; wrote:
&gt; &gt; its just coincidental that surefire 2.3.1 was released at the same
time
&gt; as
&gt; &gt; 2.0.8...
&gt; &gt;
&gt; &gt; if you specify surefire 2.3 or less in you pluginManagement then the
&gt; tests
&gt; &gt; will start working again... of course its best practice to specify
&gt; plugin
&gt; &gt; versions anyway so magic upgrades don't break things
&gt; &gt;
&gt; &gt; On Mon, 10 Dec 2007 12:30:25 Ronn.Chinowutthichai@toyota.com.au wrote:
&gt; &gt; &gt; We were using maven 2.0.6 in a team with Artifactory as a proxy.
&gt; &gt; &gt;
&gt; &gt; &gt; I then upgrade my environment to 2.0.8. A whole bunch of new plugins
&gt; get
&gt; &gt; &gt; fetched.
&gt; &gt; &gt;
&gt; &gt; &gt; Other people were using 2.0.6 but it appears that they also get a
&gt; whole
&gt; &gt; &gt; heap of new plugins.
&gt; &gt; &gt;
&gt; &gt; &gt; As a result, test cases in another project which had worked before
now
&gt; &gt; &gt; failed for people running 2.0.6. It appears that the problem is with
&gt; &gt; &gt; classpath ordering - for some reason with 2.0.6 and the new bunch of
&gt; &gt; &gt; plugins, src/main/resources gets picked up before src/test/resources
&gt; and
&gt; &gt; &gt; so it doesn't load the resources for test cases.
&gt; &gt; &gt;
&gt; &gt; &gt; So what happens now is that everyone has to abandon 2.0.6 to 2.0.8.
&gt; &gt; &gt;
&gt; &gt; &gt; Can someone offer any explanation how this could happen?
&gt; &gt; &gt;
&gt; &gt; &gt; It concerns me that someone running 2.0.6 would now be forced to
move
&gt; to
&gt; &gt; &gt; 2.0.8 simply because I decided to upgrade to 2.0.8 in my own
&gt; environment
&gt; &gt; &gt; and project? Is the automatic plugin update a problem here?
&gt; &gt; &gt;
&gt; &gt; &gt; I don't understand how automatic plugin update works but how would
one
&gt; &gt; &gt; guarantee repeatable builds ? esp with the releases that have been
&gt; tagged
&gt; &gt; &gt; and potentailly checked out for build later.
&gt; &gt; &gt;
&gt; &gt; &gt;
&gt; &gt; &gt; rOnn c.
&gt; &gt; &gt;
######################################################################
&gt; &gt; &gt; DISCLAIMER:
&gt; &gt; &gt; This email and any attachment may contain confidential information.
&gt; &gt; &gt; If you are not the intended recipient you are not authorized to copy
&gt; &gt; &gt; or disclose all or any part of it without the prior written consent
&gt; &gt; &gt; of Toyota.
&gt; &gt; &gt;
&gt; &gt; &gt; Opinions expressed in this email and any attachments are those of
the
&gt; &gt; &gt; sender and not necessarily the opinions of Toyota.
&gt; &gt; &gt; Please scan this email and any attachment(s) for viruses.
&gt; &gt; &gt; Toyota does not accept any responsibility for problems caused by
&gt; &gt; &gt; viruses, whether it is Toyota's fault or not.
&gt; &gt; &gt;
######################################################################
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; &gt; --
&gt; &gt; Michael McCallum
&gt; &gt; Enterprise Engineer
&gt; &gt; mailto:gholam@apache.org
&gt; &gt;
&gt; &gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
&gt; &gt; For additional commands, e-mail: users-help@maven.apache.org
&gt; &gt;
&gt; &gt;
&gt;
&gt;
&gt; --
&gt; Brett Porter
&gt; Blog: http://www.devzuz.org/blogs/bporter/
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
&gt; For additional commands, e-mail: users-help@maven.apache.org
&gt;
&gt;
&gt;
&gt; ######################################################################
&gt; DISCLAIMER:
&gt; This email and any attachment may contain confidential information.
&gt; If you are not the intended recipient you are not authorized to copy
&gt; or disclose all or any part of it without the prior written consent
&gt; of Toyota.
&gt;
&gt; Opinions expressed in this email and any attachments are those of the
&gt; sender and not necessarily the opinions of Toyota.
&gt; Please scan this email and any attachment(s) for viruses.
&gt; Toyota does not accept any responsibility for problems caused by
&gt; viruses, whether it is Toyota's fault or not.
&gt; ######################################################################
&gt;


--
Brett Porter
Blog: http://www.devzuz.org/blogs/bporter/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org



######################################################################
DISCLAIMER:
This email and any attachment may contain confidential information.
If you are not the intended recipient you are not authorized to copy
or disclose all or any part of it without the prior written consent
of Toyota.

Opinions expressed in this email and any attachments are those of the
sender and not necessarily the opinions of Toyota.
Please scan this email and any attachment(s) for viruses.
Toyota does not accept any responsibility for problems caused by
viruses, whether it is Toyota's fault or not.
######################################################################


-- 
Brett Porter
Blog: http://www.devzuz.org/blogs/bporter/


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Running a single test in a reactor</title>
<author><name>Brett Porter &lt;brett@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200712.mbox/%3cA4D362F4-3DBA-4BCA-B81E-F1A15E7F6FDA@apache.org%3e"/>
<id>urn:uuid:%3cA4D362F4-3DBA-4BCA-B81E-F1A15E7F6FDA@apache-org%3e</id>
<updated>2007-12-11T06:03:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'd go with (1). I expect it will be clear enough why it's failing so  
people will pick up the new usage fast enough. Can you mention the  
"failIfNoTests=false" flag in the error message? (I assume the true is  
a typo below?)

(3) is a possibility, but you can't really detect if tests are run at  
"some point" as you say other than externally gathering the info in  
surefire by aggregating the results. Sounds like more work than its  
worth.

- Brett

On 11/12/2007, at 7:02 AM, Dan Fabulich wrote:

&gt;
&gt; SUREFIRE-350 suggests that "if test parameter is provided, and no  
&gt; match is found, an error should occur, not a successful build with 0  
&gt; tests."  That made sense to me, so I checked in a fix in revision  
&gt; 597952.
&gt;
&gt; However, I discovered that this broke a certain maybe-standard  
&gt; usage: if you've got a parent aggregator POM and two children "foo"  
&gt; and "bar" running in a reactor, you used to be able to say - 
&gt; Dtest=BarTest; we'd compile foo and run no tests in foo, then run  
&gt; BarTest in bar.
&gt;
&gt; This usage very convenient, because you don't have to know that  
&gt; BarTest is in the bar module; you can just kick off the tests from  
&gt; the root module and run them in whatever module happens to contain  
&gt; them.  You could also run multiple individual tests separated by  
&gt; commas in multiple projects.
&gt;
&gt; Now, if you try to run that line from the parent, you'll get a build  
&gt; failure in foo, because BarTest isn't defined in foo.
&gt;
&gt; I can think of a number of different possible options here.
&gt;
&gt; 1) Leave the code as is.  Just because it's convenient doesn't mean  
&gt; it's important and we have to preserve it.
&gt;
&gt; 2) Go back and "unfix" SUREFIRE-350.
&gt;
&gt; Notably, in order to fix SUREFIRE-350, I added a new plugin  
&gt; parameter called failIfNoTests, which would fail if no tests were  
&gt; run.  (It seemed imaginable that somebody would want to turn that on  
&gt; in a variety of cases, not just in the -Dtest case.)
&gt;
&gt; If I were to unfix SUREFIRE-350 it'd still be possible to get a  
&gt; build failure, if you wanted one really badly, by saying "mvn test - 
&gt; Dtest=FooTest -DfailIfNoTests=true".
&gt;
&gt; It's not pretty, but perhaps it's an acceptable compromise.
&gt;
&gt; 3) Try to add code that detects the reactor case and handles it.  I  
&gt; think it's not that hard to detect whether a given invocation of  
&gt; SurefirePlugin is running in a reactor (though I don't actually know  
&gt; how off-hand).  But how could I detect the case that this is meant  
&gt; to help, where you accidentally had a typo?  There's no way to  
&gt; detect whether a test got run *at some point* in the reactor, is  
&gt; there?
&gt;
&gt; -Dan



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Surefire 2.4 is coming</title>
<author><name>Brett Porter &lt;brett@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/maven-surefire-dev/200712.mbox/%3cB2E488EA-B292-41DC-BD17-E2F252F96740@apache.org%3e"/>
<id>urn:uuid:%3cB2E488EA-B292-41DC-BD17-E2F252F96740@apache-org%3e</id>
<updated>2007-12-11T05:58:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Dan!

I'm just catching up again. I am planning to scan through all the  
commits and see if anything catches my eye. I also saw an issue  
reported on the users list that I'll drop into JIRA about the new code  
working with 2.0.6 - which versions of Maven have you been testing  
with? (I've tended to test with 2.0.4 and 2.0.6, but now 2.0.7 and  
2.0.8 made sometimes funky changes that are worth running the  
integration tests with).

WDYT about continuing with the 2.3.1 release immediately, and giving  
2.4 a short time more to simmer? If for any reason 2.4 does break  
certain builds, there is still a better-than-2.3 fallback. You can  
also use the release ann. to re-encourage testing of 2.4.

And again, thanks - the quantity of work you did here was just  
awesome :)

- Brett

On 11/12/2007, at 10:25 AM, Dan Fabulich wrote:

&gt;
&gt; Surefire trunk currently depends on a couple of SNAPSHOT versions  
&gt; that we expect to be released in the next couple of days, but other  
&gt; than that, as far as I know, there's nothing else standing in the  
&gt; way of a Surefire 2.4 release.  It includes more than 50 bug fixes.
&gt;
&gt; With that said, the more testing we get for Surefire 2.4 the better,  
&gt; because (as I understand it) people are going to be auto-upgraded to  
&gt; Surefire 2.4 when it gets released; when Surefire 2.3 came out, it  
&gt; wasn't uncommon to hear people complaining that their tests used to  
&gt; work earlier in the week, but post-2.3 no longer work.
&gt;
&gt; The easiest way you can help us test Surefire is to pull down  
&gt; surefire trunk and do "mvn clean install"; that will run all of the  
&gt; Surefire integration tests.  If any of those fail, please file a bug  
&gt; with a stacktrace (and the log.txt from your surefire-integration- 
&gt; tests/target directory, if applicable).
&gt;
&gt; https://svn.apache.org/repos/asf/maven/surefire/trunk
&gt;
&gt; The second easiest way you can help test Surefire 2.4 is to try the  
&gt; latest SNAPSHOT out in various projects you support.  If you find  
&gt; that Surefire 2.4-SNAPSHOT breaks anything, file bugs and we'll try  
&gt; to address them. (Reduced test cases in the form of minimal Maven  
&gt; projects that reproduce the problem would be greatly appreciated.)
&gt;
&gt; -Dan



</pre>
</div>
</content>
</entry>
</feed>
