5 Replies Latest reply on Oct 7, 2008 6:26 PM by kragoth

    Two Sessions?

    kragoth

      When writing a JSFUnit test is it possible to have to simultaneous sessions?

      I thought I had got this working but when I log out in my second session my first session is also logged out.

      Is this even a supported operation?

        • 1. Re: Two Sessions?
          kragoth

          I do know English really :P

          "to" should really be "two"

          So

          When writing a JSFUnit test is it possible to have to simultaneous sessions?

          Should be

          When writing a JSFUnit test is it possible to have two simultaneous sessions?

          • 2. Re: Two Sessions?
            ssilvert

            You can have two sessions, but only one can be a JSFUnit session.

            So your second session should use the HtmlUnit API directly without creating a second JSFSession object. You should only have one JSFSession object at any given time.

            I'd like to address this at some point but it's pretty far down on the priority list unless lots of people have good use cases for it.

            Stan

            • 3. Re: Two Sessions?
              kragoth

              Hmm ok.

              I'll have to go work out how that's done.

              Could you give me a quick pointer on where to start?

              Thanks,
              Tim

              • 4. Re: Two Sessions?
                ssilvert

                Using plain HtmlUnit without the JSFSession class:

                WebClient webClient = new WebClient();
                String warUrl = WebConversationFactory.getWARURL();
                HtmlPage page = (HtmlPage)webClient.getPage(warUrl + "/mypage.jsf");


                Stan

                • 5. Re: Two Sessions?
                  kragoth

                  Excelent. Thanks Stan, I'll get onto it ASAP and let you know how I go :)