Bug 63702 - <junit> <batchtest> attribute "skipNonTests" ignores concrete classes that derive from classes with @Test annotated methods
Summary: <junit> <batchtest> attribute "skipNonTests" ignores concrete classes that de...
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.10.6
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2019-08-27 13:42 UTC by Tonni
Modified: 2019-08-27 13:43 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Tonni 2019-08-27 13:42:35 UTC
Consider the following files:

<batchtest todir="somedir" skipNonTests="true">
    <fileset dir="somedir2" includes="**/*.class" />

public abstract Base {
    public void doSomeTest();

public class Child extends Base {
    public void doSomeTest() {

I would expect Ant to run the doSomeTest in Child, as it's base method is annotated with @Test. When having set skipNonTests to "true", no methods in ChildTest are considered as test methods, unless explicitly annotated with @Test too.

When reading the documentation for skipNonTests, I see how this might be implemented as documented, but the behavior is different than you would expect, coming from running tests in IDEs, like Eclipse or IntelliJ IDEA, which do consider Child.doSomeTest to be a test method.