Hi,

Perhaps I am pushing the envelope with MockRoundtrip however what I 
would like to be able to do is the following "integration tests":


(1) Execute a request based on URL and have MockRoundtrip invoke the 
appropriate event handler and do whatever bean logic
e.g.  @UrlBinding("/share/{uuidRadix}/{titleUrlified}/{$event}")

In my test I do the following:

        session = new MockHttpSession(context);
        trip = new MockRoundtrip(context, "/share/3gi/_/edit", session);
        trip.execute();
        actionBean = (BaseActionBean) trip.getActionBean(actionBeanClass);

And all is well... in that the ActionBean has a Share loaded from the DB


(2) I want to now simulate a form post to this ActionBean to say make 
changes to the Share and then verify they were committed to the DB.

The problem is if I do MockRoundtrip again with the appropriate URL or 
even ActionBean class it will create a NEW ActionBean and process the 
request.  That is obviously pointless.  But if I try to re-use the 
MockRoundtrip attempting to try execute("save") results in an error 
(understandable).


So how does one use MockRoundtrip to do:

(A)  Execute initial request... get a bean, state, etc...
(B)  Execute say a "Save" request... using the previously loaded bean, 
state, etc...

I looked at extending MockRoundtrip but am unsure where to hook in to 
supply my ActionBean created in (A) when invoking execute("save") is 
done in (B).

I would imagine someone has done this before.

Thanks,

--Nikolaos


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to