struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sami Dalouche (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-1950) UrlHelper.buildUrl does not output port even if forceAddSchemeHostAndPort turned on (TestCase included)
Date Sun, 27 May 2007 16:46:42 GMT

     [ https://issues.apache.org/struts/browse/WW-1950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sami Dalouche updated WW-1950:
------------------------------

    Affects Version/s: 2.0.8

> UrlHelper.buildUrl does not output port even if forceAddSchemeHostAndPort turned on (TestCase
included)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: WW-1950
>                 URL: https://issues.apache.org/struts/browse/WW-1950
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Views
>    Affects Versions: 2.0.8
>            Reporter: Sami Dalouche
>
> If you add this test to UrlHelperTest, you will find out that it fails..
>     public void testForceAddSchemeHostAndPortWithNonStandardPort() throws Exception {
>         String expectedUrl = "http://localhost:9090/contextPath/path1/path2/myAction.action";
>         Mock mockHttpServletRequest = new Mock(HttpServletRequest.class);
>         mockHttpServletRequest.expectAndReturn("getScheme", "http");
>         mockHttpServletRequest.expectAndReturn("getServerName", "localhost");
>         mockHttpServletRequest.expectAndReturn("getContextPath", "/contextPath");
>         mockHttpServletRequest.expectAndReturn("getServerPort", 9090);
>         Mock mockHttpServletResponse = new Mock(HttpServletResponse.class);
>         mockHttpServletResponse.expectAndReturn("encodeURL", expectedUrl, expectedUrl);
>         String result = UrlHelper.buildUrl("/path1/path2/myAction.action", (HttpServletRequest)
mockHttpServletRequest.proxy(), (HttpServletResponse)mockHttpServletResponse.proxy(), null,
"http", true, true, true);
>         assertEquals(expectedUrl, result);
>         mockHttpServletRequest.verify();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message