[seam-commits] Seam SVN: r8267 - in branches/Seam_2_0/ui/src: test/java/org/jboss/seam/ui/test and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri May 23 01:22:07 EDT 2008


Author: dan.j.allen
Date: 2008-05-23 01:22:06 -0400 (Fri, 23 May 2008)
New Revision: 8267

Modified:
   branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/UrlBuilder.java
   branches/Seam_2_0/ui/src/test/java/org/jboss/seam/ui/test/UrlBuilderTest.java
Log:
JBSEAM-3003


Modified: branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/UrlBuilder.java
===================================================================
--- branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/UrlBuilder.java	2008-05-22 14:10:57 UTC (rev 8266)
+++ branches/Seam_2_0/ui/src/main/java/org/jboss/seam/ui/util/UrlBuilder.java	2008-05-23 05:22:06 UTC (rev 8267)
@@ -2,7 +2,7 @@
 
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 import javax.faces.component.UIParameter;
@@ -23,7 +23,7 @@
    protected UrlBuilder(String fragment, String characterEncoding)
    {
       this.fragment = fragment;
-      parameters = new HashMap<String, String>();
+      parameters = new LinkedHashMap<String, String>();
       this.characterEncoding = characterEncoding;
    }
    

Modified: branches/Seam_2_0/ui/src/test/java/org/jboss/seam/ui/test/UrlBuilderTest.java
===================================================================
--- branches/Seam_2_0/ui/src/test/java/org/jboss/seam/ui/test/UrlBuilderTest.java	2008-05-22 14:10:57 UTC (rev 8266)
+++ branches/Seam_2_0/ui/src/test/java/org/jboss/seam/ui/test/UrlBuilderTest.java	2008-05-23 05:22:06 UTC (rev 8267)
@@ -7,7 +7,6 @@
 
 public class UrlBuilderTest
 {
-
    @Test
    public void testBaseUrlAlreadyHasParams() throws UnsupportedEncodingException
    {
@@ -19,4 +18,15 @@
       assert "/someurl?arg1=a&foo=bar".equals(encodedUrl);
    } 
    
+   @Test
+   public void testParameterOrdering() throws UnsupportedEncodingException
+   {
+      UrlBuilder url = new UrlBuilder("/Hotel.seam", "", "UTF-8");
+      url.addParameter("hotelId", "5");
+      url.addParameter("cid", "10");
+      url.addParameter("z", "z");
+      url.addParameter("a", "a");
+      String encodedUrl = url.getEncodedUrl();
+      assert "/Hotel.seam?hotelId=5&cid=10&z=z&a=a".equals(encodedUrl) : "Parameters not properly ordered";
+   }
 }




More information about the seam-commits mailing list