Michael-

If you check the logs, I had this problem about a week
ago. See:
http://www.mail-archive.com/[email protected]/msg00624.html

The gist of it is that the old version actually
performed redirects where the new version does not.
(On purpose) This allows you to now test that a 302 is
returned to the browser, but may complicate your
redirection testing slightly. 

Vincent had asked if anyone was interested in a flag
allowing you to "turn on" redirects on demand. Sounds
like you may be a +1 for that feature? 

You could probably sub-class the HttpURLConnection w/
your own implementation that allows redirects. If it's
a big deal for you... 

-pgm


--- Michael Rimov <[EMAIL PROTECTED]> wrote:
> Hello All,
> 
> I've got a really weird problem using Cactus to test
> struts actions.  I 
> just upgraded from the older commons cactus to 1.2. 
> I've got some server 
> side testing code that mirrors Strut's
> ActionServlet: [This worked in the 
> old Cactus]
> 
> ActionForward forward = controller.perform(
>       mapping,
>       null,
>       request,
>       response);
> 
> String path = forward.getPath();
> 
> assertTrue("Redirected To Error Page. " 
> ,     !(forward.getName().equals("error")));
> 
> 
> if (path.startsWith("/")) {
>       path = request.getContextPath() + path;
> }
> 
>
response.sendRedirect(response.encodeRedirectURL(path));
> 
> My problem is that when I hit the sendRedirect()
> things never redirect and 
> instead in the client side I get an error code of:
> 
> 302 - Temporarily Moved
> 
> The debug log on the server side shows [the relevant
> portion at least]
> 
> 2001-10-23 15:16:44,400 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199))
> - <isAutoSession
> 2001-10-23 15:16:44,570 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199))
> - 
> <setTestCaseFields
> 2001-10-23 15:16:52,151 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.entry(BaseLog.java:189))
> 
> - >getContextPath()
> 2001-10-23 15:16:52,501 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199))
> - <getContextPath
> 2001-10-23 15:16:52,732 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.debug(BaseLog.java:94))
> - Test result : 
> [Test ok]
> 2001-10-23 15:16:52,912 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.debug(BaseLog.java:94))
> - Result saved 
> in context scope
> 2001-10-23 15:16:53,102 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199))
> - <doTest
> 2001-10-23 15:16:53,283 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199))
> - <doPost
> 2001-10-23 15:16:53,473 DEBUG log.BaseLog 
>
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199))
> - <doPost
> 
> 
> Does anybody have any idea of what's going on?
> 
> Thanks,
>                                       -Mike
> 


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Reply via email to