Hi Christian,
You need to look at this wiki page for JSFUnit on WebSphere:
http://wiki.jboss.org/auth/wiki/JSFUnitOnWebSphere
You'll need to subclass FormAuthenticationStrategy.
BTW, this mailing list is for JSFUnit developers and not for user
questions. Please post further questions and comments to the forum page
here:
http://www.jboss.com/index.html?module=bb&op=viewforum&f=269
Thanks,
Stan
Christian Achilli wrote:
Hallo,
I trying to test my webapp running on websphere 6.1. The application
requires form authentication.
The issue is that I cannot refer to the faces context from the jsfunit
session. In the log i see the message:
*
SessionContext.getIHttpSession: id ERIqL_LOZbBuMJRLxbpTVCE failed
length check against 27*
This message make me think that another session cookie is generated
after the WebConversationFactory.makeWebClient call and this one is
not added to the list.
My client test code is as follow:
public void testInitialPage() throws IOException, SAXException
{
WebClientSpec wcSpec = new
WebClientSpec("/homePage.faces",BrowserVersion.INTERNET_EXPLORER_7_0);
wcSpec.getWebClient().setThrowExceptionOnScriptError(false);
FormAuthenticationStrategy formAuth = new
FormAuthenticationStrategy("appl2", "appl2");
formAuth.setSubmitComponent("login_button");
wcSpec.setInitialRequestStrategy(formAuth);
JSFSession jsfSession = new JSFSession(wcSpec);
wcSpec.addCookie("JSESSIONID", session.getId());
WebWindow currentWindow =
jsfSession.getWebClient().getCurrentWindow();// sono in chooseRole
System.out.println("Pagina corrente: "+currentWindow.getName());
JSFClientSession client = jsfSession.getJSFClientSession();
System.out.println(client.getPageAsText());
JSFServerSession *server *= jsfSession.getJSFServerSession();
}
Either clientIDs and currentFacesContext are null in *server* object.
Any idea? Thanks.
Christian
------------------------------------------------------------------------
_______________________________________________
jsfunit-dev mailing list
jsfunit-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jsfunit-dev