Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

How to run JUnit4 test in Eclipse

Thread view: 
bucky - 27 Jul 2007 00:14 GMT
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.
voorth - 27 Jul 2007 09:59 GMT
> 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
bucky - 27 Jul 2007 14:19 GMT
> > 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
[quoted text clipped - 6 lines]
>
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.