OpenJPA
  1. OpenJPA
  2. OPENJPA-876

Better test profiles for proprietary databases (DB2, Oracle) and continuous build

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 1.1.0, 1.2.0, 1.3.0, 2.0.0-M2
    • Fix Version/s: 1.0.4, 1.2.1, 1.3.0, 2.0.0-M2
    • Component/s: None
    • Labels:
      None

      Description

      Currently we use the test-custom and test-custom2 profiles in openjpa-persistence-jdbc/pom.xml to enable testing of a variety of databases. Basically anything that does not have a publicly available JDBC drivers.

      This support works well if you run the build manually, but isn't always perfect when using a continuous build system.

      In many continuous build systems you want to have a single build definition which can be run on any number of machines. Ideally each machine could store the database settings in $

      {user.home}

      /.m2/settings.xml. Where this becomes a problem is if a single machine wants to use our test-custom profile in conjuction with another one. For example mvn -Ptest-custom,test-custom-oracle clean install. In order to make this work Maven would have to set variables in test-custom-oracle and then read them in the test-custom profile. Ensuring that the properties are handled in the correct order is cumbersome and doesn't seem to work in recent versions of maven / surefire.

      To resolve the problem I propose creating specific profiles for testing with various proprietary databases. These profiles rely on the user running mvn install:install-file $

      {maven args}

      to install a copy of the jdbc drivers in a local repository prior to running, but after that one time setup step it's a lot easier to run tests on various databases (manually or on a build system).

      1. OPENJPA-876-trunk.patch
        8 kB
        Donald Woods
      2. OPENJPA-876-branches13x.patch
        8 kB
        Donald Woods

        Activity

        Hide
        Donald Woods added a comment -

        Updating Fix Versions, as code has been checked into 1.3.x and trunk.

        Show
        Donald Woods added a comment - Updating Fix Versions, as code has been checked into 1.3.x and trunk.
        Hide
        Donald Woods added a comment -

        Will attach a patch that allows user to supply a local maven repo and override the groupid and version for DB2 and Oracle profiles.

        Show
        Donald Woods added a comment - Will attach a patch that allows user to supply a local maven repo and override the groupid and version for DB2 and Oracle profiles.
        Hide
        Donald Woods added a comment -

        Patch which allows users to supply:
        1) a local repo for non-public DB2 and Oracle artifacts (similar to what is used in docbook-profile)
        2) override the groupId and version for the artifacts (additional attributes not added by earlier commits)
        This can be done on the command line or in .m2/settings.xml, like:
        <profile>
        <id>test-db2-jcc</id>
        <properties>
        <db2.maven.repo>http://my.local.repo/maven</db2.maven.repo>
        <db2.groupid>com.ibm.db2</db2.groupid>
        <db2.version>9.5</db2.version>
        <openjpa.db2.url>jdbc:db2://localhost:50000/OPENJPA</openjpa.db2.url>
        <openjpa.db2.username>guest</openjpa.db2.username>
        <openjpa.db2.password>guest</openjpa.db2.password>
        </properties>
        </profile>

        Show
        Donald Woods added a comment - Patch which allows users to supply: 1) a local repo for non-public DB2 and Oracle artifacts (similar to what is used in docbook-profile) 2) override the groupId and version for the artifacts (additional attributes not added by earlier commits) This can be done on the command line or in .m2/settings.xml, like: <profile> <id>test-db2-jcc</id> <properties> <db2.maven.repo> http://my.local.repo/maven </db2.maven.repo> <db2.groupid>com.ibm.db2</db2.groupid> <db2.version>9.5</db2.version> <openjpa.db2.url>jdbc:db2://localhost:50000/OPENJPA</openjpa.db2.url> <openjpa.db2.username>guest</openjpa.db2.username> <openjpa.db2.password>guest</openjpa.db2.password> </properties> </profile>
        Hide
        Donald Woods added a comment -

        Same patch as for trunk, except created against branches/1.3.x

        Show
        Donald Woods added a comment - Same patch as for trunk, except created against branches/1.3.x
        Hide
        Donald Woods added a comment -

        Michael, I attached 2 patches for your review and possible commit, which made building and running the openjpa-persistence-jdbc unit tests against DB2 a lot easier for me.

        Show
        Donald Woods added a comment - Michael, I attached 2 patches for your review and possible commit, which made building and running the openjpa-persistence-jdbc unit tests against DB2 a lot easier for me.
        Hide
        Donald Woods added a comment -

        Can this be closed now?

        Show
        Donald Woods added a comment - Can this be closed now?

          People

          • Assignee:
            Michael Dick
            Reporter:
            Michael Dick
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development