Author: musachy
Date: Mon Aug  4 07:55:30 2008
New Revision: 682411

URL: http://svn.apache.org/viewvc?rev=682411&view=rev
Log:
XW-641 XWork ParameterInterceptors bypass (OGNL statement execution)

Update tests

Modified:
    
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java
    
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java?rev=682411&r1=682410&r2=682411&view=diff
==============================================================================
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptorTest.java
 Mon Aug  4 07:55:30 2008
@@ -64,6 +64,7 @@
     private Map params;
     private Map session;
     private ExecuteAndWaitInterceptor waitInterceptor;
+    private ParametersInterceptor parametersInterceptor;
 
     public void testOneWait() throws Exception {
         waitInterceptor.setDelay(0);
@@ -188,6 +189,7 @@
         request.setSession(httpSession);
         request.setParameterMap(params);
         context.put(ServletActionContext.HTTP_REQUEST, request);
+        container.inject(parametersInterceptor);
     }
 
     protected void tearDown() throws Exception {
@@ -206,7 +208,7 @@
         public boolean needsReload() {
             return false;
         }
-        
+
         public void init(Configuration configuration) throws 
ConfigurationException {
             this.configuration = configuration;
         }
@@ -216,12 +218,12 @@
 
             // interceptors
             waitInterceptor = new ExecuteAndWaitInterceptor();
-
+            parametersInterceptor = new ParametersInterceptor();
             PackageConfig wait = new PackageConfig.Builder("")
                 .addActionConfig("action1", new ActionConfig.Builder("", 
"action1", ExecuteAndWaitDelayAction.class.getName())
                     .addResultConfig(new ResultConfig.Builder(Action.SUCCESS, 
MockResult.class.getName()).build())
                     .addResultConfig(new 
ResultConfig.Builder(ExecuteAndWaitInterceptor.WAIT, 
MockResult.class.getName()).build())
-                    .addInterceptor(new InterceptorMapping("params", new 
ParametersInterceptor()))
+                    .addInterceptor(new InterceptorMapping("params", 
parametersInterceptor))
                     .addInterceptor(new InterceptorMapping("execAndWait", 
waitInterceptor))
                 .build())
             .build();

Modified: 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java?rev=682411&r1=682410&r2=682411&view=diff
==============================================================================
--- 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
 (original)
+++ 
struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/jsp/ActionTagTest.java
 Mon Aug  4 07:55:30 2008
@@ -37,6 +37,8 @@
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.ActionProxy;
+import com.opensymphony.xwork2.config.entities.ActionConfig;
+import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
 import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.ValueStackFactory;
 import com.mockobjects.dynamic.Mock;
@@ -74,6 +76,9 @@
     public void testSimple() {
         request.setupGetServletPath("/foo.action");
 
+        ActionConfig config = 
configuration.getRuntimeConfiguration().getActionConfig("", "testAction");
+        container.inject(config.getInterceptors().get(0).getInterceptor());
+
         ActionTag tag = new ActionTag();
         tag.setPageContext(pageContext);
         tag.setName("testAction");
@@ -109,6 +114,9 @@
     public void testSimpleWithctionMethodInOriginalURI() {
         request.setupGetServletPath("/foo!foo.action");
 
+        ActionConfig config = 
configuration.getRuntimeConfiguration().getActionConfig("", "testAction");
+        container.inject(config.getInterceptors().get(0).getInterceptor());
+
         ActionTag tag = new ActionTag();
         tag.setPageContext(pageContext);
         tag.setName("testAction");


Reply via email to