>> there's no current implementatino of things like MockPageContext

Craig, there is one in the Spring Framework library. :) Spring contains mocks
of the servlet api. The library doesn't depend on Spring, but they have 
their own mocks. Spring uses the MockPageContext to write unit tests for 
their tag libraries. Greg I recommend you look into this.

Paul

--- Craig McClanahan <[EMAIL PROTECTED]> wrote:

> On 3/22/06, Greg Reddin <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Mar 21, 2006, at 6:04 PM, Craig McClanahan wrote:
> >
> > > For a library claiming to be "standalone", I would be a little
> > > cautious
> > > about depending on either set of mock object APIs.
> >
> > Certainly, no such dependencies should be in the core software, but
> > dependencies in the test cases are acceptable, right?  I suppose we
> > could modify the existing tests to use mock implementations of the
> > context once we get that figured out.  Even so, context
> > implementations that work with Servlet API, Faces, Portlet, etc. will
> > need tests.  Does all that stuff need to be optional?
> 
> 
> I was rambling a bit in that paragraph (and I seem to have changed my mind
> about half way through :-) ... let me try to be a little clearer.
> 
> The Shale test framework classes include mock implementations of essentially
> all APIs in the servlet spec (as well as JSF, but that's not really relevant
> here).  As such, it can be used as a source of things like
> MockServletContext, MockHttpServletRequest, and so on.  It *should* be
> possible to use this jar file for Tiles tests, even if you don't have
> jsf-api.jar in the classpath, as long as you don't try to use things like
> MockFacesContext.  The end result is we should be able to construct JUnit
> based tests for nearly everything in standalone Tiles, without the
> complexity of Cactus tests.  (For in container testing, I prefer to set up a
> "real" app and then exercise it with things like HtmlUnit.)
> 
> The only place it might fall down a little for you is in testing custom tags
> ... there's no current implementatino of things like MockPageContext.
> That's a solvable problem, though, by just writing a few more classes.
> 
> Greg
> 
> 
> Craig
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to