You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "arka.sharma" <ar...@gmail.com> on 2011/09/27 08:50:40 UTC

Maven fails to run junit test sources.

Hi,

I have some classes and some junit test classes for them.I'm running the
junit test which is working fine in eclipse.I have also created a maven
quickstart archetype.Inside "main > java " i have put my source for java
code and inside "test > java " i have kept junit test classes.But when I try
to run

"mvn test" or "mvn cobertura:cobertura" it is showing the following messgae


"Tests in error:
com.sdp.dao.test.DfSubscriberDaoTest
com.sdp.dao.test.DfSubscriberDaoTest

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

Also junit dependency in pom is having the same version 4.8.2 what i'm using
inside eclipse.

Thanks,
Arka

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-fails-to-run-junit-test-sources-tp4844249p4844249.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven fails to run junit test sources.

Posted by Andy Glick <an...@gmail.com>.
You might want to try the following:

if you don't already have a global pom properties tag you would add one. 
Then in the body of the properties tag you would add the following 2 
tags and their values:

<properties>
<surefire.useFile>false</surefire.useFile>
<surefire.reportFormat>plain</surefire.reportFormat>
</properties>

If I remember correctly, the surefire plugin will honor these properties 
unless you have overridden them in your surefire plugin configuration. 
It provides a simple mechanism to get an idea of what surefire/junit is 
doing without actually adding a surefire declaration to your build 
section at all.

Alternatively, you could add the tags:

<configuration>
<userFile>false<useFile>
<reportFormat>plain</reportFormat>
</configuration>

to the configuration section of your surefire plugin declaration, if you 
have one.

I prefer to set the properties at the global properties level as it 
saves me the expense of including the surefire plugin declaration.

On 9/27/11 3:26 AM, arka.sharma wrote:
> *Surefire Report
> Summary
>
> Tests	Errors 	Failures	Skipped	Success Rate	Time
> 0	0	0	0	0%	0
>
> Note: failures are anticipated and checked for with assertions while errors
> are unanticipated.*
>
> This is the report t*arget/site/surefire-report.html* after doing  *mvn
> surefire-report:report-only*
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-fails-to-run-junit-test-sources-tp4844249p4844334.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


Re: Maven fails to run junit test sources.

Posted by "arka.sharma" <ar...@gmail.com>.
*Surefire Report
Summary

Tests	Errors 	Failures	Skipped	Success Rate	Time
0	0	0	0	0%	0

Note: failures are anticipated and checked for with assertions while errors
are unanticipated.*

This is the report t*arget/site/surefire-report.html* after doing  *mvn
surefire-report:report-only* 

--
View this message in context: http://maven.40175.n5.nabble.com/Maven-fails-to-run-junit-test-sources-tp4844249p4844334.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven fails to run junit test sources.

Posted by Barrie Treloar <ba...@gmail.com>.
On Tue, Sep 27, 2011 at 4:20 PM, arka.sharma <ar...@gmail.com> wrote:
> Hi,
>
> I have some classes and some junit test classes for them.I'm running the
> junit test which is working fine in eclipse.I have also created a maven
> quickstart archetype.Inside "main > java " i have put my source for java
> code and inside "test > java " i have kept junit test classes.But when I try
> to run
>
> "mvn test" or "mvn cobertura:cobertura" it is showing the following messgae
>
>
> "Tests in error:
> com.sdp.dao.test.DfSubscriberDaoTest
> com.sdp.dao.test.DfSubscriberDaoTest
>
> Tests run: 2, Failures: 0, Errors: 2, Skipped: 0"
>
> Also junit dependency in pom is having the same version 4.8.2 what i'm using
> inside eclipse.

Have you run
  mvn surefire-report:report-only
(see http://maven.apache.org/plugins/maven-surefire-report-plugin/report-only-mojo.html)

And looked at
  target/site/surefire-report.html
to see why these are failing?

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