Maven and TestNG

Tagged:  •    •    •    •    •  

A while ago we switched for a couple of projects from JUnit to TestNG. Everything went fine with maven and Eclipse, but yesterday I recognized while running maven clean test that the tests where found but not executed. I got many lines like these:


Running de.ibacg.XXX.dao.jpa.test.UserDaoAndRoleDaoTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.445 sec
Running de.ibacg.XXX.dao.jpa.test.StatusProtocolEntryDaoTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
Running de.ibacg.XXX.services.provider.test.MasterDaoProviderTest
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.688 sec
...

Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

Very strange, as all these tests contain at least two test methods and are annotated with @Test on method- or class-level.

Some googling later, I found that this is a known issue with maven-surefire-plugin before version 2.3. So if you have the same issues, use a newer version of this maven plugin, at least version 2.3. But now the question is: Why decided maven to use an older version of maven-surefire-plugin? The dependencies didn't changed in the last days.

Trackback URL for this post:

http://lepetitfou.dyndns.org/home/trackback/21

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • You may link to images on this site using a special syntax

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Syndicate content