javablogspot

Just another WordPress.com weblog

Archive for the ‘Junit’ Category

unrooted tests of junit 3.4 runner

Posted by damuchinni on March 14, 2009

When using Eclipse 3.3 or above, By the default, the JUnit 4 test runner will be used. In the olden days, with Eclipse 3.0 and JUnit 3.8, user could select a single test method in the Outline view and run just that method. However, when try to do that in Eclipse 3.3 or above. It’s test runner runs all the tests in the class. The results are shown in a tree, and the tests I didn’t ask to be run are all under a node called “Unrooted Tests [Runner: JUnit 4]”.

The problem is because,your class extends TestCase (in Junit 3.8 favior,not use the 4.0 annotation), but eclispe will Using the JUnit 4 runner by the default which causes that unrooted test. if you want to use the old Junit 3.8 runner for your 3.8 testcase. you have change the run configurations manually.

the old Junit 3.8 runner will show up after that:

Posted in IDEs, Junit | Tagged: , , | 1 Comment »