Junit teardown: how can I understand in teardown..

V

voorth

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
 
C

Chris Dollin

MeMi said:
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.

--
"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
 
M

MeMi

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
 
C

Chris Dollin

MeMi said:
I'm using easy mock and I'd like to centralize the verify method
call.

Assertions don't belong in the teardown.

--
"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
 

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

Forum statistics

Threads
474,262
Messages
2,571,048
Members
48,769
Latest member
Clifft

Latest Threads

Top