Author: chris.laprun(a)jboss.com
Date: 2008-07-10 14:19:51 -0400 (Thu, 10 Jul 2008)
New Revision: 11413
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java
Log:
- Fixed tests as we now sanitize doubly-encoded ampersands.
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java 2008-07-10
16:53:49 UTC (rev 11412)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/WSRPPortletURLTestCase.java 2008-07-10
18:19:51 UTC (rev 11413)
@@ -94,13 +94,20 @@
{
String message = "Should have detected invalid parameter: ";
- String invalid =
"wsrp_rewrite?wsrp-urlType=render&wsrp-url=http%3A%2F%2Flocalhost%2F/wsrp_rewrite";
- checkInvalidURL(invalid, message, "amp;wsrp-url");
-
- invalid =
"wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
+ String invalid =
"wsrp_rewrite?wsrp-urlType=render&foo=bar/wsrp_rewrite";
checkInvalidURL(invalid, message, "foo");
}
+ public void testDoublyEncodedAmpersand()
+ {
+ String expected =
"wsrp_rewrite?wsrp-urlType=render&wsrp-mode=wsrp:help&wsrp-windowState=wsrp:maximized/wsrp_rewrite";
+ WSRPPortletURL url = WSRPPortletURL.create(expected);
+
+ assertTrue(url instanceof WSRPRenderURL);
+ assertEquals(Mode.HELP, url.getMode());
+ assertEquals(WindowState.MAXIMIZED, url.getWindowState());
+ }
+
/** Relax validation and test that we now accept normally invalid URLs. */
public void testExtraParametersRelaxedValidation()
{
Show replies by date