struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject struts git commit: WW-4787 Moves test to src/test/java
Date Thu, 20 Apr 2017 12:35:22 GMT
Repository: struts
Updated Branches:
  refs/heads/master 293d2fd17 -> 951241041


WW-4787 Moves test to src/test/java


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

Branch: refs/heads/master
Commit: 9512410412650427f33e107449f02470ac86432c
Parents: 293d2fd
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Apr 20 14:35:11 2017 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Apr 20 14:35:11 2017 +0200

----------------------------------------------------------------------
 .../accessor/XWorkMapPropertyAccessorTest.java  | 54 --------------------
 .../accessor/XWorkMapPropertyAccessorTest.java  | 54 ++++++++++++++++++++
 2 files changed, 54 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/95124104/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
b/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
deleted file mode 100644
index a746c7e..0000000
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.opensymphony.xwork2.ognl.accessor;
-
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.XWorkTestCase;
-import com.opensymphony.xwork2.util.Element;
-import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.reflection.ReflectionContextState;
-
-import java.util.Collections;
-import java.util.Map;
-
-public class XWorkMapPropertyAccessorTest extends XWorkTestCase {
-    public void testCreateNullObjectsIsFalseByDefault() {
-        ValueStack vs = ActionContext.getContext().getValueStack();
-        vs.push(new MapHolder(Collections.emptyMap()));
-        assertNull(vs.findValue("map[key]"));
-    }
-
-    public void testMapContentsAreReturned() {
-        ValueStack vs = ActionContext.getContext().getValueStack();
-        vs.push(new MapHolder(Collections.singletonMap("key", "value")));
-        assertEquals("value", vs.findValue("map['key']"));
-    }
-
-    public void testNullIsNotReturnedWhenCreateNullObjectsIsSpecified() {
-        ValueStack vs = ActionContext.getContext().getValueStack();
-        vs.push(new MapHolder(Collections.emptyMap()));
-        ReflectionContextState.setCreatingNullObjects(vs.getContext(), true);
-
-        Object value = vs.findValue("map['key']");
-        assertNotNull(value);
-        assertSame(Object.class, value.getClass());
-    }
-
-    public void testNullIsReturnedWhenCreateNullObjectsIsSpecifiedAsFalse() {
-        ValueStack vs = ActionContext.getContext().getValueStack();
-        vs.push(new MapHolder(Collections.emptyMap()));
-        ReflectionContextState.setCreatingNullObjects(vs.getContext(), false);
-        assertNull(vs.findValue("map['key']"));
-    }
-
-    private static class MapHolder {
-        private final Map map;
-
-        public MapHolder(Map m) {
-            this.map = m;
-        }
-
-        @Element(value = Object.class)
-        public Map getMap() {
-            return map;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/struts/blob/95124104/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
b/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
new file mode 100644
index 0000000..a746c7e
--- /dev/null
+++ b/core/src/test/java/com/opensymphony/xwork2/ognl/accessor/XWorkMapPropertyAccessorTest.java
@@ -0,0 +1,54 @@
+package com.opensymphony.xwork2.ognl.accessor;
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.XWorkTestCase;
+import com.opensymphony.xwork2.util.Element;
+import com.opensymphony.xwork2.util.ValueStack;
+import com.opensymphony.xwork2.util.reflection.ReflectionContextState;
+
+import java.util.Collections;
+import java.util.Map;
+
+public class XWorkMapPropertyAccessorTest extends XWorkTestCase {
+    public void testCreateNullObjectsIsFalseByDefault() {
+        ValueStack vs = ActionContext.getContext().getValueStack();
+        vs.push(new MapHolder(Collections.emptyMap()));
+        assertNull(vs.findValue("map[key]"));
+    }
+
+    public void testMapContentsAreReturned() {
+        ValueStack vs = ActionContext.getContext().getValueStack();
+        vs.push(new MapHolder(Collections.singletonMap("key", "value")));
+        assertEquals("value", vs.findValue("map['key']"));
+    }
+
+    public void testNullIsNotReturnedWhenCreateNullObjectsIsSpecified() {
+        ValueStack vs = ActionContext.getContext().getValueStack();
+        vs.push(new MapHolder(Collections.emptyMap()));
+        ReflectionContextState.setCreatingNullObjects(vs.getContext(), true);
+
+        Object value = vs.findValue("map['key']");
+        assertNotNull(value);
+        assertSame(Object.class, value.getClass());
+    }
+
+    public void testNullIsReturnedWhenCreateNullObjectsIsSpecifiedAsFalse() {
+        ValueStack vs = ActionContext.getContext().getValueStack();
+        vs.push(new MapHolder(Collections.emptyMap()));
+        ReflectionContextState.setCreatingNullObjects(vs.getContext(), false);
+        assertNull(vs.findValue("map['key']"));
+    }
+
+    private static class MapHolder {
+        private final Map map;
+
+        public MapHolder(Map m) {
+            this.map = m;
+        }
+
+        @Element(value = Object.class)
+        public Map getMap() {
+            return map;
+        }
+    }
+}


Mime
View raw message