org.testng.xml.XmlSuite.setParallel(Z)Vparameter is string and returns void

go here
http://testng.org/doc/download.html
and get the 6.1.1 testng

/* Note this method in XMLSuite */
  /**
   * Sets the parallel mode
   * @param parallel the parallel mode
   */
  public void setParallel(String parallel) {
    m_parallel = parallel;
  }


/* usable pom.xml */
<?xml version="1.0" encoding="UTF-8"?>
<!--
  The MIT License
  Copyright (c) 2009 codehaus.org.
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
 
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
 
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE. 
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>6.1.1</version>
  <packaging>jar</packaging>
  <dependencies>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>bsh</groupId>
      <artifactId>bsh</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.tools</groupId>
      <artifactId>ant</artifactId>
      <version>1.8.0</version>
    </dependency>
    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
      <version>1.5</version>
    </dependency>
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <version>1.4</version>
    </dependency>
    <dependency>
      <groupId>junit.framework</groupId>
      <artifactId>junit</artifactId>
      <version>4.7</version>
    </dependency>
  </dependencies>
</project>

make this mod to Suite3
public class Suite3 //{
    extends junit.framework.TestCase { /*MCG */

include MIT License so we dont upset benson

Martin --
______________________________________________ 
Put longwinded disclaimer here


> Date: Tue, 2 Aug 2011 10:57:16 -0600
> Subject: Re: Maven 2/3 and Cobetura plugin with both TestNG and JUnit tests 
> (with Surefire plugin configuration)
> From: lar...@gmail.com
> To: dev@maven.apache.org
> 
> On Mon, Aug 1, 2011 at 9:56 AM, Larry Shatzer, Jr. <lar...@gmail.com> wrote:
> > I want to run with both JUnit and TestNG. By removing JUnit (and the
> > tests that JUnit run), it ran just fine, as do the inverse, just JUnit
> > and no TestNG. It is the combination of both of them.
> >
> > To help, instead of having gists, I created a github project:
> > https://github.com/larrys/CoverageBug which you can fetch and run
> > locally and see exactly what I'm talking about and be able to possibly
> > tweak or debug any issues that I lack the knowledge to do.
> >
> 
> I removed cobertura out of the picture and ran emma instead, and
> produced similar results.
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.company.JUnitTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> Running com.company.TestNGTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> 
> Results :
> 
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> If I just run the test lifecycle, it will execute the tests. Somehow a
> plugin that calls the test lifecycle in Maven 3 when both TestNG and
> JUnit are configured to run have issues. I also tried the latest
> surefire plugin snapshot build (built locally), and it has no effect.
> 
> So I started going through various versions of Surefire.
> 
> 2.7.1, 2.7, 2.6, 2.5, 2.4.3, 2.4.2, and 2.4.1 had similar output as
> below (ran test phase 3 times, but still did not execute tests!):
> 
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.company.JUnitTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> Running com.company.TestNGTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> There are no tests to run.
> 
> Results :
> 
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> [INFO]
> [INFO] --- maven-surefire-plugin:2.7.1:test (test-junit) @ coveragebug ---
> [INFO] Surefire report directory:
> C:\development\coverage-bug\coveragebug\target\surefire-reports
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.company.JUnitTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> Running com.company.TestNGTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> There are no tests to run.
> 
> Results :
> 
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> [INFO]
> [INFO] --- maven-surefire-plugin:2.7.1:test (test-testng) @ coveragebug ---
> [INFO] Surefire report directory:
> C:\development\coverage-bug\coveragebug\target\surefire-reports
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> Running com.company.JUnitTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
> Running com.company.TestNGTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
> There are no tests to run.
> 
> Results :
> 
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> When I get to 2.3.1:
> 
> 
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> There are no tests to run.
> 
> Results :
> 
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> [INFO]
> [INFO] --- maven-surefire-plugin:2.3.1:test (test-junit) @ coveragebug ---
> [INFO] Surefire report directory:
> C:\development\coverage-bug\coveragebug\target\surefire-reports
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> There are no tests to run.
> 
> Results :
> 
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> [INFO]
> [INFO] --- maven-surefire-plugin:2.3.1:test (test-testng) @ coveragebug ---
> [INFO] Surefire report directory:
> C:\development\coverage-bug\coveragebug\target\surefire-reports
> 
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> There are no tests to run.
> 
> Results :
> 
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> 
> It does it three times, but does not actually show the test classes it
> is supposed to try to be running.
> 
> 2.3 has issues with TestNG:
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
> org.apache.maven.surefire.booter.SurefireExecutionException:
> org.testng.xml.XmlSuite.setParallel(Z)V; nested exception is java
> .lang.NoSuchMethodError: org.testng.xml.XmlSuite.setParallel(Z)V
> java.lang.NoSuchMethodError: org.testng.xml.XmlSuite.setParallel(Z)V
>         at 
> org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:123)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at 
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
>         at 
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:818)
> [ERROR] There are test failures.
> 
> 2.2 has other errors, and really old, so I stopped there.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
> 
                                          

Reply via email to