Can't run project that includes both Junit and TestNG testcases in surefire using 2 executions. -----------------------------------------------------------------------------------------------
Key: MCOBERTURA-136 URL: http://jira.codehaus.org/browse/MCOBERTURA-136 Project: Maven 2.x Cobertura Plugin Issue Type: Bug Affects Versions: 2.4 Environment: Surefire with Junit and TestNG using 2 executions for Surefire Reporter: Alan Roche My project needs to use both Junit and TestNG. I have surefire set up to successfully run Junit and TestNG tests with 2 executions. This setup is described here: http://confluence.highsource.org/display/~lexi/How+to+run+both+JUnit+and+TestNG+with+maven-surefire-plugin Cobertura works with either of the 2 executions on their own, but not with both enabled at the same time. ie. If I comment one out, it works. I have a testSuiteXml configuration for the testNG execution listing my testng suite files. The error referes to the testSuiteXml being a problem, but I think this is misleading. As I say, I can run testng or junit if the other is commented out. I can run both when cobertura is not included. I get the following error: -------------------------------------------------------------------------------------- Cobertura: Saved information on 50 classes. Instrument time: 407ms [INFO] Instrumentation was successful. [INFO] [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ core --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] Copying 5 resources [INFO] [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ core --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ core --- [INFO] Surefire report directory: /home/alan/dev/workspaces/plumbunit/core/target/surefire-reports [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.681s [INFO] Finished at: Sun Feb 13 23:42:33 GMT 2011 [INFO] Final Memory: 15M/79M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project core: suiteXmlFiles is configured, but there is no TestNG dependency -> [Help 1] ----------------------------------------------------------- My Maven plugin config is below: ... <surefire.version>2.7.2</surefire.version> <cobertura.version>2.4</cobertura.version> ... <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>${cobertura.version}</version> <configuration> <instrumentation> </instrumentation> <check> <branchRate>85</branchRate> <lineRate>85</lineRate> <haltOnFailure>true</haltOnFailure> <totalBranchRate>85</totalBranchRate> <totalLineRate>85</totalLineRate> <packageLineRate>85</packageLineRate> <packageBranchRate>85</packageBranchRate> <regexes> <regex> <pattern>org.*</pattern> <branchRate>90</branchRate> <lineRate>80</lineRate> </regex> </regexes> </check> </configuration> <executions> <execution> <goals> <goal>clean</goal> <goal>check</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${surefire.version}</version> <executions> <execution> <id>test-junit</id> <phase>test</phase> <goals> <goal>test</goal> </goals> <configuration> <testNGArtifactName>none:none</testNGArtifactName> </configuration> </execution> <execution> <id>test-testng</id> <phase>test</phase> <goals> <goal>test</goal> </goals> <configuration> <systemProperties> <property> <name>net.sourceforge.cobertura.datafile</name> <value>target/cobertura/cobertura.ser</value> </property> </systemProperties> <junitArtifactName>none:none</junitArtifactName> <suiteXmlFiles> <suiteXmlFile>${basedir}/src/test/resources/META-INF/testng/core.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </execution> </executions> </plugin> </plugins -- 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 --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email