2 Replies Latest reply on Feb 29, 2004 1:58 AM by juha

    Test Database

    ihunter

      [Not sure which forum to use - sorry if there is a better one]

      I'm developing an EJB application to run under JBoss and I'm trying to make it work 'out of the box' - with minimum end user effort.

      Included in my system is the generation of some entity beans, and unit tests (JunitEE) which tests these beans.

      These unit tests need to run on a database with no data (the tests clear out tables for each tested entity). The application needs to run with an 'operational' database, the data being retained.

      The question is 'What is the *minimum* way to set up and configure JBoss and my application to allow my unit tests to run with an alternative database to that of the real application?'. I am using the built in HSQL.

      To summarise - Ideally the user downloads JBoss, installs my app (.ear), runs unit tests, then runs application with the minimum of modifications to the JBoss installation. Repeating the unit tests does not modify the test database.

      Any ideas appreciated.

      Ian Hunter




        • 1. Re: Test Database

          Distribute your JBoss installation with two separate datasource, then provide an ant script that modifies the deployment descriptors (change datasource in jbosscmp-jdbc.xml with XSL for example) between the test suite run and the application suite run.

          • 2. Re: Test Database

            Or provide duplicate deployment descriptors and repackage between the runs with an ant script.