1 Reply Latest reply on Feb 24, 2010 10:18 AM by Rudi Adianto

    Emulating several JSF request in unit test

    Rudi Adianto Newbie

      Can I emulate user interaction that span multiple request (within single conversation)?


      I know I could always do something like this.




      new ComponentTest() {
      
               protected void testComponents() throws Exception
               {
                  login();
                  fillForm1();
                  fillForm2();
                  validateResult();
               }    
      
            }.run();





      But I think it would be great if i can do it like




      new FacesRequest() {
           protected void invokeApplication() throws Exception {
                login();
           } 
      }.setConversationId("1").run();
      
      new FacesRequest() {
           protected void invokeApplication() throws Exception {
                fillForm1();
           } 
      }.setConversationId("1").run();
      
      new FacesRequest() {
           protected void invokeApplication() throws Exception {
                fillForm2();
           } 
      }.setConversationId("1").run();
      
      new FacesRequest() {
           protected void invokeApplication() throws Exception {
                validateResult();
           } 
      }.setConversationId("1").run();




      Is there currently any way to do something like that?