Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0 (2.2 plugin)
-
Fix Version/s: 2.4
-
Component/s: TestNG support
-
Labels:None
-
Environment:- WinXP
- Maven 2.0.4 (with maven-surefire-plugin 2.2)
-
Testcase included:yes
-
Number of attachments :
Description
When performing a Surefire TestNG run on Java 1.5 annotated test classes with pom.xml
containing an incorrect testng suite configuration (e.g. pointing to inexisting file blieblie.xml),
the run won't fail but instead will generate the following result:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
There are no tests to run.
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
The problem lies in:
plugins\maven-surefire-plugin\src\main\java\org\apache\maven\plugin\surefire\SurefirePlugin.java (lines around line 500)
if ( suiteXmlFiles != null && suiteXmlFiles.length > 0 )
{
if ( testNgArtifact == null )
for ( int i = 0; i < suiteXmlFiles.length; i++ )
{
File file = suiteXmlFiles[i];
if ( file.exists() )
{
surefireBooter.addTestSuite( "org.apache.maven.surefire.testng.TestNGXmlTestSuite",
new Object[]
);
}
}
If file.exists() returns false, then an Exception should be thrown.
Remark that with JDK1.4 JavaDoc annotated classes, the same problem arises, as well as another problem
indicated in http://jira.codehaus.org/browse/MSUREFIRE-173 .
An example is included to illustrate the problem (just run 'maven test').
Of course I meant 'mvn test' and not 'maven test'.