jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Swan" <andr...@bisinfo.com.au>
Subject RE: Simulating a dropped connection
Date Thu, 23 Sep 2004 23:03:50 GMT
I've been using MockRunner, and it seems good for normal HttpRequests.

What I'd like to know (and I hope this isn't too far off-topic) is can one
make a mock multi-part request?

Thanks in advance,

Andrew

P.S.	I bought your book, Vincent!  :-)

-----Original Message-----
From: Vincent Massol [mailto:vmassol@pivolis.com]
Sent: Thursday, 23 September 2004 9:17 PM
To: 'Cactus Users List'
Subject: RE: Simulating a dropped connection


Hi Rob,

I don't think Cactus can help here. However you should be able to do what
you wish by using MockObjects. Say you have a method called
processRequest(HttpRequest) that processes the upload. You should be able to
easily test it unitarily by using a mock HttpRequest and telling it to throw
an exception after such amount of data has been read, etc.

Cactus is about executing the tests with real objects from the container
(i.e. real HttpRequests). With Mock Objects you can simulate them. See
www.mockobjects.com (I also recommend my book JUnit in Action of course...
;-)).

Thanks
-Vincent

> -----Original Message-----
> From: Robert Godfrey [mailto:RGodfrey@buildonline.com]
> Sent: jeudi 23 septembre 2004 12:45
> To: 'cactus-user@jakarta.apache.org'
> Subject: Simulating a dropped connection
>
> Hi
>
> I've just come across cactus and was wondering whether it is possible to
> simulate a dropped connection whilst sending request data. The scenario
> I'm
> am trying to emulate is that of a large file upload (multipart request)
> that
> is terminated due to a dropped connection or a user cancelling the
> request.
> My limited understanding of Cactus (c. 2 hours) suggests that whilst I
> should be able to set up a test to simulate a multipart request, it may
> not
> be so easy to simulate a dropped connection. Does anyone have any
> suggestions? For example is there a suitable extension point within cactus
> from where one could potentially control the http connection and data
> stream
> being sent.
>
> Thanks Rob
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org


Mime
View raw message