javablogspot

Just another WordPress.com weblog

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:

Advertisements

One Response to “unrooted tests of junit 3.4 runner”

  1. Andrea said

    My Test class does not extend TestCase, and it uses only JUnit4 annotations, and I still have the same error

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: