5 Replies Latest reply on Jun 14, 2011 7:08 AM by Bernard Labno

    SeamTest article

    Bernard Labno Master

      Hello !
      I've written an article about my experiences with testing seam applications. I hope it save you some time I've spent debugging seam sources :D.
      Please post here all comments to the article.


      http://ns354583.ovh.net/seamTestArticle/

        • 1. Re: SeamTest article
          B Tomic Newbie

          The link to the sources is dead...

          • 3. Re: SeamTest article
            Leonardo Viragine Newbie
            Hi,


            Congratulations for your article, docs about SeamTest are very rare.

            I have a doubt, if you allow me...:P

            How can I pass a parameter in "invokeAction"??

            In my case,something like this:

                 invokeAction("#{idiomaManager.save(idioma)}");

            Is it possible??,I´ve tried:

                      setValue("#{idioma}",idioma) //idioma has been already created...
                      invokeAction("#{idiomaManager.save(idioma)}");

            And I got null on the idiomaManager.save...

            Thanks in advance

            Leonardo Luiz Viragine
            • 4. Re: SeamTest article
              Bernard Labno Master

              Very good question. I should add this to my article. The soulution is present in seam examples : jpa/src/org/jboss/seam/example/jpa/test/BookingTest.java


              String id = new FacesRequest("/main.xhtml") {
              
                       @Override
                       protected void invokeApplication() throws Exception {
                          HotelBookingAction hotelBooking = (HotelBookingAction) getInstance("hotelBooking");
                          DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
                          assert hotels.getRowCount()==1;
                          hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
                       }
              
                       @Override
                       protected void renderResponse()
                       {
                          Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
                          assert hotel.getCity().equals("NY");
                          assert hotel.getZip().equals("10011");
                          assert Manager.instance().isLongRunningConversation();
                       }
              }.run();