Commits

Anonymous committed 98f11f6

Some minor OgnlValueStack test additions

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

  • Participants
  • Parent commits f8b1dff

Comments (0)

Files changed (2)

File src/test/com/opensymphony/xwork/util/Dog.java

     public Boolean nullSafeMethod(Boolean arg) {
         return (arg == null) ? Boolean.TRUE : arg;
     }
+
+    /**
+     * @return null
+     */
+    public Integer nullMethod() {
+        return null;
+    }
 }

File src/test/com/opensymphony/xwork/util/OgnlValueStackTest.java

 public class OgnlValueStackTest extends TestCase {
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * @return null
+     */
+    public static Integer staticNullMethod() {
+        return null;
+    }
+
     public void testArrayAsString() {
         OgnlValueStack vs = new OgnlValueStack();
 
         assertEquals("Jack", vs.findValue("top.name"));
     }
 
-    public void testThatNull() {
+    public void testTopNull() {
         OgnlValueStack vs = new OgnlValueStack();
 
         assertNull(vs.findValue("top"));
         assertEquals("blah", action.getName());
     }
 
+    public void testGetNullValue() {
+        Dog dog = new Dog();
+        OgnlValueStack stack = new OgnlValueStack();
+        stack.push(dog);
+        assertNull(stack.findValue("name"));
+    }
+
+    public void testNullMethod() {
+        Dog dog = new Dog();
+        OgnlValueStack stack = new OgnlValueStack();
+        stack.push(dog);
+        assertNull(stack.findValue("nullMethod()"));
+        assertNull(stack.findValue("@com.opensymphony.xwork.util.OgnlValueStackTest@staticNullMethod()"));
+    }
+
 }