You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeff <pr...@gmail.com> on 2014/02/19 01:52:52 UTC

Help[please]: maven-surefire-plugin with TestNG group dependencies not working....

I'm having a frustrating test dependency issue and I don't know if it is my
configuration or a problem.  I've got two test classes in my maven project
using testng:6.8.7 and maven-surefire-plugin:2.16.

The first test class has the following annotation on the test *class* which
should be inherited by the test methods:

*     @Test(groups={ "functional" })*
*      public class FuncTest{...}*

on the other test *class*, I have:

*     @Test(groups={ "load" }, dependsOnGroups = { "functional" })*
*      public class LoadTest {...}*

When I run the following:

     *mvn test*

I get the error:

     *[ERROR] DependencyMap::Method LoadTest depends on nonexistent group
"functional"*

If I REMOVE the "dependsOnGroups..." it works.  If I do any of the
following but keep the "dependsOnGroups" option:

    * mvn test -Dtest=LoadTest,FuncTest*
    * mvn test -Dgroups=functional,load*
    * mvn test -Dgroups=functional,load **-Dtest=LoadTest,FuncTest*

it fails with the error above.  If I run it outside of Maven by calling
org.testng.TestNG directly, it works fine.

I also tried moving the group definitions/dependencies to the test method
directly, but that didn't change.

*What am I missing?  *

Thanks!

-- 
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

Re: Help[please]: maven-surefire-plugin with TestNG group dependencies not working....

Posted by Jeff <pr...@gmail.com>.
Anyone have similar issues running tests w/ group dependencies?


On Tue, Feb 18, 2014 at 5:52 PM, Jeff <pr...@gmail.com> wrote:

> I'm having a frustrating test dependency issue and I don't know if it is
> my configuration or a problem.  I've got two test classes in my maven
> project using testng:6.8.7 and maven-surefire-plugin:2.16.
>
> The first test class has the following annotation on the test *class* which
> should be inherited by the test methods:
>
> *     @Test(groups={ "functional" })*
> *      public class FuncTest{...}*
>
> on the other test *class*, I have:
>
> *     @Test(groups={ "load" }, dependsOnGroups = { "functional" })*
> *      public class LoadTest {...}*
>
> When I run the following:
>
>      *mvn test*
>
> I get the error:
>
>      *[ERROR] DependencyMap::Method LoadTest depends on nonexistent group
> "functional"*
>
> If I REMOVE the "dependsOnGroups..." it works.  If I do any of the
> following but keep the "dependsOnGroups" option:
>
>     * mvn test -Dtest=LoadTest,FuncTest*
>     * mvn test -Dgroups=functional,load*
>     * mvn test -Dgroups=functional,load **-Dtest=LoadTest,FuncTest*
>
> it fails with the error above.  If I run it outside of Maven by calling
> org.testng.TestNG directly, it works fine.
>
> I also tried moving the group definitions/dependencies to the test method
> directly, but that didn't change.
>
> *What am I missing?  *
>
> Thanks!
>
> --
> Jeff Vincent
> See my LinkedIn profile at:
> http://www.linkedin.com/in/rjeffreyvincent
>



-- 
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent