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 / May 2007

Tip: Looking for answers? Try searching our database.

Junit teardown: how can I understand in teardown..

Thread view: 
MeMi - 22 May 2007 09:15 GMT
method if the test method I'm executing is failed or there is an
error?

Thanks, ciao
voorth - 22 May 2007 09:33 GMT
> method if the test method I'm executing is failed or there is an
> error?
>
> Thanks, ciao

The easy answer is setting a "completed" flag to true in the last line
of your test method - of course you must initialize it to false in
either its declaration or a setUp() method.

Other than that, I would say that you should take a long, hard look at
your code and decide if you really need this - are you sure you need a
different tearDown functionality if a test fails?

Henk van Voorthuijsen
Chris Dollin - 22 May 2007 10:11 GMT
> method if the test method I'm executing is failed or there is an
> error?

/Please/ don't split your sentences over the subject line like
that. It makes the body of your message incomprehensible.

| Junit teardown: how can I understand in teardown method if the
| test method I'm executing is failed or there is an error?

I've never needed to care. (Perhaps because I rarely have to
write teardowns.)

Show us your actual problem.

Signature

"We did not have time to find out everything               /A Clash of Cymbals/
we wanted to know."                                              - James Blish

Hewlett-Packard Limited registered office:                Cain Road, Bracknell,
registered no: 690597 England                                    Berks RG12 1HN

MeMi - 22 May 2007 11:08 GMT
> Show us your actual problem.

I'm using easy mock and I'd like to centralize the verify method
call.
Anyway I'll

"take a long, hard look at
your code and decide if you really need this "

as voorth told me. Thanks, ciao
Chris Dollin - 22 May 2007 11:09 GMT
>> Show us your actual problem.
>
> I'm using easy mock and I'd like to centralize the verify method
> call.

Assertions don't belong in the teardown.

Signature

"I just wonder when we're going to have to sit down and re-evaluate    /Sahara/
our decision-making paradigm."

Hewlett-Packard Limited                                          registered no:
registered office: Cain Road, Bracknell, Berks RG12 1HN          690597 England



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.