Cactus provides to you the servlet output stream so that you can make asserts on it if you like (that's in the endXXX() method). What it does not provide at the current time (see my previous mail) is for your test case to pass data using the servlet input stream. In the current version it only provides API for you to set cookies, HTTP headers or HTTP parameters, using either GET or POST methods, so yes you can simulate whatever input stream you wish. However, I agree it would be simpler in some cases to be able to directly write to the servlet input stream. Download the Cactus sample, have a look at them and post a question on this list if you want more details.
Oh yes ! That's actually number one on the list of Cactus features and I would say that's really the best feature of Cactus ... Cactus is not just a framework for unit testing server-side code, it is also a build methodology (that uses Ant and some custom Ant tasks). Please have a look at the documentation on the cactus web site to see how it works and then download and try the cactus sample that is provided with the main distribution.
Thanks. Vincent. |
Title: RE: Access to HttpServletRequest.getInputStream() in Cactus
- Creation of the Cactus user mailing list Vincent Massol
- [REPOST] Creation of the Cactus user mailing ... Vincent Massol
- Re: [REPOST] Creation of the Cactus user ... Peter Donald
- Re: [REPOST] Creation of the Cactus u... Craig R. McClanahan
- Re: [REPOST] Creation of the Cac... Vincent Massol
- Re: Access to HttpServletRequest.getInputStream() in C... Vincent Massol
- No comments on proposed datamodel package ??? Michael Gerdau
- Re: No comments on proposed datamodel package... Peter Donald
- Re: No comments on proposed datamodel pac... Nick Afshartous
- RE: Access to HttpServletRequest.getInputStream() in C... Jerome Banks
- RE: Access to HttpServletRequest.getInputStream()... Vincent Massol
- RE: Access to HttpServletRequest.getInputStream() in C... Jerome Banks
- Re: Access to HttpServletRequest.getInputStream()... Vincent Massol