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