ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Surette <psure...@espial.com>
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
autointrospectively.

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:
<junit>
  <test name="MyTest"/>
</junit>

...it picks up the suite and runs all three tests.

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

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:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message