|
Struts example source code file (ProxyInvocationTest.java)
The Struts ProxyInvocationTest.java source codepackage com.opensymphony.xwork2; import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider; import java.util.HashMap; import java.util.Map; /** * Contribed by: Ruben Inoto */ public class ProxyInvocationTest extends XWorkTestCase { /** * Sets a ProxyObjectFactory as ObjectFactory (so the FooAction will always be retrieved * as a FooProxy), and it tries to call invokeAction on the TestActionInvocation. * * It should fail, because the Method got from the action (actually a FooProxy) * will be executed on the InvocationHandler of the action (so, in the action itself). */ public void testProxyInvocation() throws Exception { ActionProxy proxy = actionProxyFactory .createActionProxy("", "ProxyInvocation", createDummyContext()); ActionInvocation invocation = proxy.getInvocation(); String result = invocation.invokeActionOnly(); assertEquals("proxyResult", result); } /** * Needed for the creation of the action proxy */ private Map<String, Object> createDummyContext() { Map<String, Object> params = new HashMap Other Struts examples (source code examples)Here is a short list of links related to this Struts ProxyInvocationTest.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.