You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bulat Nigmatullin <b2...@rambler.ru> on 2009/10/21 14:54:05 UTC

Maven Surefire Plugin don't run JUnit tests if TestNG in dependencies

I have a project with a lot of JUnit test. Recently I've added new
dependency wich have TestNG in it's dependencies. From that moment
Surefire plugins don't run JUnit test anymore. It seems to me that
Surefire tries to find TestNG tests but not find them and don't search
for JUnit tests. Is this behaviour correct and how can i fix this?

I have the following line in log:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.117
sec

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0


Best regards,
Bulat Nigmatullin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven Surefire Plugin don't run JUnit tests if TestNG in dependencies

Posted by Anders Hammar <an...@hammar.net>.
I'd say that if it doesn't work for you and you have a project that
re-produces this, file a bug report.

/Anders

On Wed, Oct 21, 2009 at 16:16, Bulat Nigmatullin <b2...@rambler.ru> wrote:

> I need someone to prove my suspicions. Please check provided project.
>
> --
>
> Bulat Nigmatullin.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven Surefire Plugin don't run JUnit tests if TestNG in dependencies

Posted by Bulat Nigmatullin <b2...@rambler.ru>.
I need someone to prove my suspicions. Please check provided project.

--
Bulat Nigmatullin.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven Surefire Plugin don't run JUnit tests if TestNG in dependencies

Posted by Anders Hammar <an...@hammar.net>.
If you have a project to reproduce, it would be great if you created a jira
so that it could be fixed.
http://jira.codehaus.org/browse/SUREFIRE

/Anders

On Wed, Oct 21, 2009 at 15:51, Bulat Nigmatullin <b2...@rambler.ru> wrote:

> According to
>> http://maven.apache.org/plugins/maven-surefire-plugin/usage.html
>> it should work with both TestNG and JUnit.
>>
>
> I read that, but it don't true. I attached example project, that prove my
> words.
>
> I removed TestNG from dependencies.
>
> Bulat Nigmatullin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Re: Maven Surefire Plugin don't run JUnit tests if TestNG in dependencies

Posted by Bulat Nigmatullin <b2...@rambler.ru>.
> According to
> http://maven.apache.org/plugins/maven-surefire-plugin/usage.html
> it should work with both TestNG and JUnit.

I read that, but it don't true. I attached example project, that prove 
my words.

I removed TestNG from dependencies.

Bulat Nigmatullin

Re: Maven Surefire Plugin don't run JUnit tests if TestNG in dependencies

Posted by Anders Hammar <an...@hammar.net>.
According to
http://maven.apache.org/plugins/maven-surefire-plugin/usage.html
it should work with both TestNG and JUnit.

What I'm wondering about is why TestNG is getting into your classpath. Your
dependency should typically have a test scope dependency to TestNG, which
will be omitted in the transitive dependency. Something is strange here. Or
do you have a dependency to an artifact including test classes which have
compile scope dependency to TestNG?

One way to solve this is to add a dependency exclusion for TestNG on your
dependency.

/Anders

On Wed, Oct 21, 2009 at 14:54, Bulat Nigmatullin <b2...@rambler.ru> wrote:

> I have a project with a lot of JUnit test. Recently I've added new
> dependency wich have TestNG in it's dependencies. From that moment
> Surefire plugins don't run JUnit test anymore. It seems to me that
> Surefire tries to find TestNG tests but not find them and don't search
> for JUnit tests. Is this behaviour correct and how can i fix this?
>
> I have the following line in log:
>
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running TestSuite
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.117
> sec
>
> Results :
>
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>
>
> Best regards,
> Bulat Nigmatullin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>