----- Original Message -----
From: "Russell Gold" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 04, 2001 4:56 PM
Subject: Re: [cactus]A Heath Robinson lash up with HttpUnit


> At 9:18 AM +0100 7/4/01, Vincent Massol wrote:
> >Regarding chaining, I absolutely do not wish to preserve any state as in
my
> >opinion any tests _must_ be independent of another. These are _unit_
test. I
> >agree that for functional and acceptance tests it is useful but not for
unit
> >tests where it is very dangerous (side effects) and breaks the model.
>
> The state is maintained in an object which is instantiated for each test,
and is therefore not maintained across tests. The intent is to verify that
you can set up a particular state in one call and use it in another, but
that is part of a single unit test.  As I say, it is not clear to me that
this is necessary for in-container tests.
>

I still don't understand why you would want to maintain a state ? Especially
as HTTP is a stateless protocol ...

Let's imagine I have a method that sets a variable in the session and I have
another method that reads it. Are you saying you want to first call the
first method and then the second ? If yes, then it is not what I call a unit
test as it involves 2 methods. In cactus, you have access to all the
implicit objects before running
your test so you can always set up the correct preconditions (session, HTTP
parameters, cookies, ...) before running the test and thus there is no need
to maintain any state.

Cheers,
Vincent

> --
> ------------------------------------------------------------------------
> Russell Gold                     | "... society is tradition and order
> [EMAIL PROTECTED]                 | and reverence, not a series of cheap
>                                  | bargains between selfish interests."
> http://www.httpunit.org          |   - Poul Anderson, "Iron"
>


Reply via email to