3 Replies Latest reply on Nov 13, 2007 1:24 PM by Tim Fox

    JBM 2 and test framework

    Andy Taylor Master

      The test framework needs re-writing for JBM2. The current is heavily reliant on using an mbean server and our current mbeans, obviously all this is changing and we wont need the current test service container.

      Currently we start the server and only stop and restart it when the configuration changes, this means that the tests do not run in isolation. This is obviously because it takes too long to restart it every time, the tests would take for ever to complete. Since we'll be able to bootstrap the server standalone the start up time will be much quicker, maybe we need to review how we run our test suite.

      Does anyone have any views?

        • 1. Re: JBM 2 and test framework
          Clebert Suconic Master

           

          Does anyone have any views?


          If we ever rewrite our test framework, maybe we should just reuse the JBoss testsuite, and deploy our services in a JBoss instance, like everybody does. This would mean it would be easier to reuse our tests on the JBAS testsuite.


          Regarding the start/stop of the server, maybe we could run more tests for a single server kill, like the way I'm doing at:

          http://anonsvn.jboss.org/repos/jbossas/branches/JBPAPP_4_2/testsuite/src/main/org/jboss/test/jbossmessaging/clustertest/ClusteredTestCase.java

          • 2. Re: JBM 2 and test framework
            Tim Fox Master

             

            "ataylor" wrote:
            The test framework needs re-writing for JBM2. The current is heavily reliant on using an mbean server and our current mbeans, obviously all this is changing and we wont need the current test service container.


            Yes, we should replace it with one based on the MC.

            We need to replace ServiceContainer with an MC based implementation. This will actually be much cleaner since we'll basically be running exactly what's running in the app server (minus the app server services we don't use)/


            Currently we start the server and only stop and restart it when the configuration changes, this means that the tests do not run in isolation. This is obviously because it takes too long to restart it every time, the tests would take for ever to complete


            Yes that was why it was done. :)


            Since we'll be able to bootstrap the server standalone the start up time will be much quicker, maybe we need to review how we run our test suite.


            Possibly. Originally our test suite used to run the way you suggest, and I changed it to re-use the same server to speed things up as you guessed. The interesting thing is that in the process of switching of changing it I actually caught several bugs that we hadn't noticed before - mainly bugs due to leaving things around in a bad state - stuff that we only noticed when we re-used the server. Starting and stopping each time we wouldn't have seen those bugs. So there's some value IMHO in not starting and stopping each time - each test run should 100% clean itself so there's no need to stop and start?

            • 3. Re: JBM 2 and test framework
              Tim Fox Master

               

              "clebert.suconic@jboss.com" wrote:

              If we ever rewrite our test framework, maybe we should just reuse the JBoss testsuite, and deploy our services in a JBoss instance, like everybody does. This would mean it would be easier to reuse our tests on the JBAS testsuite.


              Well for JBM 2.0, the JBoss instance *is* the microcontainer, so by rewriting ServiceContainer to be MC based, we basically are already running our code in JBAS.