[jsfunit-dev] session cookies

Christian Achilli chrisachilli at googlemail.com
Wed Sep 10 11:49:09 EDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsfunit-dev/attachments/20080910/b61d7a32/attachment.html 


More information about the jsfunit-dev mailing list