10 Replies Latest reply on Jul 31, 2008 12:09 AM by luxspes

    Keep embedded running: running tests faster?

      Hi!


      It is taking 24297 ms to run 1 test -of course it will not be that significant when/if I get to have 300 tests- but right now, it is really painful to wait half a minute to see if a simple test that should run in about 1 sec is working.


      IMHO this is happening because mostly because that is the time it takes to start jboss embedded, so, I was wondering... is there a way to keep jboss embedded running and therefore make tests run faster? (Something like hot-redeploy of tests)


      Is it possible?


      Thanks,


      Regards,

        • 1. Re: Keep embedded running: running tests faster?
          ljcoomber.seamframework.org.coomber.org

          The version in CVS does this but the comment in the JIRA issue shows an example of how to do it in the current release versions:


          https://jira.jboss.org/jira/browse/JBSEAM-2424

          • 2. Re: Keep embedded running: running tests faster?

            Hi!


            Nice idea, but, AFAIK that should only make Seam initialization faster (not prevent jboss embedded re-initialization each time one has to run the tests).


            What I would like to have is something that could start jboss embedded and keep it started between tests execution.


            That way, I could:



            1. Run my test for the first time in day (takes 24 secs to init jboss)

            2. Fix an error

            3. Run my test for the second time in day (takes... i don't know... a lot less? 10 secs? 5 secs?)



            Do you think that is possible?


            Regards,

            • 3. Re: Keep embedded running: running tests faster?
              ljcoomber.seamframework.org.coomber.org

              Sorry, I mis-read your question - this will stop Seam re-initializing JBoss Embedded during a suite of tests which will help when/if you get to 300 tests.


              As for your actual question, I don't know enough about JBoss Embedded to give you a definitive answer I'm afraid.

              • 4. Re: Keep embedded running: running tests faster?
                pmuir

                It sounds like you want to run your tests in a real container, not embedded. Look at JSFUnit.

                • 5. Re: Keep embedded running: running tests faster?

                  Hi!



                  Pete Muir wrote on Jul 29, 2008 13:06:


                  It sounds like you want to run your tests in a real container, not embedded. Look at JSFUnit.


                  Maybe that is what is needed, but I have the feeling that having to run a real container will make things slower instead of faster..


                  There isn't any other way to make this faster?

                  • 6. Re: Keep embedded running: running tests faster?

                    I was wondering... if all I use are Seam POJOs, and then I do not need the EJB features in JBoss... do I still need Jboss Embedded for my Seam tests? for what exactly? are there ways to disable everything I don't use to make jboss embedded load faster? In other words:


                    If my project is a WAR, and I only use Seam POJOs (and I do not use anything EJB related) can I configure jboss embedded to run in a lighter mode? (or replace it with something else? like, i don't know, perhaps Jetty (if what is missing is a servlet engine)?)


                    Thanks

                    • 7. Re: Keep embedded running: running tests faster?
                      pmuir

                      Well an embedded container is booted by the test so by definition starts and stops between test executions.


                      I guess if you can boot Seam manually you can get away with not using any container at all. Or, as I said, look at deploying to a real container like Tomcat.

                      • 8. Re: Keep embedded running: running tests faster?

                        Great! If I get rid of embedded jboss (for my tests), instead of taking taking 24297 ms to run 1 test, it now takes 14000ms (that is a 10000ms (10 seconds) reduction)!



                        Mmmm, I am wondering if developing over tomcat (or jetty) will give me the same performance improvements...


                        Thanks!


                        (BTW Do you know, if there are plans to improve this slow booting of embedded jboss? (perhaps for 5.0). I saw some demos of the next version of Glassfish that was able to boot in less than 3 seconds)

                        • 9. Re: Keep embedded running: running tests faster?

                          Since Seam test framework relies on jndi I don't think the tests can run without JBoss embedded (which is is also a source of some problems in implementing it-tests with maven).

                          • 10. Re: Keep embedded running: running tests faster?

                            Hi!



                            Siarhei Dudzin wrote on Jul 30, 2008 23:01:


                            Since Seam test framework relies on jndi I don't think the tests can run without JBoss embedded (which is is also a source of some problems in implementing it-tests with maven).


                            They can, and they run, and way faster :-D.


                            The problem of jndi for the datasource is easily solved by using Spring.


                            Of course, if you are using JNDI and/or EJB instead of POJOs for other things, you still need to use JBoss embedded.


                            Fortunately, I am only using POJOs.