ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Surette <>
Subject Is there any way to run a single test _method_ with <junit> ?
Date Fri, 08 Feb 2002 21:37:30 GMT
I typically write a single JUnit class with several
related test methods and common setUp/tearDown methods,
and a suite method that glomps all the tests together

for instance:
class MyTest extends TestCase {
  public void testNormalRequest(){...}
  public void testSecondRequest(){...}
  public void testPreservePathInfo(){...}
  public static Test suite(return new TestSuite(MyTest.class);}

When I run junit thusly:
  <test name="MyTest"/>
</junit> picks up the suite and runs all three tests.

Is there any way to run only a single test method,
  <test name="MyTest" method="testNormalRequest"/>

The reason I want to do this is that there is some static
cruft left around by a class used by the tests which
messes up subsequent tests, so I'd like to run each
test method separately with fork='true'.

- Phil Surette

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message