Revision: 1146
          http://stripes.svn.sourceforge.net/stripes/?rev=1146&view=rev
Author:   fdaoud
Date:     2009-09-16 21:27:29 +0000 (Wed, 16 Sep 2009)

Log Message:
-----------
Fix for STS-698. Thanks to Tom Rathbone.

Modified Paths:
--------------
    trunk/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java
    trunk/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java

Modified: trunk/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java   
2009-09-16 21:22:09 UTC (rev 1145)
+++ trunk/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java   
2009-09-16 21:27:29 UTC (rev 1146)
@@ -221,6 +221,7 @@
             String[] combined = new String[oldValues.length + value.length];
             System.arraycopy(oldValues, 0, combined, 0, oldValues.length);
             System.arraycopy(value, 0, combined, oldValues.length, 
value.length);
+            setParameter(name, combined);
         }
     }
 

Modified: trunk/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java
===================================================================
--- trunk/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java 
2009-09-16 21:22:09 UTC (rev 1145)
+++ trunk/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java 
2009-09-16 21:27:29 UTC (rev 1146)
@@ -224,4 +224,19 @@
        request.addHeader("User-Agent", "Netscape/6.0");
        Assert.assertEquals(request.getHeader("User-Agent"), "Netscape/6.0", 
MockHttpServletRequest.class + ".addHeader/getHeader do not properly");
     }
+
+    @Test(groups="fast")
+    public void testAddParameter() throws Exception {
+        // Setup the servlet engine
+        MockServletContext ctx = StripesTestFixture.getServletContext();
+        MockRoundtrip trip = new MockRoundtrip(ctx, TestMockRoundtrip.class);
+        trip.addParameter("param", "a");
+        trip.addParameter("param", "b");
+        trip.execute();
+        
+        TestMockRoundtrip bean = trip.getActionBean(TestMockRoundtrip.class);
+        String[] params = 
bean.getContext().getRequest().getParameterValues("param");
+        Assert.assertEquals(2, params.length);
+        Assert.assertEquals(new String[] {"a", "b"}, params);
+    }
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to