1 2 Previous Next 22 Replies Latest reply on Nov 12, 2007 10:11 AM by pmuir Go to original post
      • 15. Re: Question about SeamTest
        trickyvail

        Currently there is too much "we need it now" at my company for management to see the value in testing so I have not explored the seam testing functionality. However, I personally expect to utilize testing extensively in the near future and would strongly urge you to continue it's integration and development in seam.

        • 16. Re: Question about SeamTest
          seamdev


          I have tried seam integration testing in past and have not been able to get it working. Support about it was also not strong on forums so we are using other tools to do integration test.

          If there is some significant improvement in seam 2 ga, I am interested in using seam integration test. May be we should have a poll to see how many people have been able to successfully use integration test?

          • 17. Re: Question about SeamTest
            alanlynott

             

            "gavin.king@jboss.com" wrote:
            Are people actually using Seam's integration testing stuff? I've seen very few questions about this, which allows various possible explanations:

            (1) Everyone is using it and it Just Works
            (2) No-one understands it or no-one knows it exists
            (3) No-one does integration testing
            (4) There is some fundamental limitation which means people can't use it on their projects (eg. they are required to use JUnit instead of TestNG)

            Any feedback on this would be very useful.

            Thanks


            (4) Seam's integration testing stuff has fundamental limitations like no decent error messages, integration with DBUnit, etc.

            • 18. Re: Question about SeamTest
              dmitriy.lapko

              I'm trying to use SeamTest and with some success.

              But I have some unclear questions:

              1) If Seam is not bounded to JSF, why SeamTest should be bounded to JSF Phases? I just not really like for testing purposes use all these FacesRequest multiple implemnetations just to call a method of the component... And this doesn't add flexibility to my tests - e.g. if I want to pass any value from one call of FacesRequest to other I have to create a global field in class.

              2) If I use facinating Seam-features like EL in QL, I cannot unit test my application - I need all framework to be started to enable all these Interceptors for my code. What a pity...

              3) If you would like to prepare some test data before executing FacesRequest or to check what was really done in database - you cannot use current configuration of database and have to add your own to make queries. Annoying...

              Because of complexity of configuration of tests and of using them (to write integrational test you have to know Seam like half as Gavin knows it...) they are just unusable for normal team member. I'm sure that SeamTest using should be simplified, now it is too complex.

              For now I have next problems which I cannot solve:

              1) I have two consecutive FacesRequest calls to methods, first of which should start long running conversation and second should end it. First marked by @Begin and second - by @End annotations. The problem is that they don't work in the same conversation - in second call I have:

              new FacesRequest() {
               @Override
               protected void invokeApplication() {
               invokeMethod("#{basket.createBasket}");
               }
               @Override
               protected void renderResponse() throws Exception {
               assert Manager.instance().isLongRunningConversation();
               }
              }.run();
              
              new FacesRequest() {
               @Override
               protected void updateModelValues() throws Exception {
               assert Manager.instance().isLongRunningConversation();
               }
               @Override
               protected void invokeApplication() {
               invokeMethod("#{basket.saveBasket}");
               }
              }.run();
              


              So first assertion inside first request passed successfully. Second - fails. Why?

              2) I run my unit tests inside the deployed and started application. I want to do it also with SeamTests. But disabling of starting embedd ejb container didn't help - anyway a new SeamPhaseListener is started and all other stuff which breaks the application inside which everything was started.

              • 19. Re: Question about SeamTest
                dmitriy.lapko

                BTW, my last 2 problems are solved. First, with long running conversation, shows, that it is really not so intuitive - to test Seam... In my test I didn't get conversationId and didn't pass it to next created FacesRequest. With second - I just start tests in a new Thread with overwritten empty startJBossEmbededdedIfNecessary.

                • 20. Re: Question about SeamTest
                  _polly

                   

                  "gavin.king@jboss.com" wrote:
                  Are people actually using Seam's integration testing stuff?


                  We've been using it, but have had a few problems.

                  - If the domain model changes and the import-test.sql file isn't updated accordingly, there is no helpful SQLException to explain what went wrong. Instead you just have to painstakingly go through all the changes in source control to try and figure out what is wrong with the sql.

                  - Instead of using import-test.sql, it would be nice to be able to represent this data in xml, like with DBUnit, and re-initialise with this data set at the start of each test.

                  - Sometimes the tests randomly fail with a ConcurrentModificationException

                  - @Min hibernate validation doesn't appear to work (I started a separate thread about this one: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=123458)

                  • 21. Re: Question about SeamTest
                    pmuir

                     

                    "alanlynott" wrote:
                    (4) Seam's integration testing stuff has fundamental limitations like no decent error messages, integration with DBUnit, etc.


                    We have integration with DBUnit in Seam 2 (it's very nice IMO). Please elaborate on your error message comment :) We can only make it better with feedback from users!

                    • 22. Re: Question about SeamTest
                      pmuir

                       

                      "dmitriy.lapko" wrote:
                      1) If Seam is not bounded to JSF, why SeamTest should be bounded to JSF Phases? I just not really like for testing purposes use all these FacesRequest multiple implemnetations just to call a method of the component... And this doesn't add flexibility to my tests - e.g. if I want to pass any value from one call of FacesRequest to other I have to create a global field in class.


                      Have you tried using ComponentTest instead? This doesn't emulate the JSF lifecycle.

                      2) If I use facinating Seam-features like EL in QL, I cannot unit test my application - I need all framework to be started to enable all these Interceptors for my code. What a pity...


                      Do you have this working now (I got a bit lost in your posts ;)?

                      3) If you would like to prepare some test data before executing FacesRequest or to check what was really done in database - you cannot use current configuration of database and have to add your own to make queries. Annoying...


                      The DBUnit SeamTest is perfect for this (see the Seamdiscs example).

                      Because of complexity of configuration of tests and of using them (to write integrational test you have to know Seam like half as Gavin knows it...) they are just unusable for normal team member. I'm sure that SeamTest using should be simplified, now it is too complex.


                      I know what you mean. However I don't see how we can make it simpler (yes, we can improve the library setup, but not the structure of the Test harness afaics). Have you got specific ideas to share? :)

                      1) I have two consecutive FacesRequest calls to methods, first of which should start long running conversation and second should end it. First marked by @Begin and second - by @End annotations.


                      You have to manually pass the conversation id around. Please file a JIRA issue to improve the docs for this - its not currently good!

                      2) I run my unit tests inside the deployed and started application. I want to do it also with SeamTests. But disabling of starting embedd ejb container didn't help - anyway a new SeamPhaseListener is started and all other stuff which breaks the application inside which everything was started.


                      Don't understand this...

                      1 2 Previous Next