Uploaded image for project: 'ODE'
  1. ODE
  2. ODE-427

Ability to run BPELTestAbstract without hibernate on the classpath

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1
    • 1.3.2
    • Test environment
    • None

    Description

      BPELTestAbstract creates a ProcessStoreImpl based on OpenJPA.
      I am trying to package the test-environment in a lightweight application without hibernate on the classpath.

      In order to succeed I had to apply this patch.
      I took the opportunity to remove the field _guid that was not used.
      The behavior is identical except that it can execute without hibernate on the classpath.

      ndex: bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
      ===================================================================
      — bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
      (revision 713207)
      +++ bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
      (working copy)
      @@ -86,9 +86,6 @@
      /** Guards access to the _processes and _deploymentUnits */
      private final ReadWriteLock _rw = new ReentrantReadWriteLock();

      • /** GUID used to create a unique in-memory db. */
      • private String _guid = new GUID().toString();
        -
        private ConfStoreConnectionFactory _cf;

      private EndpointReferenceContext eprContext;
      @@ -125,7 +122,7 @@
      } else

      { // If the datasource is not provided, then we create a HSQL-based in-memory // database. Makes testing a bit simpler. - DataSource hsqlds = createInternalDS(_guid); + DataSource hsqlds = createInternalDS(new GUID().toString()); if ("hibernate".equalsIgnoreCase(persistenceType)) _cf = new org.apache.ode.store.hib.DbConfStoreConnectionFactory(hsqlds, props.getProperties(), createDatamodel); else @@ -134,7 +131,21 @@ }

      }
      + /**
      + * @return a ProcessStoreImpl suitable for tests. It relies on a new in-memory hsqldb database.
      + */
      + public static ProcessStoreImpl
      createHsqlDbInMemJPAStore(EndpointReferenceContext eprContext,
      + OdeConfigProperties props)

      { + DataSource hsqlds = createInternalDS(new GUID().toString()); + //when in memory we always create the model as we are starting from scratch + ConfStoreConnectionFactory cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(hsqlds, true); + return new ProcessStoreImpl(eprContext, cf, hsqlds); + }

      + private ProcessStoreImpl(EndpointReferenceContext eprContext,
      ConfStoreConnectionFactory cf, DataSource inMemDs)

      { + this.eprContext = eprContext; + _cf = cf; + _inMemDs = inMemDs; + }

      +
      public void shutdown() {
      if (_inMemDs != null) {
      shutdownInternalDB(_inMemDs);

      Attachments

        Activity

          People

            mriou Matthieu Riou
            hmalphettes Hugues Malphettes
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: