How to run JUnit4 test in Eclipse

B

bucky

I can create a JUnit4 test case. I know it no longer extends TestCase,
but I can't figure out how to launch the test. When I go to 'run', it
does not recognize the class as a JUnitTest. The eclipse help isn't.
 
V

voorth

I can create a JUnit4 test case. I know it no longer extends TestCase,
but I can't figure out how to launch the test. When I go to 'run', it
does not recognize the class as a JUnitTest. The eclipse help isn't.

Do you have the correct version of the JUnit library on your build
path?

Did you properly annotate your test methods with "@Test"?

Henk
 
B

bucky

Do you have the correct version of the JUnit library on your build
path?

Did you properly annotate your test methods with "@Test"?

Henk

There's my problem - I didn't include an "@Test". Once I did that, the
code was recognized as a JUnit4 test case.

Using JUnit3, I had the habit of creating an empty test case and
running it, getting a error, just as a preliminary check. I tried to
do this with JUnit4, but it doesn't work that way.

Henk -- thanks for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top