ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Problem with junit in ant with jdk 1.4.1
Date Tue, 19 Nov 2002 20:32:55 GMT
Off-topic, but your main() can be as simple as:

    public static void main(String[] args) {
        junit.textui.TestRunner.run(suite());
    }

and my suite() methods would be (in your case):

    public static Test suite() {
        return new TestSuite(myTest.class);
    }

and to round things up, JUnit 3.8+ doesn't require the myTest(String name)
constructor anymore.

As far are your actual problem, I haven't a clue... Sorry, --DD

-----Original Message-----
From: Steve Schlaifer [mailto:steve@kihakkt.jetcafe.org] 
Sent: Tuesday, November 19, 2002 12:14 PM
To: Ant Users List
Subject: RE: Problem with junit in ant with jdk 1.4.1

On Tue, 19 Nov 2002, Keith Hatton wrote:

> Is that "it works with any 5 of the 6" or is it actually "there's
> something different about this sixth test" ?

It works with any 5 of the 6.  Actually, the case I was testing is:

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.framework.TestResult;

public class myTest extends TestCase {

    public myTest(String name) {
        super(name);
    }

    public static Test suite() throws ClassNotFoundException {
        return new TestSuite(Class.forName("myTest"));
    }

    public void test0() { }
    public void test1() { }
    public void test2() { }
    public void test3() { }
    public void test4() { }
    public void test5() { }

    public static void main(String[] argv) throws Exception {
        Test suite = suite();
        junit.textui.TestRunner runner = new junit.textui.TestRunner();
        TestResult result = new TestResult();
        suite.run(result);
        runner.print(result);
    }
}

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message