Revision: 1209
          http://stripes.svn.sourceforge.net/stripes/?rev=1209&view=rev
Author:   bengunter
Date:     2009-10-27 19:30:29 +0000 (Tue, 27 Oct 2009)

Log Message:
-----------
Applied fix for STS-698 from trunk

Modified Paths:
--------------
    branches/1.5.x/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java
    branches/1.5.x/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java

Modified: 
branches/1.5.x/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java
===================================================================
--- branches/1.5.x/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java  
2009-10-27 19:28:47 UTC (rev 1208)
+++ branches/1.5.x/stripes/src/net/sourceforge/stripes/mock/MockRoundtrip.java  
2009-10-27 19:30:29 UTC (rev 1209)
@@ -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: 
branches/1.5.x/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java
===================================================================
--- 
branches/1.5.x/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java    
    2009-10-27 19:28:47 UTC (rev 1208)
+++ 
branches/1.5.x/tests/src/net/sourceforge/stripes/mock/TestMockRoundtrip.java    
    2009-10-27 19:30:29 UTC (rev 1209)
@@ -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(R) 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/devconference
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to