maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arseniy Alekseyev (JIRA)" <>
Subject [jira] Updated: (SUREFIRE-535) surefire tries to treat nested classes, even anonymous ones, as test classes?
Date Tue, 09 Nov 2010 12:11:04 GMT


Arseniy Alekseyev updated SUREFIRE-535:

    Attachment: patch.txt

I think the "surefire-junit" plugin does not exhibit this problem. The misbehaving one is
"surefire-junit4". The problem is that it does not check whether the class has tests or not.
I think that I have fixed it (patch attached). I've looked at the Eclipse's implementation
of JUnit4 test runner and implemented test detection here in a similar way. This code is not
covered by tests, actually there are none, but one my real-life project works with this. I've
changed the dependency to Java 1.5 by the way, because JUnit4 depends on that and for convenience.

If someone authoritative approves this approach to the problem, I will cover this with unit

Please review.

> surefire tries to treat nested classes, even anonymous ones, as test classes?
> -----------------------------------------------------------------------------
>                 Key: SUREFIRE-535
>                 URL:
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 3.x support
>    Affects Versions: 2.4.2
>            Reporter: Benson Margulies
>         Attachments: patch.txt
> Given a top-level test class that inherits from TestCase.
> If it, internally, declares an anonymous class, or even a named child class, surefire
+ junit tries to run it, and fails with a warning or an initializationError. This does not
happen from the vanilla junit test runner.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message