struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [6/8] struts git commit: WW-4722 Prepares ActionProxy to be used with test
Date Thu, 01 Dec 2016 19:06:54 GMT
WW-4722 Prepares ActionProxy to be used with test


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/f515def5
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/f515def5
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/f515def5

Branch: refs/heads/master
Commit: f515def5b82f29b2accac056e2148077047bdfd1
Parents: fddc658
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Dec 1 19:50:36 2016 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Dec 1 19:50:36 2016 +0100

----------------------------------------------------------------------
 .../struts2/interceptor/I18nInterceptorTest.java       | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/f515def5/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java
index 8da9f68..d8c5944 100644
--- a/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java
+++ b/core/src/test/java/org/apache/struts2/interceptor/I18nInterceptorTest.java
@@ -25,6 +25,7 @@ import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.DefaultLocaleProvider;
 import com.opensymphony.xwork2.mock.MockActionInvocation;
+import com.opensymphony.xwork2.mock.MockActionProxy;
 import junit.framework.TestCase;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsStatics;
@@ -203,9 +204,8 @@ public class I18nInterceptorTest extends TestCase {
 
         EasyMock.verify(response);
 
-        Locale denmark = new Locale("da", "DK");
-        assertNotNull(session.get(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE)); // should
be stored here
-        assertEquals(denmark, session.get(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE)); //
should create a locale object
+        assertNull(session.get(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE)); // should not
be stored here
+        assertNull(session.get(I18nInterceptor.DEFAULT_SESSION_ATTRIBUTE)); // should not
create a locale object
     }
 
     private void prepare(String key, Serializable value) {
@@ -235,9 +235,16 @@ public class I18nInterceptorTest extends TestCase {
                 return SUCCESS;
             }
         };
+
+        MockActionProxy proxy = new MockActionProxy();
+        proxy.setAction(action);
+        proxy.setNamespace("i18n");
+        proxy.setActionName("anAction");
+
         mai = new MockActionInvocation();
         ((MockActionInvocation) mai).setAction(action);
         ((MockActionInvocation) mai).setInvocationContext(ac);
+        ((MockActionInvocation) mai).setProxy(proxy);
     }
 
     public void tearDown() throws Exception {


Mime
View raw message