At the bottom of portal-core.war/WEB-INF/jsp/user/menu.jsp, there is a chunk of commented-out HTML that can be uncommented to provide a "Logout and return to default page" link in the User Portlet. The target URL is configurable. Can you use that to solve your problem?
In the first option if i try to set the LocationURL its of no use since the request to another portlet happens later.
In the second option it works fine but the request in not getting redirect to the other portlet i.e TestPortlet.
Issue is why is it the TestPortlet not getting invoked in the second option