struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r781805 - /struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java
Date Thu, 04 Jun 2009 17:33:01 GMT
Author: wesw
Date: Thu Jun  4 17:33:00 2009
New Revision: 781805

URL: http://svn.apache.org/viewvc?rev=781805&view=rev
Log:
making unit test match environment that caused NPE in WW-3150

Modified:
    struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java

Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java?rev=781805&r1=781804&r2=781805&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java (original)
+++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/util/TokenHelperTest.java Thu
Jun  4 17:33:00 2009
@@ -23,6 +23,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.TreeMap;
 
 import junit.framework.TestCase;
 
@@ -61,12 +62,15 @@
     public void testGetTokenDoesNotNpe() {
         String token = TokenHelper.getToken(null);
         assertTrue(token == null);
+
+        String token2 = TokenHelper.getToken("");
+        assertTrue(token2 == null);
     }
 
     protected void setUp() throws Exception {
         session = new HashMap();
-        Map params = new HashMap();
-        Map ctxMap = new HashMap();
+        Map params = new TreeMap();
+        Map ctxMap = new TreeMap();
         ctxMap.put(ActionContext.SESSION, session);
         ctxMap.put(ActionContext.PARAMETERS, params);
         ActionContext ctx = new ActionContext(ctxMap);



Mime
View raw message