ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 34748] [PATCH] JUnit Task enhancement to allow a single test method to be specified
Date Fri, 25 Apr 2008 19:32:51 GMT

--- Comment #11 from Jesse Glick <>  2008-04-25 12:32:50 PST ---
If you have

public class MyTest extends TestCase {
    public void test1() {...}
    public void test2() {...}

then it makes sense to ask to run test1 by itself, or test2 by itself; the
implicit default suite being run is test1 followed by test2, which the
environment is just overriding. But if you have

public class MyTest extends TestCase {
    public MyTest(String n) {
    public static Test suite() {
        TestSuite suite = new TestSuite();
        suite.addTest(new MyTest("one"));
        suite.addTest(new MyTest("two"));
        // stuff in other classes too, maybe parametrized:
        suite.addTest(new MyOtherTestSuite());
        return suite;
    public void one() {...}
    /* expected to be run immediately after one() */
    public void two() {...}

then the suite() method gives the definitive answer to what tests should be run
and in which order. In this case it is senseless to try to run a single test
method from the environment.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message