Project: JDT
Bug 47316 [Junit] Add support to run/re-run an individual test which requires some setup
Reported: 2003-11-23 15:09:51 | Status: resolved fixed

(based on a discussion with Dirk) The JUnit plug-in supports to run or re-run a single test. However, this only works for simple tests which don't depend on being decorated by some setup. In the case of decorated test suites you always have to run the entire suite and you cannot run an individual test. Proposal: A decorated test suite is created in a static suite() method: class SomeTest: public static Test suite() { return new SomeSetup(new TestSuite(SomeTest.class)); } To decorate a single test method clients can provide a similar method called setUpTest: class SomeTest: public static Test setUpTest(Test someTest) { return new SomeSetup(someTest); } This method will be invoked by the JUnit run-time when someTest is about to be executed indivudually (e.g. run a single test, re-rerun a failed test). Instead of executing "someTest" the Test returned from setUpTest will be executed. I've released a first version into head, pls let me know whether this addresses your needs.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractTempTests.java