ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
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
https://issues.apache.org/bugzilla/show_bug.cgi?id=34748





--- Comment #11 from Jesse Glick <jglick@netbeans.org>  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) {
        super(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: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message