jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomerb15 <tomer.ben-e...@mlayers.com>
Subject Running a struts2 action and unit test the returning JSP
Date Wed, 21 Jul 2010 11:04:52 GMT

Hi all,

I'm trying to unit test the jsp returned by a struts2 action but it is not
seems to be possible.

please note that i'm not interested in the action return string. (e.g
success, input, error etc...)

i have tried to use all possible options to unit test a jsp and instead of
calling my jsp by giving its path, i replace it with the relative path to
the action.

for example (by using JspTestCase):
public void testTest1() throws ServletException, IOException
    {
                //the following call is working
                pageContext.include("/jsp/myJsp.jsp"); 
		
                //but the following is not
                pageContext.include("/myActionPackage/myAction.action");
    }

i also tried to use the ServletTestCase and calling the
requestDispatcher.forward or requestDispatcher.include

Thanks, Tomer Ben Ezra.
-- 
View this message in context: http://old.nabble.com/Running-a-struts2-action-and-unit-test-the-returning-JSP-tp29224338p29224338.html
Sent from the Cactus - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org


Mime
View raw message