struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [28/50] [abbrv] struts git commit: Adds additional use case when value from conext is null
Date Wed, 31 Dec 2014 17:17:50 GMT
Adds additional use case when value from conext is null


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

Branch: refs/heads/master
Commit: 3a0350f0dc9f27141543bdad62f4881e7eaca6c0
Parents: debaaa2
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Tue Dec 23 16:07:58 2014 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Tue Dec 23 16:07:58 2014 +0100

----------------------------------------------------------------------
 .../com/opensymphony/xwork2/ognl/OgnlValueStackTest.java  | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/3a0350f0/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
b/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
index fe04584..8c7c3ae 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
@@ -103,6 +103,16 @@ public class OgnlValueStackTest extends XWorkTestCase {
         assertEquals(propertyValue, vs.findValue(propertyName, String.class));
     }
 
+    public void testNullValueFromContextGetsConverted() {
+        final OgnlValueStack vs = createValueStack();
+
+        final String propertyName = "dogName";
+        final String propertyValue = null;
+        vs.getContext().put(propertyName, propertyValue);
+
+        assertEquals(propertyValue, vs.findValue(propertyName, String.class));
+    }
+
     public void testFailOnException() {
         OgnlValueStack vs = createValueStack();
 


Mime
View raw message