This content has been marked as final.
Show 2 replies
-
1. Re: assert server.getCurrentViewID()
ssilvert Dec 17, 2007 6:50 PM (in response to kragoth)"Kragoth" wrote:
Why is it that I navigate to /web/index.jsf that I have to assert that my view is /web/index.xhtml.
JSFClientSession is handling the client side of things. To a client (browser), the URL is /web/index.jsf.
JSFServerSession looks at things from a JSF standpoint. To JSF, your view ID is indeed /web/index.xhtml. Note that this is how it looks to your navigation rules in faces-context.xml.
JSFServerSession.getCurrentViewID() is really a shorthand for FacesContext.getViewRoot().getViewId(). As you use JSFUnit to go from page to page, getCurrentViewID() is used to test if your navigation rules are working as expected.
See this wiki page for more tips on using the JSFUnit API:
http://wiki.jboss.org/wiki/WritingJSFUnitTests
Regards,
Stan -
2. Re: assert server.getCurrentViewID()
kragoth Dec 17, 2007 6:58 PM (in response to kragoth)Thanks heaps for your help Stan :)