[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cactus-user
Subject:    Running a struts2 action and unit test the returning JSP
From:       tomerb15 <tomer.ben-ezra () mlayers ! com>
Date:       2010-07-21 11:04:52
Message-ID: 29224338.post () talk ! nabble ! com
[Download RAW message or body]


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic