[ http://jira.codehaus.org/browse/MSUREFIRE-174?page=comments#action_77570 ] Davy Toch commented on MSUREFIRE-174: -------------------------------------
Of course I meant 'mvn test' and not 'maven test'. > Result message of Surefire TestNG run with invalid <suiteXmlFile> not logical. > ------------------------------------------------------------------------------ > > Key: MSUREFIRE-174 > URL: http://jira.codehaus.org/browse/MSUREFIRE-174 > Project: Maven 2.x Surefire Plugin > Issue Type: Bug > Components: TestNG support > Affects Versions: 2.2 > Environment: - WinXP > - Maven 2.0.4 (with maven-surefire-plugin 2.2) > Reporter: Davy Toch > Attachments: m2-testng-example-jdk15.zip > > > 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 ) > { > throw new MojoExecutionException( "suiteXmlFiles is > configured, but there is no TestNG dependency" ); > } > 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[]{file, > testSourceDirectory.getAbsolutePath()} ); > } > } > 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'). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira