Uploaded image for project: 'appNG'
  1. appNG
  2. APPNG-2148

Use hsqldb memory protocol for jpa tests

    XMLWordPrintable

    Details

      Description

      currently appNG configures a hsqldb Server in the application-testcontext-jpa.xml

      If the application environment is running another process (which might be a parallel build) on the same port, the tests will fail.

      Instead, you can use an In-Process database on the memory protocol. This is faster and does not require an open port.

      Since there is currently no configuration option to change the database type accordingly, I am overwriting the beans in my own testcontext:

       

      <bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
          <constructor-arg type="java.lang.String" value="jdbc:hsqldb:mem://${database:hsql-testdb}" />
      </bean>
       
      <!-- overriding org/appng/testsupport/application-testcontext-jpa.xml server bean. No longer required -->
      <bean id="server" class="java.lang.Object" /> 

       

      see also: http://hsqldb.org/doc/guide/running-chapt.html#rgc_inprocess

       

        Attachments

          Activity

            People

            • Assignee:
              mueller.matthias Matthias Müller
              Reporter:
              c.brueckner Christian Brückner
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: