Yes, I figured doing a trace and see how things happen would answer a
lot of questions. So, I'll try that.

>From looking at the DefaultActionProxy constructor, it does make sense
to start with the actionproxy. The proxy gets an action invocation as
a constructor parameter. So the invocation instantiation should be
coming shortly after that.

On Wed, Jul 22, 2009 at 4:17 PM, Musachy Barroso<musa...@gmail.com> wrote:
> The best way to find out all these things is to put breakpoints in the
> constructor and/or the setter methods.
>
> musachy
>
> On Wed, Jul 22, 2009 at 2:05 PM, Dimitrios
> Christodoulakis<dimi....@gmail.com> wrote:
>> Hello,
>>
>> According to the XWork feature description,
>> http://www.opensymphony.com/xwork/wikidocs/XWork%20Features.html, the
>> ActionInvocation represents the execution state of an action holding
>> the action instance and the interceptors.
>>
>> I have been looking at
>> http://struts.apache.org/2.1.6/struts2-core/apidocs and examining an
>> implementation of the ActionInvocation interface:
>> DefaultActionInvocation and was wondering how does this class gets a
>> hold of the action instance and the interceptors? It has relevant
>> fields like action, interceptors and proxy with getters for the action
>> and the proxy. But it is not straightforward to me how the action
>> instance (and the interceptors) are injected to it.. I didn't see
>> setter methods for the action.
>>
>> My motivation for this question comes also from wanting to unit test
>> an interceptor's intercept(ActionInvocation actionInvocation) method.
>> I will need to pass an ActionInvocation as a parameter, which then the
>> interceptor will use to extract the actual action instance from.
>> (Among other things, like the InvocationContext to get the session).
>>
>> So I was also wondering how to provide a mock-type of an
>> ActionInvocation which will contain a mock action, a mock session etc.
>> I mean I understand how to create a mock action and a mock session map
>> with some parameters in it, but how do I bind those to a mock
>> ActionInvocation? Would I need perhaps to start with a mock
>> ActionProxy?
>>
>> Thanks for your advice. This will help me design the test case and
>> also learn more about the struts2 mechanics.
>> Regards!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to