mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Changing component parameters to use linkedHashMap (preserve order), fixed tests
to reflect this WW-1942 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@541522 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -23,8 +23,8 @@ package org.apache.struts2.components;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Component {
|
||||
*/
|
||||
public Component(ValueStack stack) {
|
||||
this.stack = stack;
|
||||
this.parameters = new HashMap();
|
||||
this.parameters = new LinkedHashMap();
|
||||
getComponentStack().push(this);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -102,7 +102,7 @@ public class ServletActionRedirectResultTest extends StrutsTestCase {
|
||||
control.replay();
|
||||
result.setActionMapper(container.getInstance(ActionMapper.class));
|
||||
result.execute(mockInvocation);
|
||||
assertEquals("/myNamespace/myAction.action?param2=value+2¶m1=value+1¶m3=value+3", res.getRedirectedUrl());
|
||||
assertEquals("/myNamespace/myAction.action?param1=value+1¶m2=value+2¶m3=value+3", res.getRedirectedUrl());
|
||||
|
||||
control.verify();
|
||||
}
|
||||
@@ -156,7 +156,7 @@ public class ServletActionRedirectResultTest extends StrutsTestCase {
|
||||
control.replay();
|
||||
result.setActionMapper(container.getInstance(ActionMapper.class));
|
||||
result.execute(mockInvocation);
|
||||
assertEquals("/myNamespace/myAction.action?param2=value+2¶m1=value+1¶m3=value+3", res.getRedirectedUrl());
|
||||
assertEquals("/myNamespace/myAction.action?param1=value+1¶m2=value+2¶m3=value+3", res.getRedirectedUrl());
|
||||
|
||||
control.verify();
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
tag.component.addParameter("param1", "value1");
|
||||
tag.component.addParameter("param2", "value2");
|
||||
tag.doEndTag();
|
||||
assertEquals("/TestAction.action?param2=value2&param0=value0&param1=value1", writer.toString());
|
||||
assertEquals("/TestAction.action?param0=value0&param1=value1&param2=value2", writer.toString());
|
||||
}
|
||||
|
||||
public void testEvaluateValue() throws Exception {
|
||||
@@ -281,7 +281,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
paramTag.doEndTag();
|
||||
urlTag.doEndTag();
|
||||
|
||||
assertEquals(writer.getBuffer().toString(), "/context/someAction.action?name=John&id=33");
|
||||
assertEquals("/context/someAction.action?id=33&name=John", writer.getBuffer().toString());
|
||||
}
|
||||
|
||||
public void testParamPrecedenceWithAnchor() throws Exception {
|
||||
@@ -304,7 +304,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
paramTag.doEndTag();
|
||||
urlTag.doEndTag();
|
||||
|
||||
assertEquals(writer.getBuffer().toString(), "/context/someAction.action?name=John&id=33#testAnchor");
|
||||
assertEquals("/context/someAction.action?id=33&name=John#testAnchor", writer.getBuffer().toString());
|
||||
}
|
||||
|
||||
public void testPutId() throws Exception {
|
||||
@@ -391,7 +391,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals("/team.action?section=team&year=2006&company=acme+inc", writer.toString());
|
||||
assertEquals("/team.action?section=team&company=acme+inc&year=2006", writer.toString());
|
||||
}
|
||||
|
||||
public void testRequestURINoActionIncludeAll() throws Exception {
|
||||
@@ -413,7 +413,7 @@ public class URLTagTest extends AbstractUITagTest {
|
||||
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals("/public/about?section=team&year=2006&company=acme+inc", writer.toString());
|
||||
assertEquals("/public/about?section=team&company=acme+inc&year=2006", writer.toString());
|
||||
}
|
||||
|
||||
public void testUnknownIncludeParam() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user