You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jc...@apache.org on 2008/10/04 21:55:43 UTC

svn commit: r701703 - in /wicket/trunk/wicket/src: main/java/org/apache/wicket/protocol/http/ main/java/org/apache/wicket/protocol/http/request/ main/java/org/apache/wicket/request/target/basic/ main/java/org/apache/wicket/request/target/coding/ main/j...

Author: jcompagner
Date: Sat Oct  4 12:55:42 2008
New Revision: 701703

URL: http://svn.apache.org/viewvc?rev=701703&view=rev
Log:
made ValueMap extend LinkedHashMap so that the order you put them is will be the order you get them out so that they are stable from now on
Removed the UnitTestSettings file everywhere
Fixed the test 
Made testing with DateHeaders more reliable

Removed:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/UnitTestSettings.java
Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/URIRequestTargetUrlCodingStrategy.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/WicketTester.java
    wicket/trunk/wicket/src/main/java/org/apache/wicket/util/value/ValueMap.java
    wicket/trunk/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java
    wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent1-expected.html
    wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent3-expected.html
    wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageExpectedResult_7.html
    wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java
    wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/inheritance/ExpectedResult2.html
    wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/testing/TestPage_ExpectedResult.html
    wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimplePageExpectedResult_1.html
    wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockHttpServletRequest.java Sat Oct  4 12:55:42 2008
@@ -29,6 +29,7 @@
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Date;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -275,6 +276,17 @@
 	}
 
 	/**
+	 * @param name
+	 * @param date
+	 */
+	public void addDateHeader(String name, long date)
+	{
+		DateFormat df = DateFormat.getDateInstance(DateFormat.FULL);
+		String dateString = df.format(new Date(date));
+		addHeader(name, dateString);
+	}
+
+	/**
 	 * Get an attribute.
 	 * 
 	 * @param name

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/MockWebApplication.java Sat Oct  4 12:55:42 2008
@@ -21,7 +21,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.TreeSet;
 
 import javax.servlet.FilterConfig;
 import javax.servlet.ServletContext;
@@ -426,15 +425,7 @@
 					pageMapName + Component.PATH_SEPARATOR + pageClass.getName());
 				if (params != null)
 				{
-					final Iterator<String> iterator;
-					if (UnitTestSettings.getSortUrlParameters())
-					{
-						iterator = new TreeSet<String>(params.keySet()).iterator();
-					}
-					else
-					{
-						iterator = params.keySet().iterator();
-					}
+					final Iterator<String> iterator = params.keySet().iterator();
 					while (iterator.hasNext())
 					{
 						final String key = iterator.next();

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/request/WebRequestCodingStrategy.java Sat Oct  4 12:55:42 2008
@@ -22,7 +22,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import java.util.TreeSet;
 import java.util.Map.Entry;
 
 import org.apache.wicket.Application;
@@ -44,7 +43,6 @@
 import org.apache.wicket.behavior.IActivePageBehaviorListener;
 import org.apache.wicket.behavior.IBehavior;
 import org.apache.wicket.behavior.IBehaviorListener;
-import org.apache.wicket.protocol.http.UnitTestSettings;
 import org.apache.wicket.protocol.http.WebRequestCycle;
 import org.apache.wicket.protocol.http.portlet.PortletRequestContext;
 import org.apache.wicket.request.IRequestCodingStrategy;
@@ -155,13 +153,15 @@
 	 * map of path mounts for mount encoders on paths.
 	 * <p>
 	 * mountsOnPath is sorted by longest paths first to improve resolution of possible path
-	 * conflicts. <br /> For example: <br/> we mount Page1 on /page and Page2 on /page/test <br />
-	 * Page1 uses a parameters encoder that only encodes parameter values <br /> now suppose we want
-	 * to access Page1 with a single parameter param="test". we have a url collision since both
-	 * pages can be access with /page/test <br /> the sorting by longest path first guarantees that
-	 * the iterator will return the mount /page/test before it returns mount /page therefore giving
-	 * deterministic behavior to path resolution by always trying to match the longest possible path
-	 * first.
+	 * conflicts. <br />
+	 * For example: <br/>
+	 * we mount Page1 on /page and Page2 on /page/test <br />
+	 * Page1 uses a parameters encoder that only encodes parameter values <br />
+	 * now suppose we want to access Page1 with a single parameter param="test". we have a url
+	 * collision since both pages can be access with /page/test <br />
+	 * the sorting by longest path first guarantees that the iterator will return the mount
+	 * /page/test before it returns mount /page therefore giving deterministic behavior to path
+	 * resolution by always trying to match the longest possible path first.
 	 * </p>
 	 */
 	private final MountsMap mountsOnPath;
@@ -770,15 +770,7 @@
 		final PageParameters parameters = requestTarget.getPageParameters();
 		if (parameters != null)
 		{
-			final Iterator<String> iterator;
-			if (UnitTestSettings.getSortUrlParameters())
-			{
-				iterator = new TreeSet<String>(parameters.keySet()).iterator();
-			}
-			else
-			{
-				iterator = parameters.keySet().iterator();
-			}
+			final Iterator<String> iterator = parameters.keySet().iterator();
 			while (iterator.hasNext())
 			{
 				final String key = iterator.next();

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/URIRequestTargetUrlCodingStrategy.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/URIRequestTargetUrlCodingStrategy.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/URIRequestTargetUrlCodingStrategy.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/basic/URIRequestTargetUrlCodingStrategy.java Sat Oct  4 12:55:42 2008
@@ -18,14 +18,12 @@
 
 import java.util.Iterator;
 import java.util.Map;
-import java.util.TreeMap;
 import java.util.Map.Entry;
 
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.wicket.IRequestTarget;
 import org.apache.wicket.PageParameters;
-import org.apache.wicket.protocol.http.UnitTestSettings;
 import org.apache.wicket.protocol.http.request.WebRequestCodingStrategy;
 import org.apache.wicket.request.RequestParameters;
 import org.apache.wicket.request.target.coding.AbstractRequestTargetUrlCodingStrategy;
@@ -66,9 +64,9 @@
 	public PageParameters decodeParameters(RequestParameters requestParameters)
 	{
 		final String parametersFragment = requestParameters.getPath().substring(
-				getMountPath().length());
-		return new PageParameters(decodeParameters(parametersFragment, requestParameters
-				.getParameters()));
+			getMountPath().length());
+		return new PageParameters(decodeParameters(parametersFragment,
+			requestParameters.getParameters()));
 	}
 
 	/**
@@ -92,7 +90,7 @@
 		if (!(requestTarget instanceof IBookmarkablePageRequestTarget))
 		{
 			throw new IllegalArgumentException("This encoder can only be used with " +
-					"instances of " + IBookmarkablePageRequestTarget.class.getName());
+				"instances of " + IBookmarkablePageRequestTarget.class.getName());
 		}
 		final AppendingStringBuffer url = new AppendingStringBuffer(40);
 		url.append(getMountPath());
@@ -106,8 +104,8 @@
 			{
 				pageParameters = new PageParameters();
 			}
-			pageParameters.put(WebRequestCodingStrategy.PAGEMAP, WebRequestCodingStrategy
-					.encodePageMapName(pagemap));
+			pageParameters.put(WebRequestCodingStrategy.PAGEMAP,
+				WebRequestCodingStrategy.encodePageMapName(pagemap));
 		}
 		appendParameters(url, pageParameters);
 		return url;
@@ -133,6 +131,7 @@
 	 * @param parameters
 	 *            parameter names mapped to parameter values
 	 */
+	@Override
 	protected void appendParameters(AppendingStringBuffer url, Map parameters)
 	{
 
@@ -148,15 +147,7 @@
 		// Copied from QueryStringUrlCodingStrategy
 		if (parameters != null && parameters.size() > 0)
 		{
-			final Iterator entries;
-			if (UnitTestSettings.getSortUrlParameters())
-			{
-				entries = new TreeMap(parameters).entrySet().iterator();
-			}
-			else
-			{
-				entries = parameters.entrySet().iterator();
-			}
+			final Iterator entries = parameters.entrySet().iterator();
 			WebRequestEncoder encoder = new WebRequestEncoder(url);
 			while (entries.hasNext())
 			{
@@ -184,6 +175,7 @@
 	 *            query string parameters
 	 * @return Parameters created from the url fragment and query string
 	 */
+	@Override
 	protected ValueMap decodeParameters(String urlFragment, Map urlParameters)
 	{
 		// Hack off any leading slash

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/AbstractRequestTargetUrlCodingStrategy.java Sat Oct  4 12:55:42 2008
@@ -19,10 +19,8 @@
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.TreeMap;
 import java.util.Map.Entry;
 
-import org.apache.wicket.protocol.http.UnitTestSettings;
 import org.apache.wicket.protocol.http.WicketURLDecoder;
 import org.apache.wicket.protocol.http.WicketURLEncoder;
 import org.apache.wicket.protocol.http.servlet.AbortWithWebErrorCodeException;
@@ -90,15 +88,7 @@
 	{
 		if (parameters != null && parameters.size() > 0)
 		{
-			final Iterator entries;
-			if (UnitTestSettings.getSortUrlParameters())
-			{
-				entries = new TreeMap(parameters).entrySet().iterator();
-			}
-			else
-			{
-				entries = parameters.entrySet().iterator();
-			}
+			final Iterator entries = parameters.entrySet().iterator();
 			while (entries.hasNext())
 			{
 				Map.Entry entry = (Entry)entries.next();

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/MixedParamUrlCodingStrategy.java Sat Oct  4 12:55:42 2008
@@ -20,46 +20,44 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-import java.util.TreeSet;
 
 import org.apache.wicket.PageMap;
 import org.apache.wicket.PageParameters;
-import org.apache.wicket.protocol.http.UnitTestSettings;
 import org.apache.wicket.util.string.AppendingStringBuffer;
 import org.apache.wicket.util.value.ValueMap;
 
 
 /**
- *
+ * 
  * Url coding strategy for bookmarkable pages that encodes a set of given parameters
- *
+ * 
  * in the url's path path and the rest in the querystring.
- *
+ * 
  * <p>
  * Strategy looks for path-parameters whose name is read from an array of
- *
+ * 
  * names e.g. ["param0", "param1"]. Found parameters will be appended to the url in
- *
+ * 
  * the form <code>/mount-path/paramvalue0/paramvalue1</code>.
  * </p>
- *
+ * 
  * <p>
  * All other parameters are added as parameter in the form:
- *
+ * 
  * <code>/mount-path/paramvalue0?otherparam0=otherparamvalue0&otherparam1=otherparamvalue1</code>.
  * </p>
- *
+ * 
  * <p>
  * Decode is symmetric except for when a path parameter that is not at the end has no value during
  * encode.
- *
+ * 
  * For example, the names for the path parameters are: "a", "b" and "c". When "b" is
- *
+ * 
  * not specified upon encoding, but "c" is, upon a decode "b" will get the empty string
- *
+ * 
  * as value. When both "b" and "c" are missing on encode, the will not get a value during decode.
  * </p>
- *
+ * 
  * @author erik.van.oosten
  */
 public class MixedParamUrlCodingStrategy extends BookmarkablePageRequestTargetUrlCodingStrategy
@@ -68,7 +66,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param mountPath
 	 *            mount path
 	 * @param bookmarkablePageClass
@@ -87,7 +85,7 @@
 
 	/**
 	 * Construct.
-	 *
+	 * 
 	 * @param mountPath
 	 *            mount path (not empty)
 	 * @param bookmarkablePageClass
@@ -139,22 +137,15 @@
 		if (!parameterNamesToAdd.isEmpty())
 		{
 			boolean first = true;
-			final Iterator iterator;
-			if (UnitTestSettings.getSortUrlParameters())
-			{
-				iterator = new TreeSet(parameterNamesToAdd).iterator();
-			}
-			else
-			{
-				iterator = parameterNamesToAdd.iterator();
-			}
+			final Iterator iterator = parameterNamesToAdd.iterator();
 			while (iterator.hasNext())
 			{
 				url.append(first ? '?' : '&');
 				String parameterName = (String)iterator.next();
 				final Object param = parameters.get(parameterName);
 				String value = param instanceof String[] ? ((String[])param)[0] : (String)param;
-				url.append(urlEncodeQueryComponent(parameterName)).append("=").append(urlEncodeQueryComponent(value));
+				url.append(urlEncodeQueryComponent(parameterName)).append("=").append(
+					urlEncodeQueryComponent(value));
 				first = false;
 			}
 		}

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/QueryStringUrlCodingStrategy.java Sat Oct  4 12:55:42 2008
@@ -18,13 +18,11 @@
 
 import java.util.Iterator;
 import java.util.Map;
-import java.util.TreeMap;
 import java.util.Map.Entry;
 
 import org.apache.wicket.IRequestTarget;
 import org.apache.wicket.PageMap;
 import org.apache.wicket.PageParameters;
-import org.apache.wicket.protocol.http.UnitTestSettings;
 import org.apache.wicket.request.RequestParameters;
 import org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget;
 import org.apache.wicket.request.target.component.BookmarkablePageRequestTarget;
@@ -36,15 +34,15 @@
  * in a URL query string rather than integrated into a URL hierarchical path.
  * <p>
  * For example, whereas
- * {@link org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy BookmarkablePageRequestTargetUrlCodingStrategy}
- * might encode a request target as
+ * {@link org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy
+ * BookmarkablePageRequestTargetUrlCodingStrategy} might encode a request target as
  * "mywebapp/myservlet/admin/productmanagement/action/edit/product/4995",
  * <code>QueryStringRequestTargetUrlCodingStrategy</code> would encode the same target as
  * "mywebapp/myservlet/admin/productmanagement?action=edit&amp;product=4995".
  * <p>
  * URLs encoded in this way can be bookmarked just as easily as those produced by
- * <code>BookmarkablePageRequestTargetUrlCodingStrategy</code>. For example, Google searches
- * produce bookmarkable links with query strings.
+ * <code>BookmarkablePageRequestTargetUrlCodingStrategy</code>. For example, Google searches produce
+ * bookmarkable links with query strings.
  * <p>
  * Whether <code>BookmarkablePageRequestTargetUrlCodingStrategy</code> or
  * <code>QueryStringRequestTargetUrlCodingStrategy</code> is appropriate for a given mount depends
@@ -73,17 +71,17 @@
  * to insert a bookmarkable link to the request target.
  * <p>
  * This example demonstrates how to mount a path with
- * <code>QueryStringRequestTargetUrlCodingStrategy</code> within the <code>init</code> method of
- * a class implementing {@link org.apache.wicket.protocol.http.WebApplication WebApplication}:
+ * <code>QueryStringRequestTargetUrlCodingStrategy</code> within the <code>init</code> method of a
+ * class implementing {@link org.apache.wicket.protocol.http.WebApplication WebApplication}:
  * <p>
  * <code>mount(new QueryStringUrlCodingStrategy("/admin/productmanagement", admin.ProductManagement.class));</code>
  * <p>
  * Note that, as with the main BookmarkablePageRequestTargetUrlCodingStrategy, if the output of this
  * coding strategy is passed through
- * {@link javax.servlet.http.HttpServletResponse#encodeURL(java.lang.String) HttpServletResponse.encodeURL}
- * and the client has cookies turned off, the client's session ID will be stored in a path
- * parameter, like so:
- * "/mywebapp/myservlet/admin/productmanagement;jsessionid=730EC527564AF1C73F8C2FB19B604F55?action=edit&amp;product=4995".
+ * {@link javax.servlet.http.HttpServletResponse#encodeURL(java.lang.String)
+ * HttpServletResponse.encodeURL} and the client has cookies turned off, the client's session ID
+ * will be stored in a path parameter, like so:"/mywebapp/myservlet/admin/productmanagement;jsessionid=730EC527564AF1C73F8C2FB19B604F55?action=edit&amp;product=4995"
+ * .
  * 
  * @author Benjamin Hawkes-Lewis
  */
@@ -111,19 +109,12 @@
 	 * @param parameters
 	 *            parameter names mapped to parameter values
 	 */
+	@Override
 	protected void appendParameters(AppendingStringBuffer url, Map parameters)
 	{
 		if (parameters != null && parameters.size() > 0)
 		{
-			final Iterator entries;
-			if (UnitTestSettings.getSortUrlParameters())
-			{
-				entries = new TreeMap(parameters).entrySet().iterator();
-			}
-			else
-			{
-				entries = parameters.entrySet().iterator();
-			}
+			final Iterator entries = parameters.entrySet().iterator();
 			WebRequestEncoder encoder = new WebRequestEncoder(url);
 			while (entries.hasNext())
 			{
@@ -137,6 +128,7 @@
 		}
 	}
 
+	@Override
 	public IRequestTarget decode(RequestParameters requestParameters)
 	{
 		String pageMapName = requestParameters.getPageMapName();
@@ -147,9 +139,8 @@
 		if (requestParameters.getInterfaceName() != null)
 		{
 			return new BookmarkableListenerInterfaceRequestTarget(pageMapName,
-				(Class)bookmarkablePageClassRef.get(), parameters,
-				requestParameters.getComponentPath(), requestParameters.getInterfaceName(),
-				requestParameters.getVersionNumber());
+				bookmarkablePageClassRef.get(), parameters, requestParameters.getComponentPath(),
+				requestParameters.getInterfaceName(), requestParameters.getVersionNumber());
 		}
 		else
 		{
@@ -168,6 +159,7 @@
 	 * 
 	 * @return Parameters
 	 */
+	@Override
 	protected ValueMap decodeParameters(String fragment, Map passedParameters)
 	{
 		ValueMap parameters = new ValueMap();

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/WicketTester.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/WicketTester.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/WicketTester.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/util/tester/WicketTester.java Sat Oct  4 12:55:42 2008
@@ -36,7 +36,6 @@
 import org.apache.wicket.protocol.http.HttpSessionStore;
 import org.apache.wicket.protocol.http.MockHttpServletResponse;
 import org.apache.wicket.protocol.http.SecondLevelCacheSessionStore;
-import org.apache.wicket.protocol.http.UnitTestSettings;
 import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.protocol.http.WebResponse;
 import org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.IPageStore;
@@ -316,10 +315,6 @@
 	public WicketTester(final WebApplication application, final String path)
 	{
 		super(application, path);
-
-		// We need to turn this on for unit testing so that url encoding will be
-		// done on sorted maps of parameters and they will string compare
-		UnitTestSettings.setSortUrlParameters(true);
 	}
 
 

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/util/value/ValueMap.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/value/ValueMap.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/util/value/ValueMap.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/util/value/ValueMap.java Sat Oct  4 12:55:42 2008
@@ -16,16 +16,13 @@
  */
 package org.apache.wicket.util.value;
 
-import java.io.Serializable;
 import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.Map;
-import java.util.TreeMap;
 
 import org.apache.wicket.util.parse.metapattern.MetaPattern;
 import org.apache.wicket.util.parse.metapattern.parsers.VariableAssignmentParser;
@@ -61,46 +58,11 @@
  * @author Doug Donohoe
  * @since 1.2.6
  */
-public class ValueMap extends TreeMap<String, Object> implements IValueMap
+public class ValueMap extends LinkedHashMap<String, Object> implements IValueMap
 {
 	/** an empty <code>ValueMap</code>. */
 	public static final ValueMap EMPTY_MAP;
 
-	/**
-	 * Comparator to allow null keys. This is because we use a {@link TreeMap} instead of a
-	 * {@link HashMap}, so we must provide a null safe comparator to avoid null pointer exceptions
-	 * with null keys.
-	 */
-	private static class NullSafeKeyComparator implements Comparator<String>, Serializable
-	{
-		private static final long serialVersionUID = 1L;
-
-		public int compare(String o1, String o2)
-		{
-			int compare = 0;
-
-			if (o1 != null && o2 != null)
-			{
-				compare = o1.compareTo(o2);
-			}
-			else if (o1 != null)
-			{
-				compare = -1;
-			}
-			else if (o2 != null)
-			{
-				compare = 1;
-			}
-
-			return compare;
-		}
-	}
-
-	/**
-	 * We only need one comparator.
-	 */
-	private static final NullSafeKeyComparator COMPARATOR = new NullSafeKeyComparator();
-
 	/** create EMPTY_MAP, make immutable * */
 	static
 	{
@@ -120,7 +82,7 @@
 	 */
 	public ValueMap()
 	{
-		super(COMPARATOR);
+		super();
 	}
 
 	/**
@@ -131,7 +93,7 @@
 	 */
 	public ValueMap(final Map map)
 	{
-		super(COMPARATOR);
+		super();
 
 		super.putAll(map);
 	}
@@ -139,11 +101,12 @@
 	/**
 	 * Constructor.
 	 * <p>
-	 * NOTE: Please use <code>RequestUtils.decodeParameters()</code> if you wish to properly
-	 * decode a request URL.
+	 * NOTE: Please use <code>RequestUtils.decodeParameters()</code> if you wish to properly decode
+	 * a request URL.
 	 * 
 	 * @param keyValuePairs
-	 *            list of key/value pairs separated by commas. For example, "<code>param1=foo,param2=bar</code>"
+	 *            list of key/value pairs separated by commas. For example, "
+	 *            <code>param1=foo,param2=bar</code>"
 	 */
 	public ValueMap(final String keyValuePairs)
 	{
@@ -153,18 +116,18 @@
 	/**
 	 * Constructor.
 	 * <p>
-	 * NOTE: Please use <code>RequestUtils.decodeParameters()</code> if you wish to properly
-	 * decode a request URL.
+	 * NOTE: Please use <code>RequestUtils.decodeParameters()</code> if you wish to properly decode
+	 * a request URL.
 	 * 
 	 * @param keyValuePairs
-	 *            list of key/value pairs separated by a given delimiter. For example, "<code>param1=foo,param2=bar</code>"
-	 *            where delimiter is "<code>,</code>".
+	 *            list of key/value pairs separated by a given delimiter. For example, "
+	 *            <code>param1=foo,param2=bar</code>" where delimiter is "<code>,</code>".
 	 * @param delimiter
 	 *            delimiter <code>String</code> used to separate key/value pairs
 	 */
 	public ValueMap(final String keyValuePairs, final String delimiter)
 	{
-		super(COMPARATOR);
+		super();
 
 		int start = 0;
 		int equalsIndex = keyValuePairs.indexOf('=');
@@ -214,17 +177,18 @@
 	 * Constructor.
 	 * 
 	 * @param keyValuePairs
-	 *            list of key/value pairs separated by a given delimiter. For example, "<code>param1=foo,param2=bar</code>"
-	 *            where delimiter is "<code>,</code>".
+	 *            list of key/value pairs separated by a given delimiter. For example, "
+	 *            <code>param1=foo,param2=bar</code>" where delimiter is "<code>,</code>".
 	 * @param delimiter
 	 *            delimiter string used to separate key/value pairs
 	 * @param valuePattern
-	 *            pattern for value. To pass a simple regular expression, pass "<code>new MetaPattern(regexp)</code>".
+	 *            pattern for value. To pass a simple regular expression, pass "
+	 *            <code>new MetaPattern(regexp)</code>".
 	 */
 	public ValueMap(final String keyValuePairs, final String delimiter,
 		final MetaPattern valuePattern)
 	{
-		super(COMPARATOR);
+		super();
 
 		// Get list of strings separated by the delimiter
 		final StringList pairs = StringList.tokenize(keyValuePairs, delimiter);
@@ -481,16 +445,16 @@
 	}
 
 	/**
-	 * Adds the value to this <code>ValueMap</code> with the given key. If the key already is in
-	 * the <code>ValueMap</code> it will combine the values into a <code>String</code> array,
-	 * else it will just store the value itself.
+	 * Adds the value to this <code>ValueMap</code> with the given key. If the key already is in the
+	 * <code>ValueMap</code> it will combine the values into a <code>String</code> array, else it
+	 * will just store the value itself.
 	 * 
 	 * @param key
 	 *            the key to store the value under
 	 * @param value
 	 *            the value that must be added/merged to the <code>ValueMap</code>
-	 * @return the value itself if there was no previous value, or a <code>String</code> array
-	 *         with the combined values
+	 * @return the value itself if there was no previous value, or a <code>String</code> array with
+	 *         the combined values
 	 */
 	public final Object add(final String key, final String value)
 	{
@@ -564,9 +528,8 @@
 	/**
 	 * Generates a <code>String</code> representation of this object.
 	 * 
-	 * @return <code>String</code> representation of this <code>ValueMap</code> consistent with
-	 *         the tag-attribute style of markup elements. For example:
-	 *         <code>a="x" b="y" c="z"</code>.
+	 * @return <code>String</code> representation of this <code>ValueMap</code> consistent with the
+	 *         tag-attribute style of markup elements. For example: <code>a="x" b="y" c="z"</code>.
 	 */
 	@Override
 	public String toString()

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/ParentResourceEscapePathTest.java Sat Oct  4 12:55:42 2008
@@ -38,9 +38,9 @@
 		tester.assertNoErrorMessage();
 
 		final StringBuilder expectedHtml = new StringBuilder();
-		expectedHtml.append("<html><head><wicket:link><script src=\"");
+		expectedHtml.append("<html><head><wicket:link><script type=\"text/javascript\" src=\"");
 		expectedHtml.append(expectedResourceUrl());
-		expectedHtml.append("\" type=\"text/javascript\"></script></wicket:link></head></html>");
+		expectedHtml.append("\"></script></wicket:link></head></html>");
 
 		assertEquals(expectedHtml.toString(), tester.getServletResponse().getDocument());
 	}

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent1-expected.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent1-expected.html?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent1-expected.html (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent1-expected.html Sat Oct  4 12:55:42 2008
@@ -1,5 +1,5 @@
 <![CDATA[<head xmlns:wicket="http://wicket.apache.org">
-<style id="org-apache-wicket-ajax-MockComponent1-0" type="text/css">
+<style type="text/css" id="org-apache-wicket-ajax-MockComponent1-0">
 .onTheFlyClass {
 	background-color: red;
 	color: white;

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent3-expected.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent3-expected.html?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent3-expected.html (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/ajax/MockComponent3-expected.html Sat Oct  4 12:55:42 2008
@@ -1,3 +1,3 @@
 <![CDATA[<head xmlns:wicket="http://wicket.apache.org">
-<link href="resources/org.apache.wicket.ajax.MockComponent3/mockStyleSheet3.css" rel="stylesheet" type="text/css"/>
+<link rel="stylesheet" type="text/css" href="resources/org.apache.wicket.ajax.MockComponent3/mockStyleSheet3.css"/>
 </head>]]>
\ No newline at end of file

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageExpectedResult_7.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageExpectedResult_7.html?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageExpectedResult_7.html (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageExpectedResult_7.html Sat Oct  4 12:55:42 2008
@@ -5,10 +5,10 @@
   <wicket:message key="myKeyNotExsts"></wicket:message>
   <wicket:message key="myKey">myValue</wicket:message>
   <span wicket:id="message">here it goes</span>
-  <span attr-name="my i18n key" wicket:message="attr-name:i18n-key">test 2</span>
-  <span wicket:id="message2" attr-name="my i18n key" wicket:message="attr-name:i18n-key">here it goes</span>
+  <span wicket:message="attr-name:i18n-key" attr-name="my i18n key">test 2</span>
+  <span wicket:id="message2" wicket:message="attr-name:i18n-key" attr-name="my i18n key">here it goes</span>
   
   <input type="image" src="../test.gif">test 2</input>
-  <input type="image" src="../test.gif" attr-name="my i18n key" wicket:message="attr-name:i18n-key">test 2</input>
+  <input type="image" src="../test.gif" wicket:message="attr-name:i18n-key" attr-name="my i18n key">test 2</input>
 </body>
 </html>

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/basic/SimplePageTest.java Sat Oct  4 12:55:42 2008
@@ -105,7 +105,7 @@
 		assertNotNull(document);
 		assertFalse("".equals(document));
 		assertEquals(
-			"<span testAttr=\"myValue\" wicket:id=\"myBorder2\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
+			"<span wicket:id=\"myBorder2\" testAttr=\"myValue\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
 			document);
 
 		// do the same test twice. Igor reported a problem with that, so we have to test it.
@@ -116,7 +116,7 @@
 		assertNotNull(document);
 		assertFalse("".equals(document));
 		assertEquals(
-			"<span testAttr=\"myValue\" wicket:id=\"myBorder2\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
+			"<span wicket:id=\"myBorder2\" testAttr=\"myValue\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
 			document);
 
 		WebMarkupContainer container = (WebMarkupContainer)tester.getLastRenderedPage().get("test");
@@ -185,7 +185,7 @@
 		assertNotNull(document);
 		assertFalse("".equals(document));
 		assertEquals(
-			"<span testAttr=\"myValue\" wicket:id=\"myBorder2\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
+			"<span wicket:id=\"myBorder2\" testAttr=\"myValue\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
 			document);
 
 		// do the same test twice. Igor reported a problem with that, so we have to test it.
@@ -196,7 +196,7 @@
 		assertNotNull(document);
 		assertFalse("".equals(document));
 		assertEquals(
-			"<span testAttr=\"myValue\" wicket:id=\"myBorder2\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
+			"<span wicket:id=\"myBorder2\" testAttr=\"myValue\"><wicket:border>before body - <wicket:body>border</wicket:body> - after body</wicket:border></span>",
 			document);
 
 		WebMarkupContainer container = (WebMarkupContainer)page.get("test");

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/inheritance/ExpectedResult2.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/inheritance/ExpectedResult2.html?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/inheritance/ExpectedResult2.html (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/inheritance/ExpectedResult2.html Sat Oct  4 12:55:42 2008
@@ -2,7 +2,7 @@
 <head>
   <title>AbstractPage.html</title>
 
-  <script id="org-apache-wicket-markup-html-header-inheritance-MyPanel2-0" type="text/javascript">
+  <script type="text/javascript" id="org-apache-wicket-markup-html-header-inheritance-MyPanel2-0">
   function foo() {
      alert("Hello, World!");
   }

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/testing/TestPage_ExpectedResult.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/testing/TestPage_ExpectedResult.html?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/testing/TestPage_ExpectedResult.html (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/html/header/testing/TestPage_ExpectedResult.html Sat Oct  4 12:55:42 2008
@@ -3,7 +3,7 @@
 <head>
   <title>test page</title>
 
-    <script id="org-apache-wicket-markup-html-header-testing-TestExtendedPanel-0" languange="javascript">
+    <script languange="javascript" id="org-apache-wicket-markup-html-header-testing-TestExtendedPanel-0">
       alert('wicket head works in extended panel !');
     </script>
   </head>

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimplePageExpectedResult_1.html
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimplePageExpectedResult_1.html?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimplePageExpectedResult_1.html (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/resolver/SimplePageExpectedResult_1.html Sat Oct  4 12:55:42 2008
@@ -5,10 +5,10 @@
   <wicket:message key="myKeyNotExsts"></wicket:message>
   <wicket:message key="myKey">myValue</wicket:message>
   <span wicket:id="message">here it goes</span>
-  <span attr-name="my i18n key" wicket:message="attr-name:i18n-key">test 2</span>
-  <span wicket:id="message2" attr-name="my i18n key" wicket:message="attr-name:i18n-key">here it goes</span>
+  <span wicket:message="attr-name:i18n-key" attr-name="my i18n key">test 2</span>
+  <span wicket:id="message2" wicket:message="attr-name:i18n-key" attr-name="my i18n key">here it goes</span>
   
   <input type="image" src="../test.gif">test 2</input>
-  <input type="image" src="../test.gif" attr-name="my i18n key" wicket:message="attr-name:i18n-key">test 2</input>
+  <input type="image" src="../test.gif" wicket:message="attr-name:i18n-key" attr-name="my i18n key">test 2</input>
 </body>
 </html>

Modified: wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java?rev=701703&r1=701702&r2=701703&view=diff
==============================================================================
--- wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java (original)
+++ wicket/trunk/wicket/src/test/java/org/apache/wicket/protocol/http/WicketFilterTest.java Sat Oct  4 12:55:42 2008
@@ -48,7 +48,6 @@
 public class WicketFilterTest extends TestCase
 {
 	private static WebApplication application;
-	private final DateFormat fullDateFormat = DateFormat.getDateInstance(DateFormat.FULL);
 	private final DateFormat headerDateFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z",
 		Locale.UK);
 
@@ -117,8 +116,7 @@
 		Calendar nextWeek = Calendar.getInstance();
 		nextWeek.add(Calendar.DATE, 7);
 		nextWeek.setTimeZone(TimeZone.getTimeZone("GMT"));
-		String ifModifiedSince = fullDateFormat.format(nextWeek.getTime());
-		request.addHeader("If-Modified-Since", ifModifiedSince);
+		request.addDateHeader("If-Modified-Since", nextWeek.getTimeInMillis());
 	}
 
 	private String getFilterPath(String string, InputStream in)