Hi Andrew, > -----Original Message----- > From: Andrew Swan [mailto:[EMAIL PROTECTED] > Sent: vendredi 24 septembre 2004 01:04 > To: 'Cactus Users List' > Subject: RE: Simulating a dropped connection > > 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?
I don't know what class you mean by "multi-part request" but if it's either an interface or even a class you can create a mock for it (check easymock for example, it has an extension to create mocks out of class). All that said, it's usually a better idea to wrap the calling class by one of your class which you can often mock more easily as you control it. > > Thanks in advance, > > Andrew > > P.S. I bought your book, Vincent! :-) Very cool! :-) -Vincent > > -----Original Message----- > From: Vincent Massol [mailto:[EMAIL PROTECTED] > 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:[EMAIL PROTECTED] > > Sent: jeudi 23 septembre 2004 12:45 > > To: '[EMAIL PROTECTED]' > > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
