Commits

tmjee  committed 4295cb5

implemented the addPreResultListener method and also go through the pre-result listener upon invocation. Used in RepopulateConversionErrorFieldValidatorTest

Issue number:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk/src@974e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 97077ca

Comments (0)

Files changed (1)

File java/com/opensymphony/xwork/mock/MockActionInvocation.java

 
 package com.opensymphony.xwork.mock;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 import com.opensymphony.xwork.ActionInvocation;
 import com.opensymphony.xwork.ActionContext;
 import com.opensymphony.xwork.ActionProxy;
  *
  * @author plightbo
  * @author Rainer Hermanns
+ * @author tm_jee
  * @version $Id$
  */
 public class MockActionInvocation implements ActionInvocation {
     private Result result;
     private String resultCode;
     private OgnlValueStack stack;
+    
+    private List preResultListeners = new ArrayList();
 
     public Object getAction() {
         return action;
     }
 
     public void addPreResultListener(PreResultListener listener) {
+    	preResultListeners.add(listener);
     }
 
     public String invoke() throws Exception {
+    	for (Iterator i = preResultListeners.iterator(); i.hasNext(); ) {
+    		PreResultListener listener = (PreResultListener) i.next();
+    		listener.beforeResult(this, resultCode);
+    	}
         return resultCode;
     }