TestNG and Maven not working with current snapshot

69 views
Skip to first unread message

Jason Porter

unread,
Nov 24, 2007, 11:16:47 AM11/24/07
to testng...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Alex, any idea on this one? Am I just a moron and can't configure my
pom correctly?

Maven output:

Scanning for projects...
-
----------------------------------------------------------------------------
Building ClassResourceBundle
task-segment: [test]
-
----------------------------------------------------------------------------
project-execute
artifact org.apache.maven.plugins:maven-resources-plugin: checking for
updates from netbeansIDE-repo-internal
artifact org.apache.maven.plugins:maven-compiler-plugin: checking for
updates from netbeansIDE-repo-internal
[resources:resources]
Using default encoding to copy filtered resources.
[compiler:compile]
Compiling 1 source file to
/home/jason/NetBeansProjects/ClassResourceBundle/target/classes
[resources:testResources]
Using default encoding to copy filtered resources.
[compiler:testCompile]
Compiling 1 source file to
/home/jason/NetBeansProjects/ClassResourceBundle/target/test-classes
[surefire:test]
Surefire report directory:
/home/jason/NetBeansProjects/ClassResourceBundle/target/surefire-reports
org.apache.maven.surefire.booter.SurefireExecutionException: Unable to
find appropriate constructor to create suite:
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.<init>(java.io.File,
java.util.ArrayList, java.util.ArrayList, java.lang.String,
java.lang.String, java.util.Properties); nested exception is
java.lang.NoSuchMethodException:
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.<init>(java.io.File,
java.util.ArrayList, java.util.ArrayList, java.lang.String,
java.lang.String, java.util.Properties); nested exception is
org.apache.maven.surefire.testset.TestSetFailedException: Unable to find
appropriate constructor to create suite:
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.<init>(java.io.File,
java.util.ArrayList, java.util.ArrayList, java.lang.String,
java.lang.String, java.util.Properties); nested exception is
java.lang.NoSuchMethodException:
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.<init>(java.io.File,
java.util.ArrayList, java.util.ArrayList, java.lang.String,
java.lang.String, java.util.Properties)
org.apache.maven.surefire.testset.TestSetFailedException: Unable to find
appropriate constructor to create suite:
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.<init>(java.io.File,
java.util.ArrayList, java.util.ArrayList, java.lang.String,
java.lang.String, java.util.Properties); nested exception is
java.lang.NoSuchMethodException:
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.<init>(java.io.File,
java.util.ArrayList, java.util.ArrayList, java.lang.String,
java.lang.String, java.util.Properties)
java.lang.NoSuchMethodException:
org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.<init>(java.io.File,
java.util.ArrayList, java.util.ArrayList, java.lang.String,
java.lang.String, java.util.Properties)
at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getConstructor(Class.java:1657)
at
org.apache.maven.surefire.Surefire.instantiateObject(Surefire.java:217)
at
org.apache.maven.surefire.Surefire.instantiateSuite(Surefire.java:246)
at
org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:148)
at org.apache.maven.surefire.Surefire.run(Surefire.java:111)
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:316)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:943)
- ------------------------------------------------------------------------
[ERROR]BUILD FAILURE
- ------------------------------------------------------------------------
There are test failures.

Please refer to
/home/jason/NetBeansProjects/ClassResourceBundle/target/surefire-reports
for the individual test results.
- ------------------------------------------------------------------------
Trace
org.apache.maven.BuildFailureException: There are test failures.

Please refer to
/home/jason/NetBeansProjects/ClassResourceBundle/target/surefire-reports
for the individual test results.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:631)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:551)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:530)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:309)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:276)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at
org.codehaus.mevenide.netbeans.embedder.exec.MyLifecycleExecutor.execute(MyLifecycleExecutor.java:92)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:393)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:182)
at
org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:760)
at
org.codehaus.mevenide.netbeans.execute.MavenJavaExecutor.run(MavenJavaExecutor.java:196)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test
failures.

Please refer to
/home/jason/NetBeansProjects/ClassResourceBundle/target/surefire-reports
for the individual test results.
at
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:464)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:417)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:610)
... 11 more
- ------------------------------------------------------------------------
Total time: 4 seconds
Finished at: Sat Nov 24 09:10:21 MST 2007
Final Memory: 49M/89M
- ------------------------------------------------------------------------

- --

- -Jason Porter
Real Programmers think better when playing Adventure or Rogue.

PGP key id: 926CCFF5
PGP fingerprint: 64C2 C078 13A9 5B23 7738 F7E5 1046 C39B 926C CFF5
PGP key available at: keyserver.net, pgp.mit.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSE5vEEbDm5Jsz/URCEWEAKDGoctw6qLx9f/2p1kvimetj03i0gCg2NSG
hvWey66kGGNMds0/f6HXX2I=
=Y8fo
-----END PGP SIGNATURE-----

ClassResourceBundle.tar.bz2

Alexandru Popescu ☀

unread,
Nov 24, 2007, 11:27:24 AM11/24/07
to testng...@googlegroups.com
Jason, unfortunately I have no idea what code are you running, nor do
I have control on the maven surefire plugin, so I'm deferring this to
people having access to that code.

In my old code I have submitted there was indeed such a constructor,
but maybe somebody removed it.

./alex
--
.w( the_mindstorm )p.
TestNG co-founder
EclipseTestNG Creator

LightGuard

unread,
Nov 24, 2007, 11:27:43 AM11/24/07
to testng-users
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iD8DBQFHSE5vEEbDm5Jsz/URCEWEAKDGoctw6qLx9f/2p1kvimetj03i0gCg2NSG
> hvWey66kGGNMds0/f6HXX2I=
> =Y8fo
> -----END PGP SIGNATURE-----

Just in case anyone is wondering, I get the same errors outside of
NetBeans.

LightGuard

unread,
Nov 24, 2007, 11:37:36 AM11/24/07
to testng-users
I believe it's the current snapshot, yesterday or something I
believe. Brett's on this list right? Maybe he'll have something to
say.

On Nov 24, 9:27 am, "Alexandru Popescu ☀"
<the.mindstorm.mailingl...@gmail.com> wrote:
> Jason, unfortunately I have no idea what code are you running, nor do
> I have control on the maven surefire plugin, so I'm deferring this to
> people having access to that code.
>
> In my old code I have submitted there was indeed such a constructor,
> but maybe somebody removed it.
>
> ./alex
> --
> .w( the_mindstorm )p.
> TestNG co-founder
> EclipseTestNG Creator
>
> > Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org

Alexandru Popescu ☀

unread,
Nov 24, 2007, 12:10:36 PM11/24/07
to testng...@googlegroups.com
On Nov 24, 2007 6:37 PM, LightGuard <LightG...@gmail.com> wrote:
>
> I believe it's the current snapshot, yesterday or something I
> believe. Brett's on this list right? Maybe he'll have something to
> say.
>

Yes, he is and hopefully will see this one (or maybe I can ping him
about it). However, I think there is a big timezone gap between :-).

Dan Fabulich

unread,
Nov 25, 2007, 1:00:44 AM11/25/07
to testng...@googlegroups.com

I'm actively developing Surefire 2.4 with an eye towards getting it
released soon. I've deployed a new version of the SNAPSHOT just now
(2.4-20071125.053552-17) that should work. If you see future issues, feel
free to post about it here.

Hopefully sometime this week (or next?) there will be a release of
Surefire 2.4 out and we won't have to depend on flaky snapshot versions
any more. :-)

-Dan

Andreas Guther

unread,
Nov 25, 2007, 11:11:42 AM11/25/07
to testng...@googlegroups.com
Thanks for the update and for working on that!  I am looking forward to the Surefire 2.4 release.

Andreas

LightGuard

unread,
Nov 25, 2007, 3:43:21 PM11/25/07
to testng-users
That must have been what I got last night. I deleted all of the
surefire jars, pom, etc from my local repository and everything worked
just fine. Thanks! I'll let you know Dan if I have any other issues
with it.

Andreas Guther

unread,
Nov 25, 2007, 10:50:11 PM11/25/07
to testng...@googlegroups.com
Dan,

would you mind adding to your post the SNAPSHOT repository configuration to download the SNAPSHOT dependency?

Andreas


On Nov 24, 2007 10:00 PM, Dan Fabulich < d...@fabulich.com> wrote:

Dan Fabulich

unread,
Nov 26, 2007, 3:05:13 AM11/26/07
to testng...@googlegroups.com
Andreas Guther wrote:

> would you mind adding to your post the SNAPSHOT repository configuration to
> download the SNAPSHOT dependency?

The instructions for using the Surefire 2.4 SNAPSHOT are the same as
what's on the TestNG website:

http://testng.org/doc/maven.html

The only minor difference is that you should be able to successfully use
TestNG 5.7 with the 2.4 SNAPSHOT now that 5.7 is in the central
repository.

Once 2.4 is released, all you'll need to do is depend on TestNG and the
magical Surefire fairies will run your tests with the version of TestNG
you declared in your POM.

-Dan

Mark Derricutt

unread,
Nov 26, 2007, 3:06:56 AM11/26/07
to testng...@googlegroups.com
Do the surefire fairies fully support custom listeners/reporters etc.?


On 11/26/07, Dan Fabulich <d...@fabulich.com > wrote:

Once 2.4 is released, all you'll need to do is depend on TestNG and the
magical Surefire fairies will run your tests with the version of TestNG
you declared in your POM.

--
Ambition is the last refuge of failure

Dan Fabulich

unread,
Nov 26, 2007, 3:11:30 AM11/26/07
to testng...@googlegroups.com
Mark Derricutt wrote:

> Do the surefire fairies fully support custom listeners/reporters etc.?

Surefire 2.4 supports passing arbitrary options in a <properties> map;
we'll pass those options along to TestNG.configure. That will support
anything you can do on the command line.

So, yes. :-)

-Dan

Erez Nahir

unread,
Nov 26, 2007, 10:04:06 AM11/26/07
to testng-users
Hi All,

I wonder if maven-surefire-report-plugin will also be updated? Last
time I played with maven/testng, I could not see skipped test on
surefire reports.
Would be nice also to show test's description.

Thanks,
Erez.

Dan Fabulich

unread,
Nov 26, 2007, 6:25:35 PM11/26/07
to testng-users
Erez Nahir wrote:

> I wonder if maven-surefire-report-plugin will also be updated?

Yes, it will.

> Last time I played with maven/testng, I could not see skipped test on
> surefire reports.

That's bug SUREFIRE-303: http://jira.codehaus.org/browse/SUREFIRE-303

Shockingly, there is no standard way to represent ignored/skipped tests in
JUnit XML. (TestNG currently handles it by inserting an empty <skipped/>
element in the <testcase> element; most reporting tools treat the test
case as if it had passed.)

I'm trying to get to the bottom of this, but it may not be resolved before
2.4 is released.

> Would be nice also to show test's description.

Interesting idea. Where would you show it? The report is already pretty
packed as it is...?

-Dan

Erez Nahir

unread,
Nov 27, 2007, 4:08:12 AM11/27/07
to testng-users
My suggestion would be to place it between the test name and test
duration (time column) on the test level only.

Thanks,
Erez.
Reply all
Reply to author
Forward
0 new messages