This is true. I think we would want to standardize on a server, or write
utility classes to parse and normalize results.
I don't necessarily object to Mock Objects on principle, although it sounds
like a lot of work to simulate an HTTP server. I don't think I'd want to
take it on.
- Morgan
----- Original Message -----
From: "Vincent Massol" <[EMAIL PROTECTED]>
To: "Morgan Delagrange" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 11:43 AM
Subject: Re: [httpclient] unit test suite
> How do you do that ? Some server will only return a single "set-cookie"
> while other will return several. If you have a proxy in between it may
even
> change the result as proxies are allowed to rearrange headers ... ! For
> once, I don't know who you would do your setup so that your server returns
2
> cookies and even if you did the results might differ depending on the
server
> you choose for the functional tests (unless we agree to use only one).
>
> However, I agree with the webapp idea for the functional tests ... :)
>
> -Vincent
>
> ----- Original Message -----
> From: "Morgan Delagrange" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "Vincent Massol"
> <[EMAIL PROTECTED]>; "Morgan Delagrange" <[EMAIL PROTECTED]>
> Sent: Monday, August 27, 2001 5:34 PM
> Subject: Re: [httpclient] unit test suite
>
>
> > That's true, but you can achieve the same end result (e.g. verifying
that
> > setting two cookies results in two headers).
> >
> > ----- Original Message -----
> > From: "Vincent Massol" <[EMAIL PROTECTED]>
> > To: "Morgan Delagrange" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Monday, August 27, 2001 11:35 AM
> > Subject: Re: [httpclient] unit test suite
> >
> >
> > > Even with a webapp you'll not be able to implement the test I have
> > described
> > > ! :)
> > > -Vincent
> > >
> > > ----- Original Message -----
> > > From: "Morgan Delagrange" <[EMAIL PROTECTED]>
> > > To: "Vincent Massol" <[EMAIL PROTECTED]>; "Morgan Delagrange"
> > > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > > Sent: Monday, August 27, 2001 5:24 PM
> > > Subject: Re: [httpclient] unit test suite
> > >
> > >
> > > > I think Rod's solution to this problem was to provide a test webapp,
> > which
> > > > can provide feedback in much the same way as Watchdog.
> > > >
> > > > ----- Original Message -----
> > > > From: "Vincent Massol" <[EMAIL PROTECTED]>
> > > > To: "Morgan Delagrange" <[EMAIL PROTECTED]>;
> > > > <[EMAIL PROTECTED]>
> > > > Sent: Monday, August 27, 2001 11:16 AM
> > > > Subject: Re: [httpclient] unit test suite
> > > >
> > > >
> > > > > I understand very well your point but I don't think you understood
> > mine
> > > > ...
> > > > > :-)
> > > > >
> > > > > What I am saying is that unit tests are fine-grained and can
> exercise
> > > all
> > > > > needed tests. For example I don't see any unit test to verify that
> > when
> > > > the
> > > > > server returns 2 cookies in 2 different HTTP headers it works fine
!
> > > ....
> > > > > Why ? Because if you test this by hitting real servers it is going
> to
> > be
> > > > > *very* hard to simulate. In principle you'll want to exercise the
> full
> > > > > client HTTP RFC and this is going to be impossible by hitting real
> > > > servers.
> > > > > It is however very easy to do with Mock Objects.
> > > > >
> > > > > I alsol agree that we also need some coarse grain functional tests
> > which
> > > > hit
> > > > > real servers but it comes as a complement to the unit tests.
> > > > > Thanks
> > > > > -Vincent
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Morgan Delagrange" <[EMAIL PROTECTED]>
> > > > > To: "Vincent Massol" <[EMAIL PROTECTED]>;
> > > > > <[EMAIL PROTECTED]>
> > > > > Sent: Monday, August 27, 2001 5:01 PM
> > > > > Subject: Re: [httpclient] unit test suite
> > > > >
> > > > >
> > > > > > I don't think I got my point across here. I'm all in favor of
> > having
> > > > unit
> > > > > > tests. I just think that the unit tests should bang on real
> > servers,
> > > > not
> > > > > > mock objects.
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Vincent Massol" <[EMAIL PROTECTED]>
> > > > > > To: "Morgan Delagrange" <[EMAIL PROTECTED]>;
> > > > > > <[EMAIL PROTECTED]>
> > > > > > Sent: Monday, August 27, 2001 10:57 AM
> > > > > > Subject: Re: [httpclient] unit test suite
> > > > > >
> > > > > >
> > > > > > > Hi Morgan,
> > > > > > >
> > > > > > > There are 2 kinds of tests :
> > > > > > > * unit tests
> > > > > > > * functional tests
> > > > > > >
> > > > > > > I was referring to the unit tests which are supposed to fully
> test
> > > the
> > > > > > code
> > > > > > > logic. It is also easily automatable and need to be run every
> time
> > > you
> > > > > > > modify something to ensure you don't break anything. It is
quite
> > > > > > > fine-grained tests compare to functional tests.
> > > > > > >
> > > > > > > Functional tests are harder to automate but can be done (see
> > > Cactus).
> > > > > > > However, we'll have to say which test can be run on which
server
> > > > because
> > > > > > as
> > > > > > > I saw in the comment of some test Tomcat 3.x does not support
> > > OPTIONS
> > > > > > > request for example so these tests should not be executed on
> > Tomcat
> > > > 3.x,
> > > > > > ...
> > > > > > > Also we need to control the page that is hit by the test so
> we'll
> > > > > probably
> > > > > > > need to provide some test pages to deploy to the test server.
> > > > > > >
> > > > > > > I don't see what would be the problem of providing unit tests
!
> > The
> > > > more
> > > > > > > tests the better (provided they are executed all the time and
> > > > corrected
> > > > > > when
> > > > > > > modifications or new APIs are introduced). I am also a
partisan
> of
> > > > test
> > > > > > > first .... but I won't ask you to do that ... (although you
> should
> > > try
> > > > > one
> > > > > > > day, I'm sure you'll like it) :-)
> > > > > > >
> > > > > > > Thanks
> > > > > > > -Vincent
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Morgan Delagrange" <[EMAIL PROTECTED]>
> > > > > > > To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > > > > > > Sent: Monday, August 27, 2001 3:00 PM
> > > > > > > Subject: Re: [httpclient] unit test suite
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Vincent Massol wrote on 8/25/01 12:02 pm:
> > > > > > >
> > > > > > > >I think that if we wish to
> > > > > > > >provide a strong and reliable
> > > > > > > >http client framework we
> > > > > > > >ought to have a good suite of
> > > > > > > >unit test that we will enrich
> > > > > > > >as we go along and find bugs.
> > > > > > > >I have had a brief look at the
> > > > > > > >current tests and we really
> > > > > > > >need to refine them.
> > > > > > >
> > > > > > > Agreed, we could definitley use more tests.
> > > > > > >
> > > > > > > >They also rely on the
> > > > > > > >installation of a web server
> > > > > > > >on your machine which I don't
> > > > > > > >like too much as the test will
> > > > > > > >pass and fail depending on
> > > > > > > >which one you use ...
> > > > > > >
> > > > > > > Isn't that an advantage? After all, wouldn't you want to try
> > > running
> > > > > your
> > > > > > > tests on the actual server you will be communicating with?
> > > > > > >
> > > > > > > >Instead I propose to simply
> > > > > > > >use Mock Objects to provide
> > > > > > > >a reliable suite of tests,
> > > > > > > >which is independent of the
> > > > > > > >web server installed. The
> > > > > > > >principle is simple: we simply
> > > > > > > >need to create a mock
> > > > > > > >Socket class and a way to
> > > > > > > >pass this mock to the
> > > > > > > >HttpClient class. The idea is
> > > > > > > >that it is possible from our
> > > > > > > >test case to set the
> > > > > > > >behaviour that we expect
> > > > > > > >from the mock Socket class,
> > > > > > > >like what data it will return
> > > > > > > >on the output stream, ...
> > > > > > > >there is absolutely no logic in
> > > > > > > >the mock implementation,
> > > > > > > >just setters and getters.
> > > > > > >
> > > > > > > I think we want to be testing real servers, so we can uncover
a
> > > wider
> > > > > > > variety of problems.
> > > > > > >
> > > > > > > >I'll write one ASAP but I'd like
> > > > > > > >to know if I can be voted in ....
> > > > > > > >I am yearning to go forward
> > > > > > > >especially as Cactus now
> > > > > > > >relies on HttpClient.
> > > > > > >
> > > > > > > You don't need our approval to be a committer, but I don't
know
> if
> > > > this
> > > > > > > particular task is a good idea.
> > > > > > >
> > > > > > > - Morgan
> > > > > > >
> > > > > > >
> > > > > > > _________________________________________________________
> > > > > > > Do You Yahoo!?
> > > > > > > Get your free @yahoo.com address at http://mail.yahoo.com
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > _________________________________________________________
> > > > > > Do You Yahoo!?
> > > > > > Get your free @yahoo.com address at http://mail.yahoo.com
> > > > > >
> > > > > >
> > > >
> > > >
> > > > _________________________________________________________
> > > > Do You Yahoo!?
> > > > Get your free @yahoo.com address at http://mail.yahoo.com
> > > >
> > > >
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com