You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by je...@apache.org on 2010/08/18 06:51:45 UTC
svn commit: r986564 [3/4] - in /ode/trunk: ./ axis2-war/
axis2-war/src/main/assembly/ axis2-war/src/test/java/org/apache/ode/axis2/
axis2-war/src/test/java/org/apache/ode/axis2/instancecleanup/
axis2-war/src/test/java/org/apache/ode/bpel/dao/ axis2-war...
Modified: ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImplTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImplTest.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImplTest.java (original)
+++ ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImplTest.java Wed Aug 18 04:51:39 2010
@@ -26,8 +26,8 @@ import java.util.concurrent.TimeoutExcep
import javax.transaction.TransactionManager;
import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
+import org.apache.ode.bpel.dao.MessageExchangeDAO;
import org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.ResponseCallback;
-import org.apache.ode.dao.bpel.MessageExchangeDAO;
import org.apache.ode.scheduler.simple.SimpleScheduler;
import org.jmock.Mock;
import org.jmock.MockObjectTestCase;
Modified: ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/cron/CronSchedulerTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/cron/CronSchedulerTest.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/cron/CronSchedulerTest.java (original)
+++ ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/engine/cron/CronSchedulerTest.java Wed Aug 18 04:51:39 2010
@@ -36,7 +36,7 @@ import org.apache.ode.bpel.iapi.Schedule
import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
import org.apache.ode.bpel.iapi.ProcessConf.CleanupInfo;
import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
-import org.apache.ode.dao.hib.bpel.BpelDAOConnectionImpl;
+import org.apache.ode.daohib.bpel.BpelDAOConnectionImpl;
import org.apache.ode.utils.CronExpression;
import org.jmock.Mock;
import org.jmock.MockObjectTestCase;
Modified: ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java (original)
+++ ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java Wed Aug 18 04:51:39 2010
@@ -32,7 +32,7 @@ import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.GUID;
import org.apache.ode.bpel.evar.ExternalVariableModule.Locator;
import org.apache.ode.bpel.evar.ExternalVariableModule.Value;
-import org.h2.jdbcx.JdbcDataSource;
+import org.hsqldb.jdbc.jdbcDataSource;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -54,13 +54,13 @@ public class JdbcExternalVariableEngineT
final QName _varType = new QName("foo", "foobar");
ExternalVariableConf _econf;
- JdbcDataSource _ds;
+ jdbcDataSource _ds;
JdbcExternalVariableModule _engine;
Element _el1;
public void setUp() throws Exception {
- _ds = new JdbcDataSource();
- _ds.setURL("jdbc:h2:mem:" + new GUID().toString() + ";DB_CLOSE_DELAY=-1");
+ _ds = new org.hsqldb.jdbc.jdbcDataSource();
+ _ds.setDatabase("jdbc:hsqldb:mem:" + new GUID().toString());
_ds.setUser("sa");
Connection conn = _ds.getConnection();
Modified: ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java (original)
+++ ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/MockBpelServer.java Wed Aug 18 04:51:39 2010
@@ -18,23 +18,17 @@
*/
package org.apache.ode.bpel.runtime;
-import java.io.File;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
+import org.apache.derby.jdbc.EmbeddedXADataSource;
+import org.apache.geronimo.connector.outbound.GenericConnectionManager;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.LocalTransactions;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.SinglePool;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
+import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
+import org.apache.ode.bpel.dao.BpelDAOConnectionFactory;
+import org.apache.ode.bpel.dao.BpelDAOConnectionFactoryJDBC;
import org.apache.ode.bpel.engine.BpelServerImpl;
import org.apache.ode.bpel.iapi.BindingContext;
import org.apache.ode.bpel.iapi.ContextException;
@@ -47,9 +41,9 @@ import org.apache.ode.bpel.iapi.MyRoleMe
import org.apache.ode.bpel.iapi.PartnerRoleChannel;
import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
import org.apache.ode.bpel.iapi.Scheduler;
+import org.apache.ode.bpel.iapi.Scheduler.MapSerializableRunnable;
import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
-import org.apache.ode.dao.bpel.BpelDAOConnectionFactory;
-import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
+import org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl;
import org.apache.ode.il.EmbeddedGeronimoFactory;
import org.apache.ode.il.MockScheduler;
import org.apache.ode.il.config.OdeConfigProperties;
@@ -57,9 +51,28 @@ import org.apache.ode.il.dbutil.Database
import org.apache.ode.store.ProcessStoreImpl;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.GUID;
+import org.hsqldb.jdbc.jdbcDataSource;
+import org.tranql.connector.derby.EmbeddedLocalMCF;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import javax.resource.spi.ConnectionManager;
+import javax.sql.DataSource;
+import javax.transaction.TransactionManager;
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Collections;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
class MockBpelServer {
@@ -69,8 +82,7 @@ class MockBpelServer {
Database _database;
DataSource _dataSource;
SchedulerWrapper _scheduler;
- BpelDAOConnectionFactory _bpelDaoCF;
- ConfStoreDAOConnectionFactory _confDaoCF;
+ BpelDAOConnectionFactory _daoCF;
EndpointReferenceContext _eprContext;
MessageExchangeContext _mexContext;
BindingContext _bindContext;
@@ -85,16 +97,16 @@ class MockBpelServer {
createDataSource();
createScheduler();
createDAOConnection();
- if (_bpelDaoCF == null)
+ if (_daoCF == null)
throw new RuntimeException("No DAO");
- _server.setDaoConnectionFactory(_bpelDaoCF);
+ _server.setDaoConnectionFactory(_daoCF);
_server.setInMemDaoConnectionFactory(new BpelDAOConnectionFactoryImpl(_scheduler));
if (_scheduler == null)
throw new RuntimeException("No scheduler");
createEndpointReferenceContext();
Properties storeProps = new Properties();
storeProps.setProperty("hibernate.hbm2ddl.auto", "update");
- _store = new ProcessStoreImpl(_eprContext,_txManager,_confDaoCF);
+ _store = new ProcessStoreImpl(_eprContext, _dataSource,"hib", new OdeConfigProperties(storeProps, ""), true);
_server.setScheduler(_scheduler);
_server.setEndpointReferenceContext(_eprContext);
_server.setMessageExchangeContext(createMessageExchangeContext());
@@ -170,15 +182,45 @@ class MockBpelServer {
}
protected DataSource createDataSource() throws Exception {
- Properties props = new Properties();
- props.setProperty(OdeConfigProperties.PROP_DAOCF, "org.apache.ode.dao.hib.bpel.BpelDAOConnectionFactoryImpl");
- props.setProperty(OdeConfigProperties.PROP_DAOCF_STORE, "org.apache.ode.dao.hib.store.ConfStoreDAOConnectionFactoryImpl");
- OdeConfigProperties odeProps = new OdeConfigProperties(props,"");
- _database = new Database(odeProps);
- _database.setTransactionManager(_txManager);
- _database.start();
- _dataSource=_database.getDataSource();
- return _dataSource;
+ TransactionSupport transactionSupport = LocalTransactions.INSTANCE;
+ ConnectionTracker connectionTracker = new ConnectionTrackingCoordinator();
+
+ PoolingSupport poolingSupport = new SinglePool(
+ 10,
+ 0,
+ 1000,
+ 1,
+ true,
+ false,
+ false);
+
+ ConnectionManager connectionManager = new GenericConnectionManager(
+ transactionSupport,
+ poolingSupport,
+ null,
+ connectionTracker,
+ (RecoverableTransactionManager) _txManager,
+ getClass().getName(),
+ getClass().getClassLoader());
+
+
+ EmbeddedLocalMCF mcf = new org.tranql.connector.derby.EmbeddedLocalMCF();
+ mcf.setCreateDatabase(true);
+ mcf.setDatabaseName("target/testdb");
+ mcf.setUserName("sa");
+ mcf.setPassword("");
+ _dataSource = (DataSource) mcf.createConnectionFactory(connectionManager);
+ return _dataSource;
+
+
+// d = org.tranql.connector.jdbc.JDBCDriverMCF();
+// EmbeddedXADataSource ds = new EmbeddedXADataSource();
+// ds.setCreateDatabase("create");
+// ds.setDatabaseName("target/testdb");
+// ds.setUser("sa");
+// ds.setPassword("");
+// _dataSource = ds;
+// return _dataSource;
}
protected Scheduler createScheduler() throws Exception {
@@ -192,15 +234,30 @@ class MockBpelServer {
return _scheduler;
}
- protected void createDAOConnection() throws Exception {
+ protected BpelDAOConnectionFactory createDAOConnection() throws Exception {
if (_txManager == null)
throw new RuntimeException("No transaction manager");
if (_dataSource == null)
throw new RuntimeException("No data source");
-
- _bpelDaoCF = _database.createDaoCF();
- _confDaoCF = _database.createDaoStoreCF();
+//
+// BpelDAOConnectionFactoryJDBC daoCF = new BPELDAOConnectionFactoryImpl();
+// daoCF.setDataSource(_dataSource);
+// daoCF.setTransactionManager(_txManager);
+// Properties props = new Properties();
+// props.put("openjpa.Log", "log4j");
+// props.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=false)");
+// daoCF.init(props);
+// _daoCF = daoCF;
+ org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl daoCF = new org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl();
+ daoCF.setDataSource(_dataSource);
+ daoCF.setTransactionManager(_txManager);
+ Properties props = new Properties();
+ props.setProperty("hibernate.hbm2ddl.auto", "update");
+ daoCF.init(props);
+
+ _daoCF = daoCF;
+ return _daoCF;
}
protected EndpointReferenceContext createEndpointReferenceContext() {
@@ -315,9 +372,9 @@ class MockBpelServer {
public <T> T execTransaction(Callable<T> transaction) throws Exception, ContextException {
return _scheduler.execTransaction(transaction, 0);
}
-
+
public <T> T execTransaction(Callable<T> transaction, int timeout) throws Exception, ContextException {
- return _scheduler.execTransaction(transaction, timeout);
+ return _scheduler.execTransaction(transaction, timeout);
}
public void beginTransaction() throws Exception {
@@ -360,12 +417,14 @@ class MockBpelServer {
public void setPolledRunnableProcesser(JobProcessor delegatedRunnableProcessor) {
}
- public boolean amICoordinator() {
- return true;
- }
-
- public void acquireTransactionLocks() {
-
- }
+ public boolean amICoordinator() {
+ return true;
+ }
+
+
+ public void acquireTransactionLocks() {
+ // TODO Auto-generated method stub
+
+ }
}
}
Modified: ode/trunk/bpel-runtime/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/test/resources/log4j.properties?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/test/resources/log4j.properties (original)
+++ ode/trunk/bpel-runtime/src/test/resources/log4j.properties Wed Aug 18 04:51:39 2010
@@ -35,6 +35,4 @@ log4j.category.org.apache.ode.jacob=INFO
log4j.category.org.apache.ode.store=INFO
log4j.category.org.apache.ode.daohib=INFO
log4j.category.org.apache.ode.utils=INFO
-log4j.category.org.apache.ode.sql=INFO
-log4j.category.openjpa=INFO
Modified: ode/trunk/bpel-store/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-store/pom.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-store/pom.xml (original)
+++ ode/trunk/bpel-store/pom.xml Wed Aug 18 04:51:39 2010
@@ -69,84 +69,155 @@
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-stax-api_1.0_spec</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xmlbeans</groupId>
+ <artifactId>xmlbeans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>wsdl4j</groupId>
+ <artifactId>wsdl4j</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>${spring.version}</version>
</dependency>
+
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.geronimo.components</groupId>
- <artifactId>geronimo-transaction</artifactId>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa</artifactId>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
<scope>test</scope>
</dependency>
- <!-- for the integration tests - seems to work with the openjpa enhanced enities -->
<dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-hibernate</artifactId>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-hibernate</artifactId>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.serp</groupId>
+ <artifactId>serp</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
</dependencies>
- <build>
- <plugins>
+ <build>
+ <plugins>
<plugin>
- <artifactId>maven-surefire-plugin</artifactId>
+ <artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
- <id>hibernate-jpa</id>
- <phase>integration-test</phase>
+ <id>openjpa-enhancer</id>
+ <phase>process-classes</phase>
<goals>
- <goal>test</goal>
+ <goal>run</goal>
</goals>
<configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/hibernate-jpa</reportsDirectory>
- <systemPropertyVariables>
- <dao.factory.store>org.apache.ode.dao.jpa.hibernate.ConfStoreDAOConnectionFactoryImpl</dao.factory.store>
- </systemPropertyVariables>
- <includes>
- <include>**/DaoTest.java</include>
- <include>**/ProcessStoreTest.java</include>
- </includes>
- </configuration>
- </execution>
- <execution>
- <id>hibernate</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <reportsDirectory>${project.build.directory}/surefire-reports/hibernate</reportsDirectory>
- <systemPropertyVariables>
- <dao.factory.store>org.apache.ode.dao.hib.store.ConfStoreDAOConnectionFactoryImpl</dao.factory.store>
- </systemPropertyVariables>
- <includes>
- <include>**/DaoTest.java</include>
- <include>**/ProcessStoreTest.java</include>
- </includes>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.test.classpath"/>
+ <path id="classpath">
+ <pathelement path="${maven.runtime.classpath}"/>
+ </path>
+ <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="classpath"/>
+ <openjpac>
+ <fileset dir="${basedir}/src/main">
+ <include name="**/*.java" />
+ </fileset>
+ <classpath>
+ <pathelement location="${basedir}/target/classes"/>
+ <pathelement path="${maven.runtime.classpath}"/>
+ </classpath>
+ </openjpac>
+ </tasks>
</configuration>
</execution>
</executions>
</plugin>
- </plugins>
- </build>
-
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xdoclet-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>xdoclet</goal>
+ </goals>
+
+ <configuration>
+ <tasks>
+ <hibernatedoclet excludedTags="@version,@author,@todo" verbose="true"
+ destdir="${project.build.outputDirectory}" force="true">
+ <hibernate version="3.0"/>
+ <fileset dir="${project.build.sourceDirectory}" includes="org/apache/ode/store/hib/*.java"/>
+ </hibernatedoclet>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java (original)
+++ ode/trunk/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java Wed Aug 18 04:51:39 2010
@@ -18,57 +18,34 @@
*/
package org.apache.ode.store;
-import java.io.File;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.sql.DataSource;
-import javax.transaction.TransactionManager;
-import javax.xml.namespace.QName;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.dd.DeployDocument;
import org.apache.ode.bpel.dd.TDeployment;
-import org.apache.ode.bpel.iapi.ContextException;
-import org.apache.ode.bpel.iapi.EndpointReferenceContext;
-import org.apache.ode.bpel.iapi.ProcessConf;
-import org.apache.ode.bpel.iapi.ProcessState;
-import org.apache.ode.bpel.iapi.ProcessStore;
-import org.apache.ode.bpel.iapi.ProcessStoreEvent;
-import org.apache.ode.bpel.iapi.ProcessStoreListener;
-import org.apache.ode.bpel.iapi.OdeGlobalConfig;
-import org.apache.ode.dao.store.ConfStoreDAOConnection;
-import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
-import org.apache.ode.dao.store.DeploymentUnitDAO;
-import org.apache.ode.dao.store.ProcessConfDAO;
+import org.apache.ode.bpel.iapi.*;
+import org.apache.ode.il.config.OdeConfigProperties;
import org.apache.ode.store.DeploymentUnitDir.CBPInfo;
import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.GUID;
import org.apache.ode.utils.msg.MessageBundle;
-import org.h2.jdbcx.JdbcDataSource;
+import org.hsqldb.jdbc.jdbcDataSource;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import javax.sql.DataSource;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
/**
* <p>
* JDBC-based implementation of a process store. Also provides an "in-memory" store by way of HSQL database.
@@ -101,11 +78,9 @@ public class ProcessStoreImpl implements
/** Guards access to the _processes and _deploymentUnits */
private final ReadWriteLock _rw = new ReentrantReadWriteLock();
- private ConfStoreDAOConnectionFactory _cf;
-
- private TransactionManager _txm;
+ private ConfStoreConnectionFactory _cf;
- private EndpointReferenceContext _eprContext;
+ private EndpointReferenceContext eprContext;
private boolean generateProcessEventsAll;
@@ -125,14 +100,43 @@ public class ProcessStoreImpl implements
* In-memory DataSource, or <code>null</code> if we are using a real DS. We need this to shutdown the DB.
*/
private DataSource _inMemDs;
-
+
+ public ProcessStoreImpl() {
+ this(null, null, "", new OdeConfigProperties(new Properties(), ""), true);
+ }
+
+ public ProcessStoreImpl(EndpointReferenceContext eprContext, DataSource ds, String persistenceType, OdeConfigProperties props, boolean createDatamodel) {
+ this.eprContext = eprContext;
+ this.generateProcessEventsAll = props.getProperty("generateProcessEvents", "all").equals("all");
+ if (ds != null) {
+ // ugly hack
+ if (persistenceType.toLowerCase().indexOf("hib") != -1) {
+ _cf = new org.apache.ode.store.hib.DbConfStoreConnectionFactory(ds, props.getProperties(), createDatamodel, props.getTxFactoryClass());
+ } else {
+ _cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(ds, createDatamodel, props.getTxFactoryClass());
+ }
+ } else {
+ // If the datasource is not provided, then we create a HSQL-based
+ // in-memory database. Makes testing a bit simpler.
+ DataSource hsqlds = createInternalDS(new GUID().toString());
+ if ("hibernate".equalsIgnoreCase(persistenceType)) {
+ _cf = new org.apache.ode.store.hib.DbConfStoreConnectionFactory(hsqlds, props.getProperties(), createDatamodel, props.getTxFactoryClass());
+ } else {
+ _cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(hsqlds, createDatamodel, props.getTxFactoryClass());
+ }
+ _inMemDs = hsqlds;
+ }
+ }
+
/**
* Constructor that hardwires OpenJPA on a new in-memory database. Suitable for tests.
*/
- public <E> ProcessStoreImpl(EndpointReferenceContext eprContext, TransactionManager mgr, ConfStoreDAOConnectionFactory cf) {
- _eprContext = eprContext;
- _txm = mgr;
- _cf=cf;
+ public ProcessStoreImpl(EndpointReferenceContext eprContext, DataSource inMemDs) {
+ this.eprContext = eprContext;
+ DataSource hsqlds = createInternalDS(new GUID().toString());
+ //when in memory we always create the model as we are starting from scratch
+ _cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(hsqlds, true, OdeConfigProperties.DEFAULT_TX_FACTORY_CLASS_NAME);
+ _inMemDs = hsqlds;
}
public void shutdown() {
@@ -187,7 +191,7 @@ public class ProcessStoreImpl implements
if (autoincrementVersion || du.getStaticVersion() == -1) {
// Process and DU use a monotonically increased single version number by default.
version = exec(new Callable<Long>() {
- public Long call(ConfStoreDAOConnection conn) {
+ public Long call(ConfStoreConnection conn) {
return conn.getNextVersion();
}
});
@@ -239,7 +243,7 @@ public class ProcessStoreImpl implements
}
ProcessConfImpl pconf = new ProcessConfImpl(pid, processDD.getName(), version, du, processDD, deployDate,
- calcInitialProperties(du.getProperties(), processDD), calcInitialState(processDD), _eprContext, _configDir, generateProcessEventsAll);
+ calcInitialProperties(du.getProperties(), processDD), calcInitialState(processDD), eprContext, _configDir, generateProcessEventsAll);
processes.add(pconf);
}
@@ -258,7 +262,7 @@ public class ProcessStoreImpl implements
// Do the deployment in the DB. We need this so that we remember deployments across system shutdowns.
// We don't fail if there is a DB error, simply print some errors.
deployed = exec(new Callable<Collection<QName>>() {
- public Collection<QName> call(ConfStoreDAOConnection conn) {
+ public Collection<QName> call(ConfStoreConnection conn) {
// Check that this deployment unit is not deployed.
DeploymentUnitDAO dudao = conn.getDeploymentUnit(du.getName());
if (dudao != null) {
@@ -354,7 +358,7 @@ public class ProcessStoreImpl implements
public Collection<QName> undeploy(final String duName) {
try {
exec(new Callable<Collection<QName>>() {
- public Collection<QName> call(ConfStoreDAOConnection conn) {
+ public Collection<QName> call(ConfStoreConnection conn) {
DeploymentUnitDAO dudao = conn.getDeploymentUnit(duName);
if (dudao != null)
dudao.delete();
@@ -429,7 +433,7 @@ public class ProcessStoreImpl implements
// Update in the database.
ProcessState old = exec(new Callable<ProcessState>() {
- public ProcessState call(ConfStoreDAOConnection conn) {
+ public ProcessState call(ConfStoreConnection conn) {
DeploymentUnitDAO dudao = conn.getDeploymentUnit(dudir.getName());
if (dudao == null) {
String errmsg = __msgs.msgProcessNotFound(pid);
@@ -490,7 +494,7 @@ public class ProcessStoreImpl implements
final DeploymentUnitDir dudir = pconf.getDeploymentUnit();
exec(new ProcessStoreImpl.Callable<Object>() {
- public Object call(ConfStoreDAOConnection conn) {
+ public Object call(ConfStoreConnection conn) {
DeploymentUnitDAO dudao = conn.getDeploymentUnit(dudir.getName());
if (dudao == null)
return null;
@@ -512,7 +516,7 @@ public class ProcessStoreImpl implements
public void loadAll() {
final ArrayList<ProcessConfImpl> loaded = new ArrayList<ProcessConfImpl>();
exec(new Callable<Object>() {
- public Object call(ConfStoreDAOConnection conn) {
+ public Object call(ConfStoreConnection conn) {
Collection<DeploymentUnitDAO> dus = conn.getDeploymentUnits();
for (DeploymentUnitDAO du : dus)
try {
@@ -557,7 +561,7 @@ public class ProcessStoreImpl implements
public long getCurrentVersion() {
long version = exec(new Callable<Long>() {
- public Long call(ConfStoreDAOConnection conn) {
+ public Long call(ConfStoreConnection conn) {
return conn.getNextVersion();
}
});
@@ -615,7 +619,7 @@ public class ProcessStoreImpl implements
}
}
- private ConfStoreDAOConnection getConnection() {
+ private ConfStoreConnection getConnection() {
return _cf.getConnection();
}
@@ -706,7 +710,7 @@ public class ProcessStoreImpl implements
// TODO: update the props based on the values in the DB.
ProcessConfImpl pconf = new ProcessConfImpl(p.getPID(), p.getType(), p.getVersion(), dud, pinfo, dudao
- .getDeployDate(), props, p.getState(), _eprContext, _configDir, generateProcessEventsAll);
+ .getDeployDate(), props, p.getState(), eprContext, _configDir, generateProcessEventsAll);
version = p.getVersion();
_processes.put(pconf.getProcessId(), pconf);
@@ -756,7 +760,7 @@ public class ProcessStoreImpl implements
try {
return exec(new Callable<Boolean>() {
- public Boolean call(ConfStoreDAOConnection conn) {
+ public Boolean call(ConfStoreConnection conn) {
DeploymentUnitDAO dudao = conn.getDeploymentUnit(duName);
if (dudao == null)
return false;
@@ -781,32 +785,27 @@ public class ProcessStoreImpl implements
*/
abstract class Callable<V> implements java.util.concurrent.Callable<V> {
public V call() {
- boolean success = false;
- ConfStoreDAOConnection conn = getConnection();
+ boolean success = false;
+ // in JTA, transaction is bigger than the session
+ _cf.beginTransaction();
+ ConfStoreConnection conn = getConnection();
try {
- if (_txm!=null)
- _txm.begin();
V r = call(conn);
- if (_txm!=null)
- _txm.commit();
+ _cf.commitTransaction();
success = true;
return r;
- } catch (Exception e){
- e.printStackTrace();
- __log.error("TxError",e);
- return null;
} finally {
- if (!success && _txm != null)
+ if (!success)
try {
- _txm.rollback();
+ _cf.rollbackTransaction();
} catch (Exception ex) {
__log.error("DbError", ex);
}
- conn.close();
}
+ // session is closed automatically when committed or rolled back under JTA
}
- abstract V call(ConfStoreDAOConnection conn);
+ abstract V call(ConfStoreConnection conn);
}
public void setDeployDir(File depDir) {
@@ -837,11 +836,11 @@ public class ProcessStoreImpl implements
}
public static DataSource createInternalDS(String guid) {
- JdbcDataSource ds = new JdbcDataSource();
- ds.setURL("jdbc:h2:mem:" + guid);
- ds.setUser("sa");
- ds.setPassword("");
- return ds;
+ jdbcDataSource hsqlds = new jdbcDataSource();
+ hsqlds.setDatabase("jdbc:hsqldb:mem:" + guid);
+ hsqlds.setUser("sa");
+ hsqlds.setPassword("");
+ return hsqlds;
}
public static void shutdownInternalDB(DataSource ds) {
Modified: ode/trunk/bpel-store/src/test/java/org/apache/ode/store/ProcessStoreTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-store/src/test/java/org/apache/ode/store/ProcessStoreTest.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-store/src/test/java/org/apache/ode/store/ProcessStoreTest.java (original)
+++ ode/trunk/bpel-store/src/test/java/org/apache/ode/store/ProcessStoreTest.java Wed Aug 18 04:51:39 2010
@@ -23,49 +23,29 @@ import java.net.URI;
import java.util.Collection;
import java.util.EnumSet;
import java.util.List;
-import java.util.Properties;
-import javax.transaction.TransactionManager;
import javax.xml.namespace.QName;
import junit.framework.TestCase;
import org.apache.ode.bpel.iapi.ProcessConf;
import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
-import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
-import org.apache.ode.il.config.OdeConfigProperties;
-import org.apache.ode.il.dbutil.Database;
-import org.apache.ode.il.txutil.TxManager;
public class ProcessStoreTest extends TestCase {
ProcessStoreImpl _ps;
- Database _db;
- ConfStoreDAOConnectionFactory _cf;
-
private File _testdd;
-
+
public void setUp() throws Exception {
- Properties props = new Properties();
- props.setProperty(OdeConfigProperties.PROP_DAOCF_STORE,System.getProperty(OdeConfigProperties.PROP_DAOCF_STORE,OdeConfigProperties.DEFAULT_DAOCF_STORE_CLASS));
- OdeConfigProperties odeProps = new OdeConfigProperties(props, "");
- _db = new Database(odeProps);
- TxManager tx = new TxManager(odeProps);
- TransactionManager txm = tx.createTransactionManager();
- _db.setTransactionManager(txm);
- _db.start();
- _cf = _db.createDaoStoreCF();
- _ps = new ProcessStoreImpl(null,txm, _cf);
+ System.setProperty("openjpa.properties", "/openjpa.xml");
+ _ps = new ProcessStoreImpl();
_ps.loadAll();
- URI tdd = getClass().getResource("/testdd/deploy.xml").toURI();
+ URI tdd= getClass().getResource("/testdd/deploy.xml").toURI();
_testdd = new File(tdd.getPath()).getParentFile();
-
- }
+ }
public void tearDown() throws Exception {
_ps.shutdown();
- _cf.shutdown();
- _db.shutdown();
}
public void testSanity() {
Modified: ode/trunk/bpel-test/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/pom.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-test/pom.xml (original)
+++ ode/trunk/bpel-test/pom.xml Wed Aug 18 04:51:39 2010
@@ -57,7 +57,7 @@
<dependency>
<groupId>org.apache.ode</groupId>
<artifactId>ode-dao-jpa</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.ode</groupId>
<artifactId>ode-bpel-runtime</artifactId>
@@ -146,50 +146,28 @@
<artifactId>junit</artifactId>
</dependency>
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>tranql</groupId>
<artifactId>tranql-connector-derby-common</artifactId>
<version>1.1</version>
</dependency>
-
- <!-- for the integration tests - seems to work with the openjpa enhanced enities -->
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-hibernate</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-hibernate</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
<systemPropertyVariables>
<org.apache.ode.autoRetireProcess>true</org.apache.ode.autoRetireProcess>
</systemPropertyVariables>
<argLine>-Xms512M -Xmx1024M -XX:MaxPermSize=512M</argLine>
- </configuration>
- </plugin>
- </plugins>
-
- </build>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java (original)
+++ ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java Wed Aug 18 04:51:39 2010
@@ -23,26 +23,38 @@ import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.net.URL;
+import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
-import java.util.Map;
import java.util.Properties;
+import java.util.concurrent.Callable;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.geronimo.connector.outbound.GenericConnectionManager;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.LocalTransactions;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.SinglePool;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
+import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+import javax.resource.spi.ConnectionManager;
+import javax.sql.DataSource;
+import javax.transaction.TransactionManager;
import javax.xml.namespace.QName;
+import org.apache.derby.jdbc.EmbeddedXADataSource;
import org.apache.ode.bpel.common.evt.DebugBpelEventListener;
+import org.apache.ode.bpel.dao.BpelDAOConnectionFactory;
import org.apache.ode.bpel.engine.BpelServerImpl;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.EndpointReferenceContext;
import org.apache.ode.bpel.iapi.Message;
import org.apache.ode.bpel.iapi.MessageExchange;
import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
@@ -52,27 +64,30 @@ import org.apache.ode.bpel.iapi.ProcessS
import org.apache.ode.bpel.iapi.MessageExchange.Status;
import org.apache.ode.bpel.iapi.MyRoleMessageExchange.CorrelationStatus;
import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
-import org.apache.ode.dao.bpel.BpelDAOConnectionFactory;
-import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
-import org.apache.ode.il.MockScheduler;
+import org.apache.ode.il.EmbeddedGeronimoFactory;
import org.apache.ode.il.config.OdeConfigProperties;
-import org.apache.ode.il.dbutil.Database;
import org.apache.ode.store.ProcessConfImpl;
import org.apache.ode.store.ProcessStoreImpl;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.GUID;
+import org.apache.ode.scheduler.simple.SimpleScheduler;
+import org.apache.ode.scheduler.simple.JdbcDelegate;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.w3c.dom.Element;
+import java.util.concurrent.*;
public abstract class BPELTestAbstract {
- public static final long WAIT_BEFORE_INVOKE_TIMEOUT = 2000;
-
- private static final String SHOW_EVENTS_ON_CONSOLE = "no";
+ public static final long WAIT_BEFORE_INVOKE_TIMEOUT = 2000;
+
+ private static final String SHOW_EVENTS_ON_CONSOLE = "no";
protected BpelServerImpl _server;
+ public static TransactionManager _txManager = null;
+ public static DataSource _dataSource = null;
+
protected ProcessStore store;
protected MessageExchangeContextImpl mexContext;
@@ -80,12 +95,12 @@ public abstract class BPELTestAbstract {
protected EntityManager em;
protected EntityManagerFactory emf;
+
+ protected ExecutorService executorService = Executors.newFixedThreadPool(1);
- protected MockScheduler scheduler;
+ protected SimpleScheduler scheduler;
- protected BpelDAOConnectionFactory _bcf;
-
- protected ConfStoreDAOConnectionFactory _scf;
+ protected BpelDAOConnectionFactory _cf;
/** Failures that have been detected. */
protected List<Failure> _failures;
@@ -98,77 +113,54 @@ public abstract class BPELTestAbstract {
/** What's actually been deployed. */
private List<Deployment> _deployed;
-
- private MockTransactionManager _txm;
-
- private Database _db;
@Before
public void setUp() throws Exception {
+ EmbeddedGeronimoFactory factory = new EmbeddedGeronimoFactory();
+ if (_txManager == null) {
+ _txManager = createTransactionManager();
+ _dataSource = createDataSource(false);
+ {
+ _txManager.begin();
+ try {
+ Connection c = _dataSource.getConnection();
+ c.prepareStatement(org.apache.commons.io.IOUtils.toString(getClass().getResourceAsStream("/scheduler-schema.sql"))).execute();
+ c.close();
+ } catch (Exception e) {
+
+ }
+ _txManager.commit();
+ }
+ }
+// try {
+// _dataSource.getConnection();
+// } catch (Exception e) {
+//
+// }
+// createDataSource(false);
_failures = new CopyOnWriteArrayList<Failure>();
_server = new BpelServerImpl();
+ Properties props = getConfigProperties();
+ _server.setConfigProperties(props);
mexContext = new MessageExchangeContextImpl();
_deployments = new ArrayList<Deployment>();
_invocations = new ArrayList<Invocation>();
_deployed = new ArrayList<Deployment>();
-
- _txm = new MockTransactionManager();
- Properties props = new Properties();
- props.setProperty(OdeConfigProperties.PROP_DAOCF_STORE, "org.apache.ode.dao.hib.store.ConfStoreDAOConnectionFactoryImpl");
- OdeConfigProperties odeProps = new OdeConfigProperties(props,"");
- _db = new Database(odeProps);
- _db.setTransactionManager(_txm);
- _db.start();
-
- if (Boolean.getBoolean("org.apache.ode.test.persistent")) {
- _server.setDaoConnectionFactory(_bcf);
- scheduler = new MockScheduler() {
- @Override
- public void beginTransaction() {
- super.beginTransaction();
- em.getTransaction().begin();
- }
- @Override
- public void commitTransaction() {
- super.commitTransaction();
- em.getTransaction().commit();
- }
-
- @Override
- public void rollbackTransaction() {
- super.rollbackTransaction();
- em.getTransaction().rollback();
- }
-
- };
- } else {
- scheduler = new MockScheduler(_txm);
- _bcf = new BpelDAOConnectionFactoryImpl(scheduler);
- _bcf.init(null, _txm, _txm);
- _server.setDaoConnectionFactory(_bcf);
+ {
+ JdbcDelegate del = new JdbcDelegate(_dataSource);
+ scheduler = new SimpleScheduler("node", del, props);
+ scheduler.setTransactionManager(_txManager);
+ _cf = new BpelDAOConnectionFactoryImpl(scheduler);
+ _server.setDaoConnectionFactory(_cf);
}
_server.setInMemDaoConnectionFactory(new BpelDAOConnectionFactoryImpl(scheduler));
_server.setScheduler(scheduler);
_server.setBindingContext(new BindingContextImpl());
_server.setMessageExchangeContext(mexContext);
scheduler.setJobProcessor(_server);
- final EndpointReferenceContext eprContext = new EndpointReferenceContext() {
- public EndpointReference resolveEndpointReference(Element epr) {
- return null;
- }
-
- public EndpointReference convertEndpoint(QName targetType, Element sourceEndpoint) {
- return null;
- }
-
- public Map getConfigLookup(EndpointReference epr) {
- return Collections.EMPTY_MAP;
- }
- };
-
- _scf = _db.createDaoStoreCF();
- store = new ProcessStoreImpl(eprContext, _txm, _scf);
+ scheduler.setExecutorService(executorService);
+ store = new ProcessStoreImpl(null, _dataSource, "hib", new OdeConfigProperties(new Properties(), ""), true);
store.registerListener(new ProcessStoreListener() {
public void onProcessStoreEvent(ProcessStoreEvent event) {
// bounce the process
@@ -181,10 +173,10 @@ public abstract class BPELTestAbstract {
}
}
});
- _server.setConfigProperties(getConfigProperties());
_server.registerBpelEventListener(new DebugBpelEventListener());
_server.init();
_server.start();
+ scheduler.start();
}
@After
@@ -206,7 +198,57 @@ public abstract class BPELTestAbstract {
_deployed = null;
_deployments = null;
_invocations = null;
+
+
+ }
+ protected TransactionManager createTransactionManager() throws Exception {
+ EmbeddedGeronimoFactory factory = new EmbeddedGeronimoFactory();
+ TransactionManager _txManager = factory.getTransactionManager();
+ _txManager.setTransactionTimeout(30);
+ return _txManager;
+ }
+
+ protected DataSource createDataSource(boolean shutdown) throws Exception {
+ TransactionSupport transactionSupport = LocalTransactions.INSTANCE;
+ ConnectionTracker connectionTracker = new ConnectionTrackingCoordinator();
+
+ PoolingSupport poolingSupport = new SinglePool(
+ 10,
+ 0,
+ 1000,
+ 1,
+ true,
+ false,
+ false);
+
+ ConnectionManager connectionManager = new GenericConnectionManager(
+ transactionSupport,
+ poolingSupport,
+ null,
+ connectionTracker,
+ (RecoverableTransactionManager) _txManager,
+ getClass().getName(),
+ getClass().getClassLoader());
+
+ org.tranql.connector.derby.EmbeddedLocalMCF mcf = new org.tranql.connector.derby.EmbeddedLocalMCF();
+ mcf.setCreateDatabase(true);
+ mcf.setDatabaseName("target/testdb");
+ mcf.setUserName("sa");
+ mcf.setPassword("");
+ if (shutdown) {
+ mcf.setShutdownDatabase("shutdown");
+ }
+ return (DataSource) mcf.createConnectionFactory(connectionManager);
+
+// d = org.tranql.connector.jdbc.JDBCDriverMCF();
+// EmbeddedXADataSource ds = new EmbeddedXADataSource();
+// ds.setCreateDatabase("create");
+// ds.setDatabaseName("target/testdb");
+// ds.setUser("sa");
+// ds.setPassword("");
+// _dataSource = ds;
+// return _dataSource;
}
protected void negative(String deployDir) throws Throwable {
@@ -266,7 +308,7 @@ public abstract class BPELTestAbstract {
final String operation = testProps.getProperty("operation");
Boolean sequential = Boolean.parseBoolean(testProps.getProperty("sequential", "false"));
-
+
Invocation last = null;
for (int i = 1; testProps.getProperty("request" + i) != null; i++) {
final String in = testProps.getProperty("request" + i);
@@ -282,7 +324,7 @@ public abstract class BPELTestAbstract {
protected Invocation addInvoke(String id, QName target, String operation, String request, String responsePattern) throws Exception {
return addInvoke(id, target, operation, request, responsePattern, null);
}
-
+
protected Invocation addInvoke(String id, QName target, String operation, String request, String responsePattern, Invocation synchronizeWith)
throws Exception {
@@ -406,9 +448,9 @@ public abstract class BPELTestAbstract {
testThread.join();
}
-
+
protected long getWaitBeforeInvokeTimeout() {
- return WAIT_BEFORE_INVOKE_TIMEOUT;
+ return WAIT_BEFORE_INVOKE_TIMEOUT;
}
private void failure(Object where) {
@@ -447,7 +489,7 @@ public abstract class BPELTestAbstract {
}
/**
- * Override this to provide configuration properties for Ode extensions
+ * Override this to provide configuration properties for Ode extensions
* like BpelEventListeners.
*
* @return
@@ -527,10 +569,10 @@ public abstract class BPELTestAbstract {
/** for sync invocations */
public Invocation synchronizeWith;
-
+
/** checking completion */
public boolean done = false;
-
+
/** Name of the operation to invoke. */
public String operation;
@@ -593,7 +635,11 @@ public abstract class BPELTestAbstract {
public void run() {
try {
- run2();
+ try {
+ run2();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
} finally {
synchronized (_invocation) {
_invocation.done = true;
@@ -602,16 +648,16 @@ public abstract class BPELTestAbstract {
}
}
- public void run2() {
- final MyRoleMessageExchange mex;
- final Future<MessageExchange.Status> running;
+ public void run2() throws Exception {
+ final MyRoleMessageExchange[] mex = new MyRoleMessageExchange[1];
+ final Future[] running = new Future[1];
// Wait for it....
try {
Thread.sleep(_invocation.invokeDelayMs);
} catch (Exception ex) {
}
-
+
if (_invocation.synchronizeWith != null) {
synchronized (_invocation.synchronizeWith) {
while (!_invocation.synchronizeWith.done) {
@@ -625,40 +671,42 @@ public abstract class BPELTestAbstract {
}
}
- scheduler.beginTransaction();
- try {
- mex = _server.getEngine().createMessageExchange(new GUID().toString(), _invocation.target, _invocation.operation);
- mexContext.clearCurrentResponse();
+ scheduler.execTransaction(new Callable<Void>() {
+ public Void call() throws Exception {
+ try {
+ mex[0] = _server.getEngine().createMessageExchange(new GUID().toString(), _invocation.target, _invocation.operation);
+ mexContext.clearCurrentResponse();
+
+ Message request = mex[0].createMessage(_invocation.requestType);
+ request.setMessage(_invocation.request);
+ _invocation.invokeTime = System.currentTimeMillis();
+ running[0] = mex[0].invoke(request);
+
+ Status status = mex[0].getStatus();
+ CorrelationStatus cstatus = mex[0].getCorrelationStatus();
+ if (_invocation.expectedStatus != null && !status.equals(_invocation.expectedStatus))
+ failure(_invocation, "Unexpected message exchange status", _invocation.expectedStatus, status);
+
+ if (_invocation.expectedCorrelationStatus != null && !cstatus.equals(_invocation.expectedCorrelationStatus))
+ failure(_invocation, "Unexpected correlation status", _invocation.expectedCorrelationStatus, cstatus);
+ return null;
+
+ } catch (Exception ex) {
+ if (_invocation.expectedInvokeException == null)
+ failure(_invocation, "Unexpected invocation exception.", ex);
+ else if (_invocation.expectedInvokeException.isAssignableFrom(ex.getClass()))
+ failure(_invocation, "Unexpected invocation exception.", _invocation.expectedInvokeException, ex.getClass());
- Message request = mex.createMessage(_invocation.requestType);
- request.setMessage(_invocation.request);
- _invocation.invokeTime = System.currentTimeMillis();
- running = mex.invoke(request);
-
- Status status = mex.getStatus();
- CorrelationStatus cstatus = mex.getCorrelationStatus();
- if (_invocation.expectedStatus != null && !status.equals(_invocation.expectedStatus))
- failure(_invocation, "Unexpected message exchange status", _invocation.expectedStatus, status);
-
- if (_invocation.expectedCorrelationStatus != null && !cstatus.equals(_invocation.expectedCorrelationStatus))
- failure(_invocation, "Unexpected correlation status", _invocation.expectedCorrelationStatus, cstatus);
-
- } catch (Exception ex) {
- if (_invocation.expectedInvokeException == null)
- failure(_invocation, "Unexpected invocation exception.", ex);
- else if (_invocation.expectedInvokeException.isAssignableFrom(ex.getClass()))
- failure(_invocation, "Unexpected invocation exception.", _invocation.expectedInvokeException, ex.getClass());
-
- return;
- } finally {
- scheduler.commitTransaction();
- }
+ return null;
+ }
+ }
+ });
if (isFailed())
return;
try {
- running.get(_invocation.maximumWaitMs, TimeUnit.MILLISECONDS);
+ running[0].get(_invocation.maximumWaitMs, TimeUnit.MILLISECONDS);
} catch (Exception ex) {
failure(_invocation, "Exception on future object.", ex);
return;
@@ -676,32 +724,32 @@ public abstract class BPELTestAbstract {
return;
if (_invocation.expectedResponsePattern != null) {
- scheduler.beginTransaction();
- try {
- Status finalstat = mex.getStatus();
- if (_invocation.expectedFinalStatus != null && !_invocation.expectedFinalStatus.equals(finalstat))
- if (finalstat.equals(Status.FAULT)) {
- failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, "FAULT: "
- + mex.getFault() + " | " + mex.getFaultExplanation());
- } else {
- failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, finalstat);
+ scheduler.execTransaction(new Callable<Void>() {
+ public Void call() throws Exception {
+ Status finalstat = mex[0].getStatus();
+ if (_invocation.expectedFinalStatus != null && !_invocation.expectedFinalStatus.equals(finalstat))
+ if (finalstat.equals(Status.FAULT)) {
+ failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, "FAULT: "
+ + mex[0].getFault() + " | " + mex[0].getFaultExplanation());
+ } else {
+ failure(_invocation, "Unexpected final message exchange status", _invocation.expectedFinalStatus, finalstat);
+ }
+
+ if (_invocation.expectedFinalCorrelationStatus != null
+ && !_invocation.expectedFinalCorrelationStatus.equals(mex[0].getCorrelationStatus())) {
+ failure(_invocation, "Unexpected final correlation status", _invocation.expectedFinalCorrelationStatus, mex[0]
+ .getCorrelationStatus());
}
-
- if (_invocation.expectedFinalCorrelationStatus != null
- && !_invocation.expectedFinalCorrelationStatus.equals(mex.getCorrelationStatus())) {
- failure(_invocation, "Unexpected final correlation status", _invocation.expectedFinalCorrelationStatus, mex
- .getCorrelationStatus());
+ if (mex[0].getResponse() == null)
+ failure(_invocation, "Expected response, but got none.", null);
+ String responseStr = DOMUtils.domToString(mex[0].getResponse().getMessage());
+ //System.out.println("=>" + responseStr);
+ Matcher matcher = _invocation.expectedResponsePattern.matcher(responseStr);
+ if (!matcher.matches())
+ failure(_invocation, "Response does not match expected pattern", _invocation.expectedResponsePattern, responseStr);
+ return null;
}
- if (mex.getResponse() == null)
- failure(_invocation, "Expected response, but got none.", null);
- String responseStr = DOMUtils.domToString(mex.getResponse().getMessage());
- //System.out.println("=>" + responseStr);
- Matcher matcher = _invocation.expectedResponsePattern.matcher(responseStr);
- if (!matcher.matches())
- failure(_invocation, "Response does not match expected pattern", _invocation.expectedResponsePattern, responseStr);
- } finally {
- scheduler.commitTransaction();
- }
+ });
}
}
}
Modified: ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java (original)
+++ ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BasicActivities20Test.java Wed Aug 18 04:51:39 2010
@@ -26,7 +26,6 @@ import javax.xml.namespace.QName;
import org.apache.ode.bpel.iapi.ContextException;
import org.apache.ode.bpel.iapi.MessageExchange;
-import org.junit.Ignore;
import org.junit.Test;
public class BasicActivities20Test extends BPELTestAbstract {
@@ -92,7 +91,6 @@ public class BasicActivities20Test exten
/**
* Test the wait "until" syntax.
*/
- @Ignore("ODE-805,JPA refacotring leftover")
@Test public void testWaitUntilPast() throws Throwable {
deploy("/bpel/2.0/TestWaitUntil");
DateFormat idf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
Modified: ode/trunk/bpel-test/src/test/java/org/apache/ode/test/VersionedRedeployTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/VersionedRedeployTest.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/test/java/org/apache/ode/test/VersionedRedeployTest.java (original)
+++ ode/trunk/bpel-test/src/test/java/org/apache/ode/test/VersionedRedeployTest.java Wed Aug 18 04:51:39 2010
@@ -24,7 +24,6 @@ import javax.xml.namespace.QName;
import org.apache.ode.bpel.iapi.ProcessConf;
import org.apache.ode.bpel.iapi.ProcessState;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Test;
/**
@@ -36,7 +35,7 @@ public class VersionedRedeployTest exten
QName qName2 = new QName("http://ode/bpel/unit-test", "HelloWorld2-2");
QName qName3 = new QName("http://ode/bpel/unit-test", "HelloWorld2-3");
- @Test public void testRetireOld() throws Throwable {
+ @Test public void testRetireOld() throws Throwable {
deploy("/bpel/2.0/TestVersionedRedeploy/HelloWorld-1");
ProcessConf conf = store.getProcessConfiguration(qName1);
Assert.assertEquals(ProcessState.ACTIVE, conf.getState());
@@ -58,38 +57,32 @@ public class VersionedRedeployTest exten
Assert.assertEquals(ProcessState.RETIRED, conf.getState());
conf = store.getProcessConfiguration(qName3);
Assert.assertEquals(ProcessState.ACTIVE, conf.getState());
-
}
- @Ignore("ODE-805, JPA refacotring leftover")
- @Test public void testInstancePersistence() throws Throwable {
+ @Test public void testInstancePersistence() throws Throwable {
// Checking for each step that all instances still exist and that each process got one execution
// so no instance has been created after a process has been retired.
go("/bpel/2.0/TestVersionedRedeploy/HelloWorld-1");
- Assert.assertEquals(1, _bcf.getConnection().getProcess(qName1).getNumInstances());
+ Assert.assertEquals(1, _cf.getConnection().getProcess(qName1).getNumInstances());
// clean up deployment and invocations
_deployments.clear();
_invocations.clear();
go("/bpel/2.0/TestVersionedRedeploy/HelloWorld-2");
- Assert.assertEquals(1, _bcf.getConnection().getProcess(qName1).getNumInstances());
- Assert.assertEquals(1, _bcf.getConnection().getProcess(qName2).getNumInstances());
+ Assert.assertEquals(1, _cf.getConnection().getProcess(qName1).getNumInstances());
+ Assert.assertEquals(1, _cf.getConnection().getProcess(qName2).getNumInstances());
// clean up deployment and invocations
_deployments.clear();
_invocations.clear();
go("/bpel/2.0/TestVersionedRedeploy/HelloWorld-3");
- Assert.assertEquals(1, _bcf.getConnection().getProcess(qName1).getNumInstances());
- Assert.assertEquals(1, _bcf.getConnection().getProcess(qName2).getNumInstances());
- Assert.assertEquals(1, _bcf.getConnection().getProcess(qName3).getNumInstances());
-
- _deployments.clear();
- _invocations.clear();
+ Assert.assertEquals(1, _cf.getConnection().getProcess(qName1).getNumInstances());
+ Assert.assertEquals(1, _cf.getConnection().getProcess(qName2).getNumInstances());
+ Assert.assertEquals(1, _cf.getConnection().getProcess(qName3).getNumInstances());
}
-
- @Ignore("ODE-805,JPA refacotring leftover")
+
@Test public void testVersionedUndeployDeploy() throws Throwable {
go("/bpel/2.0/TestVersionedRedeploy/HelloWorld-1");
doUndeployments();
@@ -102,7 +95,7 @@ public class VersionedRedeployTest exten
Assert.assertNull(store.getProcessConfiguration(qName1));
Assert.assertNull(store.getProcessConfiguration(qName3));
- Assert.assertEquals(1, _bcf.getConnection().getProcess(qName2).getNumInstances());
+ Assert.assertEquals(1, _cf.getConnection().getProcess(qName2).getNumInstances());
}
}
Modified: ode/trunk/dao-hibernate-db/build.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate-db/build.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/dao-hibernate-db/build.xml (original)
+++ ode/trunk/dao-hibernate-db/build.xml Wed Aug 18 04:51:39 2010
@@ -21,7 +21,8 @@
<property name="db.scripts.dir" value="${basedir}/target" />
<property name="sql.dir" value="${basedir}/src/main/sql"/>
- <property name="dao-hibernate.classes" value="${basedir}/../dao-hibernate/target/classes" />
+ <property name="dao-hibernate.classes" value="${basedir}/../dao-hibernate/target/classes" />
+ <property name="bpel-store.classes" value="${basedir}/../bpel-store/target/classes" />
<path id="classpath">
<pathelement path="${maven.runtime.classpath}"/>
@@ -88,6 +89,9 @@
<include name="**/*.hbm.xml"/>
<exclude name="**/HMessageExchangeProperty.hbm.xml" />
</fileset>
+ <fileset dir="${bpel-store.classes}/">
+ <include name="**/*.hbm.xml"/>
+ </fileset>
</schemaexport>
<concat destfile="${db.scripts.dir}/@{db}.sql">
<fileset file="${sql.dir}/common.sql"/>
Modified: ode/trunk/dao-hibernate-db/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate-db/pom.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/dao-hibernate-db/pom.xml (original)
+++ ode/trunk/dao-hibernate-db/pom.xml Wed Aug 18 04:51:39 2010
@@ -33,7 +33,7 @@
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
+ <artifactId>hibernate</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Modified: ode/trunk/dao-hibernate/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/pom.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/dao-hibernate/pom.xml (original)
+++ ode/trunk/dao-hibernate/pom.xml Wed Aug 18 04:51:39 2010
@@ -43,6 +43,8 @@
<dependency>
<groupId>org.apache.ode</groupId>
<artifactId>ode-bpel-epr</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
@@ -55,20 +57,16 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
+ <artifactId>hibernate</artifactId>
</dependency>
<dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
@@ -97,7 +95,7 @@
<hibernatedoclet excludedTags="@version,@author,@todo" verbose="true"
destdir="${project.build.outputDirectory}" force="true">
<hibernate version="3.0"/>
- <fileset dir="${project.build.sourceDirectory}" includes="org/apache/ode/dao/hib/bpel/hobj/*.java,org/apache/ode/dao/hib/store/hobj/*.java"/>
+ <fileset dir="${project.build.sourceDirectory}" includes="org/apache/ode/daohib/bpel/hobj/*.java"/>
</hibernatedoclet>
</tasks>
</configuration>
@@ -117,11 +115,11 @@
<configuration>
<source>
import java.io.File
- def process_instance_hbm_file = new File(project.build.outputDirectory, 'org/apache/ode/dao/hib/bpel/hobj/HProcessInstance.hbm.xml')
+ def process_instance_hbm_file = new File(project.build.outputDirectory, 'org/apache/ode/daohib/bpel/hobj/HProcessInstance.hbm.xml')
def contents = process_instance_hbm_file.text
if (!contents.contains('not-found="ignore"')) {
- process_instance_hbm_file.text = contents.replace('class="org.apache.ode.dao.hib.bpel.hobj.HProcess"',
- 'not-found="ignore" class="org.apache.ode.dao.hib.bpel.hobj.HProcess"')
+ process_instance_hbm_file.text = contents.replace('class="org.apache.ode.daohib.bpel.hobj.HProcess"',
+ 'not-found="ignore" class="org.apache.ode.daohib.bpel.hobj.HProcess"')
}
</source>
</configuration>
Modified: ode/trunk/dao-jpa-ojpa-derby/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa-ojpa-derby/pom.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/dao-jpa-ojpa-derby/pom.xml (original)
+++ ode/trunk/dao-jpa-ojpa-derby/pom.xml Wed Aug 18 04:51:39 2010
@@ -111,8 +111,8 @@
<artifactId>geronimo-ejb_2.1_spec</artifactId>
</dependency>
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
@@ -205,7 +205,7 @@
<configuration>
<tasks>
<property name="ode.version" value="${project.version}"/>
- <ant antfile="build.xml" target="zip-derby-db" />
+ <ant antfile="build.xml" target="zip-derby-db" />
</tasks>
</configuration>
</execution>
Modified: ode/trunk/dao-jpa/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/pom.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/dao-jpa/pom.xml (original)
+++ ode/trunk/dao-jpa/pom.xml Wed Aug 18 04:51:39 2010
@@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.ode</groupId>
<artifactId>ode-dao-jpa</artifactId>
- <name>ODE :: JPA DAO Impl</name>
+ <name>ODE :: OpenJPA DAO Impl</name>
<parent>
<groupId>org.apache.ode</groupId>
@@ -98,43 +98,25 @@
</goals>
<configuration>
<tasks>
- <copy todir="${basedir}/target/classes-openjpa">
- <fileset dir="${basedir}/target/classes" includes="**/*"/>
- </copy>
- <property name="maven.compile.classpath" refid="maven.compile.classpath"/>
+ <property name="maven.runtime.classpath" refid="maven.compile.classpath"/>
<path id="classpath">
- <pathelement location="${basedir}/target/classes-openjpa"/>
- <pathelement path="${maven.compile.classpath}"/>
- </path>
- <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="classpath"/>
- <openjpac directory="${basedir}/target/classes-openjpa">
- <fileset dir="${basedir}/src/main">
- <include name="**/*.java" />
- </fileset>
- <classpath refid="classpath"/>
- </openjpac>
+ <pathelement path="${maven.runtime.classpath}"/>
+ </path>
+ <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="classpath"/>
+ <openjpac>
+ <fileset dir="${basedir}/src/main">
+ <include name="**/*.java" />
+ </fileset>
+ <classpath>
+ <pathelement location="${basedir}/target/classes"/>
+ <pathelement path="${maven.runtime.classpath}"/>
+ </classpath>
+ </openjpac>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>openjpa-enhancer-package</id>
- <phase>package</phase>
- <configuration>
- <classifier>openjpa</classifier>
- <classesDirectory>${project.build.directory}/classes-openjpa</classesDirectory>
- </configuration>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
Modified: ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml (original)
+++ ode/trunk/dao-jpa/src/main/resources/META-INF/persistence.xml Wed Aug 18 04:51:39 2010
@@ -20,29 +20,27 @@
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
- <persistence-unit name="ode-bpel" transaction-type="JTA">
- <class>org.apache.ode.dao.jpa.bpel.ActivityRecoveryDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.CorrelationSetDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.CorrelatorDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.EventDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.FaultDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.MessageDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.MessageExchangeDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.MessageRouteDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.PartnerLinkDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.ProcessDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.ProcessInstanceDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.ScopeDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.XmlDataDAOImpl</class>
- <class>org.apache.ode.dao.jpa.bpel.CorrSetProperty</class>
- <class>org.apache.ode.dao.jpa.bpel.MexProperty</class>
- <class>org.apache.ode.dao.jpa.bpel.XmlDataProperty</class>
+ <persistence-unit name="ode-dao">
+ <!--
+ This properties file is used specifically by the
+ OpenJPA Enhancer.
+ -->
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+ <class>org.apache.ode.dao.jpa.ActivityRecoveryDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.CorrelationSetDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.CorrelatorDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.EventDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.FaultDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.MessageDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.MessageExchangeDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.MessageRouteDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.CorrSetProperty</class>
+ <class>org.apache.ode.dao.jpa.MexProperty</class>
+ <class>org.apache.ode.dao.jpa.XmlDataProperty</class>
</persistence-unit>
- <persistence-unit name="ode-store" transaction-type="JTA">
- <class>org.apache.ode.dao.jpa.store.ProcessConfDaoImpl</class>
- <class>org.apache.ode.dao.jpa.store.ProcessConfPropertyDaoImpl</class>
- <class>org.apache.ode.dao.jpa.store.DeploymentUnitDaoImpl</class>
- <class>org.apache.ode.dao.jpa.store.VersionTrackerDAOImpl</class>
- </persistence-unit>
-
</persistence>
\ No newline at end of file
Modified: ode/trunk/jbi/pom.xml
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/pom.xml?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/jbi/pom.xml (original)
+++ ode/trunk/jbi/pom.xml Wed Aug 18 04:51:39 2010
@@ -129,8 +129,8 @@
<artifactId>hibernate-core</artifactId>
</exclusion>
<exclusion>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.geronimo.specs</groupId>
@@ -230,7 +230,7 @@
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
+ <artifactId>hibernate</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
@@ -379,11 +379,6 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ejb_2.1_spec</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
<!-- This is a way to specify the global exclusion in the dependency tree -->
<dependency>
Modified: ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java (original)
+++ ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java Wed Aug 18 04:51:39 2010
@@ -40,6 +40,7 @@ import javax.xml.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.agents.memory.SizingAgent;
+import org.apache.ode.bpel.dao.BpelDAOConnectionFactory;
import org.apache.ode.bpel.engine.BpelServerImpl;
import org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl;
import org.apache.ode.bpel.iapi.Endpoint;
@@ -50,8 +51,6 @@ import org.apache.ode.bpel.o.OProcess;
import org.apache.ode.bpel.o.Serializer;
import org.apache.ode.bpel.pmapi.InstanceManagement;
import org.apache.ode.bpel.pmapi.ProcessManagement;
-import org.apache.ode.dao.bpel.BpelDAOConnectionFactory;
-import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
import org.apache.ode.jbi.msgmap.Mapper;
import org.apache.ode.jbi.util.WSDLFlattener;
import org.apache.ode.scheduler.simple.SimpleScheduler;
@@ -100,8 +99,6 @@ final public class OdeContext {
ExecutorService _executorService;
BpelDAOConnectionFactory _daocf;
-
- ConfStoreDAOConnectionFactory _cdaocf;
OdeConfigProperties _config;
Modified: ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java (original)
+++ ode/trunk/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java Wed Aug 18 04:51:39 2010
@@ -34,13 +34,13 @@ import javax.transaction.TransactionMana
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.connector.BpelServerConnector;
+import org.apache.ode.bpel.dao.BpelDAOConnectionFactoryJDBC;
import org.apache.ode.bpel.engine.BpelServerImpl;
import org.apache.ode.bpel.engine.ProcessAndInstanceManagementMBean;
import org.apache.ode.bpel.extvar.jdbc.JdbcExternalVariableModule;
+
import org.apache.ode.bpel.iapi.BpelEventListener;
import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
-import org.apache.ode.dao.bpel.BpelDAOConnectionFactory;
-import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
import org.apache.ode.il.dbutil.Database;
import org.apache.ode.il.dbutil.DatabaseConfigException;
import org.apache.ode.jbi.msgmap.Mapper;
@@ -234,7 +234,7 @@ public class OdeLifeCycle implements Com
_ode._scheduler.setExecutorService(_ode._executorService);
_ode._scheduler.setTransactionManager((TransactionManager) _ode.getContext().getTransactionManager());
- _ode._store = new ProcessStoreImpl(_ode._eprContext , _ode.getTransactionManager(), _ode._cdaocf);
+ _ode._store = new ProcessStoreImpl(_ode._eprContext , _ode._dataSource, _ode._config.getDAOConnectionFactory(), _ode._config, false);
registerExternalVariableModules();
_ode._store.loadAll();
@@ -264,17 +264,14 @@ public class OdeLifeCycle implements Com
* @throws JBIException
*/
private void initDao() throws JBIException {
- BpelDAOConnectionFactory bcf;
- ConfStoreDAOConnectionFactory ccf;
+ BpelDAOConnectionFactoryJDBC cf;
try {
- bcf = _db.createDaoCF();
- ccf = _db.createDaoStoreCF();
+ cf = _db.createDaoCF();
} catch (DatabaseConfigException e) {
String errmsg = __msgs.msgDAOInstantiationFailed(_ode._config.getDAOConnectionFactory());
throw new JBIException(errmsg,e);
}
- _ode._daocf = bcf;
- _ode._cdaocf = ccf;
+ _ode._daocf = cf;
}
private void initConnector() throws JBIException {
Modified: ode/trunk/jbi/src/test/jbi/ode-jbi.properties
URL: http://svn.apache.org/viewvc/ode/trunk/jbi/src/test/jbi/ode-jbi.properties?rev=986564&r1=986563&r2=986564&view=diff
==============================================================================
--- ode/trunk/jbi/src/test/jbi/ode-jbi.properties (original)
+++ ode/trunk/jbi/src/test/jbi/ode-jbi.properties Wed Aug 18 04:51:39 2010
@@ -62,8 +62,7 @@ ode-jbi.db.ext.dataSource=java:comp/env/
# DAO Connection Factory class.
# uncomment the following for hibernate.
-ode-jbi.dao.factory=org.apache.ode.dao.hib.bpel.BpelDAOConnectionFactoryImpl
-ode-jbi.dao.factory.store=org.apache.ode.dao.hib.store.ConfStoreDAOConnectionFactoryImpl
+ode-jbi.dao.factory=org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl
# Class name of the message mapper that should be used to convert message
# between ODE / NMS.