>>It appears you do not have your Configuration set up correctly in
StripesFilter.

   >>58     public OnwardResolution(Class<? extends ActionBean>
beanType) {

   >>59
this(StripesFilter.getConfiguration().getActionResolver().getUrlBinding(
beanType));

>>   60     }

>>-Ben

 
I think this is the same issue I was running into a couple of months
ago.  I ended up using the StripesTestFixture as Ben suggested.
 
Below is the text of the email chain from my problems a few months ago.
I hope it helps!!!
 
-Ryan
 
 
 
*************************************
*************************************
 
 
Yes, I think it depends on how you want to do your tests. If you
actually want to use Stripes' MockRoundTrip then you should try to set
up all the filters and stuff just like they'll execute inside the app
server. That will give a true indication of how everything will work. It
sounds like your case might not be that simple.

On the other hand, I just did a quick test that looks good for you. I
created an ActionBean and called an event handler that returns a
RedirectResolution and got the exception you saw that kicked off this
thread. Then I copied StripesTestFixture verbatim into my test package,
added a line that calls StripesTestFixture.getServletContext() before
creating the ActionBean and everything worked just fine. So you probably
can solve your problem just by copying a file and adding one line of
code to execute before your test suite runs.

-Ben


On Fri, Dec 19, 2008 at 7:58 AM, Oscar Westra van Holthe - Kind
<[email protected] <blocked::mailto:[email protected]> > wrote:


        On 19-12-2008 at 06:49, Asleson, Ryan wrote:
        > From what I can see there's one problem with MockRoundTrip:  I
can tell
        > it the class of the ActionBean I want to test, but I can't
pass to it an
        > instance of an ActionBean.  Instead, it seems to rely on
creating an
        > ActionBean instance when the round trip is executed.  This
doesn't work
        > for me, as I need to create an instance of the ActionBean
myself so I
        > can set mock collaborators on it.  My ActionBeans use Spring
beans, and
        > in my unit tests I mock out these Spring beans with EasyMock
and inject
        > them myself into the ActionBean under test.
        >
        > Since MockRoundTrip creates an instance of the ActionBean on
the fly,
        > and doesn't let me create my own instance of the ActionBean, I
can't set
        > mock objects on the ActionBean.
        >
        > Is this correct, and if so, can you recommend any work around?
        
        
        This is correct, but IIRC the MockROundTrip does a full cycle:
filters,
        servlets, interceptors, etc. So a correctly configured fixture
will have
        Spring inject the objects as usual -- apart from the fact that
Spring uses
        your mocked objects via EasyMock.
        
        The actual configuration for this is too long ago for me though.
        
        
        
        
        --
          ,-_  Oscar Westra van holthe - Kind
http://www.xs4all.nl/~kindop/ <blocked::http://www.xs4all.nl/~kindop/> 
         /() )
         (__ (  I love deadlines. I like the whooshing sound they make
as they fly
        =/  ()  by.  -- Douglas Adams
        
        
------------------------------------------------------------------------
------
        
        _______________________________________________
        Stripes-users mailing list
        [email protected]
<blocked::mailto:[email protected]> 
        https://lists.sourceforge.net/lists/listinfo/stripes-users
<blocked::https://lists.sourceforge.net/lists/listinfo/stripes-users> 
        



 


This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information.  Any unauthorized review, use, 
disclosure or distribution is prohibited.  If you are not the intended 
recipient, please contact the sender by phone or reply by e-mail, delete the 
original message and destroy all copies. Thank you.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to