struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Mitchell" <jmitc...@telocity.com>
Subject RE: Strutstest with tiles - verifyForward behavior
Date Mon, 18 Nov 2002 19:15:45 GMT
What version of StrutsTestCase are you using?

from the release 1.9 readme.txt

<snip/>


New Features:
------------

<snip/>

- Added more support for Tiles plugin.  Previously, StrutsTestCase was
relying on the deprecated ActionComponentServlet; now the code uses
more up-to-date mechanisms for verifying Tiles forwards. (MockStrutsTestCase
and CactusStrutsTestCase)



Not sure if that fixes your problem, but it might be a good place to start.

James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

"If you were plowing a field, which would you rather use? Two strong oxen or
1024 chickens?"
- Seymour Cray (1925-1996), father of supercomputing


> -----Original Message-----
> From: Pete Gieser [mailto:pgieser@tampabay.rr.com]
> Sent: Monday, November 18, 2002 6:36 AM
> To: struts-user@jakarta.apache.org
> Subject: Strutstest with tiles - verifyForward behavior
>
>
> Using MockStrutsCase (from release 1.9) with the following test method:
>
>     public void testManagerSuccess()
>     {
>         setRequestPathInfo("/famnet");
>         actionPerform();
>         verifyForward("success");
>         assertNotNull(getSession().getAttribute("members"));
>         verifyNoActionErrors();
>     }
>
> and this section from struts-config.xml:
>
>     <action path="/famnet" type="famnet.ManagerAction">
>       <forward name="success" path="famnet.list" />
>     </action>
>
> and this section from tiles-def.xml:
>
>   <definition name="famnet.list" path="/layout/layout.jsp"
> extends="main.layout">
>     <put name="title"  value="Members"/>
>     <put name="body"   value="/famnet/listBody.jsp"/>
>   </definition>
>
> I'm getting the following error:
>
> processActionForward(famnet.list, false)
>   'famnet.list' - processed as definition
> ------------- ---------------- ---------------
>
> Testcase: testManagerSuccess took 3.636 sec
>  FAILED
> was expecting 'famnet.list' but received '/layout/layout.jsp'
> junit.framework.AssertionFailedError: was expecting 'famnet.list' but
> received '/layout/layout.jsp'
>  at servletunit.struts.Common.verifyForwardPath(Common.java:152)
>  at
> servletunit.struts.MockStrutsTestCase.verifyForward(MockStrutsTestCase.j
> ava:462)
>  at
> struts.junit.TestManagerAction.testManagerSuccess(TestManagerAction.java
> :26)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>
> Is this a bug, or is there something else I should be doing?
>
> Pete
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message