You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Phil Adams <pa...@gmail.com> on 2015/09/24 16:48:57 UTC

How to run junit test suite class but still see individual test class progress information on stdout?

When I run a junit test suite class via the surefire plugin, I see only the
progress information for the test suite itself.  So if the suite contains
100 test classes, I see output like this on stdout:

Running my.package.MySuite
Tests run: 1257, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 124.971
sec - in my.package.MySuite

Results :

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

I would like to find a way to continue using the test suite class, but yet
see progress information on stdout that is similar to running the test
classes individually, like this:

    Running my.package.MyTestClass1
    Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.50
sec - in my.package.MyTestClass1
    Running my.package.MyTestClass2
    Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.25
sec - in my.package.MyTestClass2
    Running my.package.MyTestClass3
    Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.74
sec - in my.package.MyTestClass3
    ...
    Results :

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

How can this be done?

Thanks in advance for any help

-- 
Phil Adams

Re: How to run junit test suite class but still see individual test class progress information on stdout?

Posted by Phil Adams <pa...@gmail.com>.
Hi Wayne,
Thanks for the tips.  I've gone through the surefire plugin's config
documentation and the "useFile" option seems to control where the detailed
results are written (default is in target/surefire-reports/<testclass> but
if you set useFile=false, then the detailed results go to the console).   I
definitely do not want that.   I simply want the progress information to be
displayed for each individual test class as it is executed by the plugin.

After reading a little more and digging into surefire's  Junit4RunListener
class, it looks like the behavior I'm seeing is not  controlled by
surefire's run listener at all.   So that probably means that it's a
product of the default JUnit runner/listener classes.


On Thu, Sep 24, 2015 at 11:58 AM, Wayne Fay <wa...@gmail.com> wrote:

> There is probably some configuration available that will satisfy your
> needs (e.g. useFile):
> http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html
>
> If not, you may need to just cat some files under
> target/surefire-reports when your build is done.
>
> Also look here, it may be interesting for you:
> http://maven.apache.org/surefire/maven-surefire-plugin/newerrorsummary.html
>
> Wayne
>

-- 
Phil Adams

Re: How to run junit test suite class but still see individual test class progress information on stdout?

Posted by Wayne Fay <wa...@gmail.com>.
There is probably some configuration available that will satisfy your
needs (e.g. useFile):
http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html

If not, you may need to just cat some files under
target/surefire-reports when your build is done.

Also look here, it may be interesting for you:
http://maven.apache.org/surefire/maven-surefire-plugin/newerrorsummary.html

Wayne

On Thu, Sep 24, 2015 at 9:48 AM, Phil Adams <pa...@gmail.com> wrote:
> When I run a junit test suite class via the surefire plugin, I see only the
> progress information for the test suite itself.  So if the suite contains
> 100 test classes, I see output like this on stdout:
>
> Running my.package.MySuite
> Tests run: 1257, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 124.971
> sec - in my.package.MySuite
>
> Results :
>
> Tests run: 1257, Failures: 0, Errors: 0, Skipped: 1
>
> I would like to find a way to continue using the test suite class, but yet
> see progress information on stdout that is similar to running the test
> classes individually, like this:
>
>     Running my.package.MyTestClass1
>     Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.50
> sec - in my.package.MyTestClass1
>     Running my.package.MyTestClass2
>     Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.25
> sec - in my.package.MyTestClass2
>     Running my.package.MyTestClass3
>     Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.74
> sec - in my.package.MyTestClass3
>     ...
>     Results :
>
>     Tests run: 1257, Failures: 0, Errors: 0, Skipped: 1
>
> How can this be done?
>
> Thanks in advance for any help
>
> --
> Phil Adams

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