struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <craig...@apache.org>
Subject Re: [SHALE] Using the Test Framework
Date Wed, 15 Feb 2006 22:49:10 GMT
On 2/15/06, CONNER, BRENDAN (SBCSI) <bc1378@att.com> wrote:
>
> But let's say my test executes an action method on my application's
> managed bean.  That method uses the mock objects and then tries to call
> a Session Bean to do a lookup, but it appears that the lookup fails
> because the action method is not really running in a Web Container,
> correct?  Is this all happening in stand-alone application mode?  How
> can I set up my test to run in a Web Container so that it has access to
> JNDI lookups, etc.?  Do I have to use Cactus for that?


It should be possible to use Cactus for that kind of testing, but I've never
looked how Cactus deals with JNDI lookups or session beans.

- Brendan


Craig

-----Original Message-----
> From: Gary VanMatre [mailto:gvanmatre@comcast.net]
> Sent: Tuesday, February 14, 2006 2:22 PM
> To: Struts Users Mailing List
> Subject: RE: [SHALE] Using the Test Framework
>
>
> >From: "CONNER, BRENDAN (SBCSI)" <bc1378@att.com>
> >
> > OK, sorry for being a little dense about this, but, if, for example,
> my
> > application code is referencing a FacesContext object, and my Test
> code
> > initializes MockFacesContext, what is the mechanism that makes my
> > application use the values that are in MockFacesContext? I understand
> > that MockFacesContext is a subclass of FacesContext, but I don't
> > understand how my application ends up using the values in the
> > MockFacesContext instance instead that were initialized by the test
> > case.
> >
>
> The idea is that you extend a base test case that sets up the mock
> objects.  They are scoped so that they can be referenced from test
> methods in a subclass.
>
> Take a look at the AbstractJsfTestCase
> (http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/test-framework/src
> /java/org/apache/shale/test/base/AbstractJsfTestCase.java?view=markup)
>
>
>
>
> > - Brendan
> >
>
> Gary
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message