Repository: ode Updated Branches: refs/heads/ode-1.3.x cee7bd194 -> 28085edc2
http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java ---------------------------------------------------------------------- diff --git a/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java b/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java index 15a99f3..be0a922 100644 --- a/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java +++ b/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java @@ -1,3 +1,4 @@ + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -23,11 +24,15 @@ 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.List; import java.util.Properties; +import java.util.concurrent.Callable; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; @@ -35,23 +40,29 @@ import java.util.regex.Pattern; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; -import javax.persistence.Persistence; +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.common.evt.DebugBpelEventListener; import org.apache.ode.bpel.dao.BpelDAOConnectionFactory; import org.apache.ode.bpel.engine.BpelServerImpl; import org.apache.ode.bpel.iapi.Message; import org.apache.ode.bpel.iapi.MessageExchange; +import org.apache.ode.bpel.iapi.MessageExchange.Status; import org.apache.ode.bpel.iapi.MyRoleMessageExchange; +import org.apache.ode.bpel.iapi.MyRoleMessageExchange.CorrelationStatus; 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.MessageExchange.Status; -import org.apache.ode.bpel.iapi.MyRoleMessageExchange.CorrelationStatus; import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl; -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.scheduler.simple.JdbcDelegate; +import org.apache.ode.scheduler.simple.SimpleScheduler; import org.apache.ode.store.ProcessConfImpl; import org.apache.ode.store.ProcessStoreImpl; import org.apache.ode.utils.DOMUtils; @@ -62,12 +73,17 @@ import org.junit.Before; import org.w3c.dom.Element; public abstract class BPELTestAbstract { - public static final long WAIT_BEFORE_INVOKE_TIMEOUT = 2000; - - private static final String SHOW_EVENTS_ON_CONSOLE = "no"; + private static final Log log = LogFactory.getLog(BPELTestAbstract.class); + 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 Database _database; + protected ProcessStore store; protected MessageExchangeContextImpl mexContext; @@ -76,7 +92,9 @@ public abstract class BPELTestAbstract { protected EntityManagerFactory emf; - protected MockScheduler scheduler; + protected ExecutorService executorService = Executors.newFixedThreadPool(1); + + protected SimpleScheduler scheduler; protected BpelDAOConnectionFactory _cf; @@ -94,40 +112,36 @@ public abstract class BPELTestAbstract { @Before public void setUp() throws Exception { + if (_txManager == null) { + _txManager = createTransactionManager(); + org.springframework.mock.jndi.SimpleNamingContextBuilder.emptyActivatedContextBuilder().bind("java:comp/UserTransaction", _txManager); + _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(); + } + } + _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>(); - if (Boolean.getBoolean("org.apache.ode.test.persistent")) { - emf = Persistence.createEntityManagerFactory("ode-unit-test-embedded"); - em = emf.createEntityManager(); - _cf = new org.apache.ode.daohib.bpel.BpelDAOConnectionFactoryImpl(); - _server.setDaoConnectionFactory(_cf); - 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(); + { + JdbcDelegate del = new JdbcDelegate(_dataSource); + scheduler = new SimpleScheduler("node", del, props); + scheduler.setTransactionManager(_txManager); _cf = new BpelDAOConnectionFactoryImpl(scheduler); _server.setDaoConnectionFactory(_cf); } @@ -136,7 +150,8 @@ public abstract class BPELTestAbstract { _server.setBindingContext(new BindingContextImpl()); _server.setMessageExchangeContext(mexContext); scheduler.setJobProcessor(_server); - store = new ProcessStoreImpl(null, null, "hibernate", new OdeConfigProperties(new Properties(), ""), true); + 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 @@ -149,10 +164,10 @@ public abstract class BPELTestAbstract { } } }); - _server.setConfigProperties(getConfigProperties()); _server.registerBpelEventListener(new DebugBpelEventListener()); _server.init(); _server.start(); + scheduler.start(); } @After @@ -174,7 +189,24 @@ 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 { + Properties props = new Properties(); + props.setProperty(OdeConfigProperties.PROP_DAOCF, System.getProperty(OdeConfigProperties.PROP_DAOCF, OdeConfigProperties.DEFAULT_DAOCF_CLASS)); + OdeConfigProperties odeProps = new OdeConfigProperties(props,""); + _database = Database.create(odeProps); + _database.setTransactionManager(_txManager); + _database.start(); + _dataSource = _database.getDataSource(); + return _dataSource; } protected void negative(String deployDir) throws Throwable { @@ -234,7 +266,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); @@ -250,7 +282,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 { @@ -315,10 +347,10 @@ public abstract class BPELTestAbstract { _deployed.add(d); } catch (Exception ex) { if (d.expectedException == null) { - ex.printStackTrace(); + log.error("", ex); failure(d, "DEPLOY: Unexpected exception: " + ex, ex); } else if (!d.expectedException.isAssignableFrom(ex.getClass())) { - ex.printStackTrace(); + log.error("", ex); failure(d, "DEPLOY: Wrong exception; expected " + d.expectedException + " but got " + ex.getClass(), ex); } return; @@ -374,9 +406,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) { @@ -415,7 +447,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 @@ -455,6 +487,7 @@ public abstract class BPELTestAbstract { StringBuffer sbuf = new StringBuffer(where + ": " + msg); if (ex != null) { sbuf.append("; got exception msg: " + ex.getMessage()); + ex.printStackTrace(); } if (actual != null) sbuf.append("; got " + actual + ", expected " + expected); @@ -495,10 +528,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; @@ -561,7 +594,11 @@ public abstract class BPELTestAbstract { public void run() { try { - run2(); + try { + run2(); + } catch (Exception e) { + e.printStackTrace(); + } } finally { synchronized (_invocation) { _invocation.done = true; @@ -569,17 +606,17 @@ 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) { @@ -593,40 +630,42 @@ public abstract class BPELTestAbstract { } } - scheduler.beginTransaction(); - try { - mex = _server.getEngine().createMessageExchange(new GUID().toString(), _invocation.target, _invocation.operation); - mexContext.clearCurrentResponse(); - - 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(); - } + 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()); + + 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; @@ -644,33 +683,33 @@ 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(); - } + }); } } } -} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/bpel-test/src/main/resources/scheduler-schema.sql ---------------------------------------------------------------------- diff --git a/bpel-test/src/main/resources/scheduler-schema.sql b/bpel-test/src/main/resources/scheduler-schema.sql new file mode 100644 index 0000000..c52f91c --- /dev/null +++ b/bpel-test/src/main/resources/scheduler-schema.sql @@ -0,0 +1,19 @@ +CREATE TABLE ode_job ( + jobid CHAR(64) NOT NULL DEFAULT '', + ts BIGINT NOT NULL DEFAULT 0, + nodeid char(64), + scheduled int NOT NULL DEFAULT 0, + transacted int NOT NULL DEFAULT 0, + + instanceId BIGINT, + mexId varchar(255), + processId varchar(255), + type varchar(255), + channel varchar(255), + correlatorId varchar(255), + correlationKeySet varchar(255), + retryCount int, + inMem int, + detailsExt blob(4096), + + PRIMARY KEY(jobid)) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java ---------------------------------------------------------------------- diff --git a/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java b/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java index e169ef8..8c1e26a 100644 --- a/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java +++ b/bpel-test/src/test/java/org/apache/ode/test/ExternalVariableTest.java @@ -26,8 +26,8 @@ import java.sql.Statement; import javax.sql.DataSource; import javax.xml.namespace.QName; -import org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource; import org.apache.ode.bpel.extvar.jdbc.JdbcExternalVariableModule; +import org.h2.jdbcx.JdbcDataSource; import org.junit.Test; /** @@ -42,10 +42,11 @@ public class ExternalVariableTest extends BPELTestAbstract { public void setUp() throws Exception { super.setUp(); - EmbeddedConnectionPoolDataSource ds = new EmbeddedConnectionPoolDataSource(); - ds.setCreateDatabase("create"); - ds.setDatabaseName("target/ExternalVariableTest"); - _ds = ds; + + JdbcDataSource hds = new JdbcDataSource(); + hds.setURL("jdbc:h2:mem:odeextvar;DB_CLOSE_DELAY=-1"); + hds.setUser("sa"); + _ds = hds; _jdbcext = new JdbcExternalVariableModule(); _jdbcext.registerDataSource("testds", _ds); http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/dao-hibernate-db/build.xml ---------------------------------------------------------------------- diff --git a/dao-hibernate-db/build.xml b/dao-hibernate-db/build.xml index 10ae1a6..21e7aa4 100644 --- a/dao-hibernate-db/build.xml +++ b/dao-hibernate-db/build.xml @@ -19,19 +19,19 @@ <project> - <property name="db.scripts.dir" value="${basedir}/target" /> - <property name="sql.dir" value="${basedir}/src/main/sql"/> + <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="bpel-store.classes" value="${basedir}/../bpel-store/target/classes" /> + <property name="bpel-store.classes" value="${basedir}/../bpel-store/target/classes" /> + + <path id="classpath"> + <pathelement path="${maven.runtime.classpath}"/> + </path> - <path id="classpath"> - <pathelement path="${maven.runtime.classpath}"/> - </path> - <target name="create-schema"> - - <taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" - classpathref="classpath"/> + + <taskdef name="schemaexport" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" + classpathref="classpath"/> <mkdir dir="target"/> <mkdir dir="${db.scripts.dir}" /> @@ -47,9 +47,10 @@ <!-- PostgreSQL --> <create-ddl db="postgres"/> - + <!-- Sybase --> <create-ddl db="hsql" /> + <create-ddl db="h2" /> <!-- MSSQL --> <create-ddl db="sqlserver" /> @@ -77,21 +78,21 @@ <echo></echo> <echo>=====================</echo> <echo>Create DDL @{db}</echo> - <schemaexport - properties="${sql.dir}/ode.@{db}.properties" - quiet="yes" - text="yes" - create="yes" - delimiter=";" - output="${db.scripts.dir}/partial.@{db}.sql"> - <fileset dir="${dao-hibernate.classes}/"> - <include name="**/*.hbm.xml"/> + <schemaexport + properties="${sql.dir}/ode.@{db}.properties" + quiet="yes" + text="yes" + create="yes" + delimiter=";" + output="${db.scripts.dir}/partial.@{db}.sql"> + <fileset dir="${dao-hibernate.classes}/"> + <include name="**/*.hbm.xml"/> <exclude name="**/HMessageExchangeProperty.hbm.xml" /> - </fileset> - <fileset dir="${bpel-store.classes}/"> - <include name="**/*.hbm.xml"/> - </fileset> - </schemaexport> + </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"/> <fileset file="${sql.dir}/simplesched-@{db}.sql"/> @@ -102,5 +103,4 @@ </sequential> </macrodef> -</project> - +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionFactoryImpl.java ---------------------------------------------------------------------- diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionFactoryImpl.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionFactoryImpl.java index 099b849..83e8912 100644 --- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionFactoryImpl.java +++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/BpelDAOConnectionFactoryImpl.java @@ -18,10 +18,7 @@ */ package org.apache.ode.daohib.bpel; -import java.sql.Connection; -import java.sql.DatabaseMetaData; import java.util.Enumeration; -import java.util.HashMap; import java.util.Properties; import javax.sql.DataSource; @@ -36,8 +33,7 @@ import org.apache.ode.daohib.HibernateTransactionManagerLookup; import org.apache.ode.daohib.SessionManager; import org.hibernate.HibernateException; import org.hibernate.cfg.Environment; -import org.hibernate.dialect.Dialect; -import org.hibernate.dialect.DialectFactory; + /** * Hibernate-based {@link org.apache.ode.bpel.dao.BpelDAOConnectionFactory} @@ -104,20 +100,6 @@ public class BpelDAOConnectionFactoryImpl implements BpelDAOConnectionFactoryJDB properties.put(Environment.TRANSACTION_STRATEGY, "org.hibernate.transaction.JTATransactionFactory"); properties.put(Environment.CURRENT_SESSION_CONTEXT_CLASS, "jta"); - // Guess Hibernate dialect if not specified in hibernate.properties - if (properties.get(Environment.DIALECT) == null) { - try { - properties.put(Environment.DIALECT, guessDialect(_ds)); - } catch (Exception ex) { - String errmsg = "Unable to detect Hibernate dialect!"; - - if (__log.isDebugEnabled()) - __log.debug(errmsg, ex); - - __log.error(errmsg); - } - } - // Isolation levels override; when you use a ConnectionProvider, this has no effect String level = System.getProperty("ode.connection.isolation", "2"); properties.put(Environment.ISOLATION, level); @@ -137,73 +119,8 @@ public class BpelDAOConnectionFactoryImpl implements BpelDAOConnectionFactoryJDB return new SessionManager(properties, ds, tm); } - private static final String DEFAULT_HIBERNATE_DIALECT = "org.hibernate.dialect.DerbyDialect"; - - private static final HashMap<String, DialectFactory.VersionInsensitiveMapper> HIBERNATE_DIALECTS = new HashMap<String, DialectFactory.VersionInsensitiveMapper>(); - - static { - // Hibernate has a nice table that resolves the dialect from the - // database - // product name, - // but doesn't include all the drivers. So this is supplementary, and - // some - // day in the - // future they'll add more drivers and we can get rid of this. - // Drivers already recognized by Hibernate: - // HSQL Database Engine - // DB2/NT - // MySQL - // PostgreSQL - // Microsoft SQL Server Database, Microsoft SQL Server - // Sybase SQL Server - // Informix Dynamic Server - // Oracle 8 and Oracle >8 - HIBERNATE_DIALECTS.put("Apache Derby", new DialectFactory.VersionInsensitiveMapper( - "org.hibernate.dialect.DerbyDialect")); - HIBERNATE_DIALECTS.put("INGRES", new DialectFactory.VersionInsensitiveMapper( - "org.hibernate.dialect.IngresDialect")); - HIBERNATE_DIALECTS.put("H2", new DialectFactory.VersionInsensitiveMapper( - "org.hibernate.dialect.H2Dialect")); - } - public void shutdown() { _sessionManager.shutdown(); - _ds = null; - _sessionManager = null; - } - - private String guessDialect(DataSource dataSource) throws Exception { - String dialect = null; - // Open a connection and use that connection to figure out database - // product name/version number in order to decide which Hibernate - // dialect to use. - Connection conn = dataSource.getConnection(); - try { - DatabaseMetaData metaData = conn.getMetaData(); - if (metaData != null) { - String dbProductName = metaData.getDatabaseProductName(); - int dbMajorVer = metaData.getDatabaseMajorVersion(); - __log.info("Using database " + dbProductName + " major version " + dbMajorVer); - DialectFactory.DatabaseDialectMapper mapper = HIBERNATE_DIALECTS.get(dbProductName); - if (mapper != null) { - dialect = mapper.getDialectClass(dbMajorVer); - } else { - Dialect hbDialect = DialectFactory.determineDialect(dbProductName, dbMajorVer); - if (hbDialect != null) - dialect = hbDialect.getClass().getName(); - } - } - } finally { - conn.close(); - } - - if (dialect == null) { - __log.info("Cannot determine hibernate dialect for this database: using the default one."); - dialect = DEFAULT_HIBERNATE_DIALECT; - } - - return dialect; - } public void setDataSource(DataSource ds) { @@ -222,4 +139,4 @@ public class BpelDAOConnectionFactoryImpl implements BpelDAOConnectionFactoryJDB // Hibernate doesn't use this. } -} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/BaseTestDAO.java ---------------------------------------------------------------------- diff --git a/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/BaseTestDAO.java b/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/BaseTestDAO.java index 34bc820..e17f4c1 100644 --- a/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/BaseTestDAO.java +++ b/dao-hibernate/src/test/java/org/apache/ode/daohib/bpel/BaseTestDAO.java @@ -19,37 +19,41 @@ package org.apache.ode.daohib.bpel; -import javax.resource.spi.ConnectionManager; +import java.util.Properties; + import javax.sql.DataSource; import javax.transaction.TransactionManager; import junit.framework.TestCase; +import org.apache.commons.dbcp.BasicDataSource; import org.apache.derby.jdbc.EmbeddedXADataSource; import org.apache.ode.bpel.dao.BpelDAOConnection; import org.apache.ode.il.EmbeddedGeronimoFactory; import org.hibernate.cfg.Environment; -import java.util.Properties; - /** - * Testing BpelDAOConnectionImpl.listInstance. We're just producing a lot - * of different filter combinations and test if they execute ok. To really - * test that the result is the one expected would take a huge test database - * (with at least a process and an instance for every possible combination). + * Testing BpelDAOConnectionImpl.listInstance. We're just producing a lot of + * different filter combinations and test if they execute ok. To really test + * that the result is the one expected would take a huge test database (with at + * least a process and an instance for every possible combination). */ public abstract class BaseTestDAO extends TestCase { protected BpelDAOConnection daoConn; protected TransactionManager txm; - protected ConnectionManager connectionManager; private DataSource ds; + /* + * Make this true and change the getDataSource + * method to point to correct driver , database and userid \ password + */ + private static boolean externalDB = false; protected void initTM() throws Exception { EmbeddedGeronimoFactory factory = new EmbeddedGeronimoFactory(); - connectionManager = new org.apache.geronimo.connector.outbound.GenericConnectionManager(); txm = factory.getTransactionManager(); ds = getDataSource(); + org.springframework.mock.jndi.SimpleNamingContextBuilder.emptyActivatedContextBuilder().bind("java:comp/UserTransaction", txm); txm.begin(); BpelDAOConnectionFactoryImpl factoryImpl = new BpelDAOConnectionFactoryImpl(); @@ -67,6 +71,19 @@ public abstract class BaseTestDAO extends TestCase { } protected DataSource getDataSource() { + if (externalDB) { + BasicDataSource ds = new BasicDataSource(); + try { + ds.setDriverClassName("com.mysql.jdbc.Driver"); + ds.setUsername("sa"); + ds.setPassword("sa"); + ds.setUrl("jdbc:mysql://localhost/bpmsdbJunit"); + this.ds = ds; + } catch (Exception ex) { + ex.printStackTrace(); + System.out.println("######### Couldn't get External connection! #############"); + } + } if (ds == null) { EmbeddedXADataSource ds = new EmbeddedXADataSource(); ds.setCreateDatabase("create"); http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/dependencies.rb ---------------------------------------------------------------------- diff --git a/dependencies.rb b/dependencies.rb index abf3410..d47e4bc 100644 --- a/dependencies.rb +++ b/dependencies.rb @@ -75,8 +75,8 @@ GERONIMO = struct( :transaction =>"org.apache.geronimo.components:geronimo-transaction:jar:2.0.1", :connector =>"org.apache.geronimo.components:geronimo-connector:jar:2.0.1" ) -HIBERNATE = [ "org.hibernate:hibernate:jar:3.2.5.ga", "asm:asm:jar:1.5.3", - "antlr:antlr:jar:2.7.6", "cglib:cglib:jar:2.1_3", "net.sf.ehcache:ehcache:jar:1.2.3" ] +HIBERNATE = [ "org.hibernate:hibernate-core:jar:3.3.2.GA", "javassist:javassist:jar:3.9.0.GA", "antlr:antlr:jar:2.7.6", + "asm:asm:jar:3.3.1", "cglib:cglib:jar:2.2", "net.sf.ehcache:ehcache:jar:1.2.3" ] HSQLDB = "org.hsqldb:hsqldb:jar:2.3.3" JAVAX = struct( :activation =>"javax.activation:activation:jar:1.1", @@ -137,6 +137,7 @@ SERVICEMIX = [ SLF4J = group(%w{ slf4j-api slf4j-log4j12 jcl104-over-slf4j }, :under=>"org.slf4j", :version=>"1.4.3") SPRING = ["org.springframework:spring:jar:2.5.6"] SPRING_OSGI = ["org.springframework.osgi:spring-osgi-core:jar:1.2.0"] +SPRING_TEST = ["org.springframework:spring-test:jar:2.5.6"] TRANQL = [ "tranql:tranql-connector:jar:1.1", COMMONS.primitives ] WOODSTOX = "woodstox:wstx-asl:jar:3.2.4" WSDL4J = "wsdl4j:wsdl4j:jar:1.6.3" http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java ---------------------------------------------------------------------- diff --git a/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java b/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java index 2ad3f62..e5c02ca 100644 --- a/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java +++ b/jbi/src/main/java/org/apache/ode/jbi/OdeLifeCycle.java @@ -194,7 +194,7 @@ public class OdeLifeCycle implements ComponentLifeCycle { break; } - _db = new Database(_ode._config); + _db = Database.create(_ode._config); _db.setTransactionManager(_ode.getTransactionManager()); _db.setWorkRoot(new File(_ode.getContext().getInstallRoot())); http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/java/org/apache/ode/jbi/JbiTestBase.java ---------------------------------------------------------------------- diff --git a/jbi/src/test/java/org/apache/ode/jbi/JbiTestBase.java b/jbi/src/test/java/org/apache/ode/jbi/JbiTestBase.java index eb714b3..251eb18 100644 --- a/jbi/src/test/java/org/apache/ode/jbi/JbiTestBase.java +++ b/jbi/src/test/java/org/apache/ode/jbi/JbiTestBase.java @@ -57,10 +57,10 @@ public class JbiTestBase extends SpringTestSupport { protected OdeComponent odeComponent; protected JBIContainer jbiContainer; - + protected Properties testProperties; protected DefaultServiceMixClient smxClient; - + @Override protected AbstractXmlApplicationContext createBeanFactory() { return new ClassPathXmlApplicationContext(new String[] { @@ -68,7 +68,7 @@ public class JbiTestBase extends SpringTestSupport { "/" + getTestName() + "/smx.xml" }); } - + private void initOdeDb() throws Exception { TransactionManager tm = (TransactionManager) getBean("transactionManager"); tm.begin(); @@ -78,13 +78,13 @@ public class JbiTestBase extends SpringTestSupport { s.close(); tm.commit(); } - + @Override protected void setUp() throws Exception { super.setUp(); initOdeDb(); - + jbiContainer = ((JBIContainer) getBean("jbi")); odeComponent = new OdeComponent(); @@ -93,17 +93,17 @@ public class JbiTestBase extends SpringTestSupport { activationSpec.setComponent(odeComponent); activationSpec.setComponentName("ODE"); jbiContainer.activateComponent(new File("target/test/smx/ode").getAbsoluteFile(), odeComponent, "", cc, activationSpec, true, false, false, null); - + testProperties = new Properties(); testProperties.load(getClass().getResourceAsStream("/" + getTestName() + "/test.properties")); - + smxClient = new DefaultServiceMixClient(jbiContainer); } - + protected String getTestName() { return getClass().getSimpleName(); } - + protected void enableProcess(String resource, boolean enable) throws Exception { resource = "target/test/resources/" + resource; String process = resource.substring(resource.lastIndexOf('/') + 1); @@ -127,7 +127,7 @@ public class JbiTestBase extends SpringTestSupport { protected void go() throws Exception { boolean manualDeploy = Boolean.parseBoolean("" + testProperties.getProperty("manualDeploy")); - if (!manualDeploy) + if (!manualDeploy) enableProcess(getTestName(), true); try { @@ -136,7 +136,7 @@ public class JbiTestBase extends SpringTestSupport { do { String prefix = i == 0 ? "" : "" + i; loop = i == 0; - + { String deploy = testProperties.getProperty(prefix + "deploy"); if (deploy != null) { @@ -151,7 +151,7 @@ public class JbiTestBase extends SpringTestSupport { enableProcess(getTestName() + "/" + undeploy, false); } } - + String request = testProperties.getProperty(prefix + "request"); if (request != null && request.startsWith("@")) { request = inputStreamToString(getClass().getResourceAsStream("/" + getTestName() + "/" + request.substring(1))); @@ -167,34 +167,34 @@ public class JbiTestBase extends SpringTestSupport { } } { - String httpUrl = testProperties.getProperty(prefix + "http.url"); - if (httpUrl != null && request != null) { + String httpUrl = testProperties.getProperty(prefix + "http.url"); + if (httpUrl != null && request != null) { loop = true; - log.debug(getTestName() + " sending http request to " + httpUrl + " request: " + request); - URLConnection connection = new URL(httpUrl).openConnection(); - connection.setDoOutput(true); - connection.setDoInput(true); - //Send request - OutputStream os = connection.getOutputStream(); - PrintWriter wt = new PrintWriter(os); - wt.print(request); - wt.flush(); - wt.close(); - // Read the response. - String result = inputStreamToString(connection.getInputStream()); - - log.debug(getTestName() + " have result: " + result); - matchResponse(expectedResponse, result, true); - } + log.debug(getTestName() + " sending http request to " + httpUrl + " request: " + request); + URLConnection connection = new URL(httpUrl).openConnection(); + connection.setDoOutput(true); + connection.setDoInput(true); + //Send request + OutputStream os = connection.getOutputStream(); + PrintWriter wt = new PrintWriter(os); + wt.print(request); + wt.flush(); + wt.close(); + // Read the response. + String result = inputStreamToString(connection.getInputStream()); + + log.debug(getTestName() + " have result: " + result); + matchResponse(expectedResponse, result, true); + } } { - if (testProperties.getProperty(prefix + "nmr.service") != null && request != null) { + if (testProperties.getProperty(prefix + "nmr.service") != null && request != null) { loop = true; - InOut io = smxClient.createInOutExchange(); - io.setService(QName.valueOf(testProperties.getProperty(prefix + "nmr.service"))); - io.setOperation(QName.valueOf(testProperties.getProperty(prefix + "nmr.operation"))); - io.getInMessage().setContent(new StreamSource(new ByteArrayInputStream(request.getBytes()))); - smxClient.sendSync(io,20000); + InOut io = smxClient.createInOutExchange(); + io.setService(QName.valueOf(testProperties.getProperty(prefix + "nmr.service"))); + io.setOperation(QName.valueOf(testProperties.getProperty(prefix + "nmr.operation"))); + io.getInMessage().setContent(new StreamSource(new ByteArrayInputStream(request.getBytes()))); + smxClient.sendSync(io,20000); if (io.getStatus() == ExchangeStatus.ACTIVE) { assertNotNull(io.getOutMessage()); String result = new SourceTransformer().contentToString(io.getOutMessage()); @@ -203,9 +203,9 @@ public class JbiTestBase extends SpringTestSupport { } else { matchResponse(expectedResponse, "", false); } - } } - + } + i++; } while (loop); @@ -214,7 +214,7 @@ public class JbiTestBase extends SpringTestSupport { enableProcess(getTestName(), false); } } - + protected void matchResponse(String expectedResponse, String result, boolean succeeded) { if (succeeded) { assertTrue("Response doesn't match expected regex.\nExpected: " + expectedResponse + "\nReceived: " + result, Pattern.compile(expectedResponse, Pattern.DOTALL).matcher(result).matches()); @@ -222,10 +222,10 @@ public class JbiTestBase extends SpringTestSupport { assertTrue("Expected success, but got fault", expectedResponse.equals("FAULT")); } } - + private String inputStreamToString(InputStream is) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileUtil.copyInputStream(is, baos); return baos.toString(); } -} +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/CommunicationJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/CommunicationJbiTest/smx.xml b/jbi/src/test/resources/CommunicationJbiTest/smx.xml index 7f6f401..939ea5b 100644 --- a/jbi/src/test/resources/CommunicationJbiTest/smx.xml +++ b/jbi/src/test/resources/CommunicationJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -23,18 +19,16 @@ xmlns:util="http://www.springframework.org/schema/util" xmlns:jencks="http://jencks.org/2.0" xmlns:mws="http://ode/bpel/unit-test.wsdl" - xmlns:ws="http://playmobile.pl/process/mnpm/portIn" + xmlns:ws="http://playmobile.pl/process/mnpm/portIn" xmlns:sem="http://playmobile.pl/service/mnpm" xmlns:bpel="http://sample.bpel.org/bpel/sample" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> + <import resource="classpath:jndi-entries.xml"/> - <sm:container - id="jbi" - embedded="true" + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" @@ -93,10 +87,10 @@ <sm:component> <http:component> <http:endpoints> - <http:endpoint + <http:endpoint service="bpel:EPRTest2" - endpoint="http" - role="consumer" + endpoint="http" + role="consumer" locationURI="http://localhost:8198/EPRTest2/" defaultMep="http://www.w3.org/2004/08/wsdl/in-out" defaultOperation="opInOut" @@ -107,4 +101,4 @@ </sm:activationSpec> </sm:activationSpecs> </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/DigestJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/DigestJbiTest/smx.xml b/jbi/src/test/resources/DigestJbiTest/smx.xml index 11d2fcf..3ea13a1 100644 --- a/jbi/src/test/resources/DigestJbiTest/smx.xml +++ b/jbi/src/test/resources/DigestJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -25,16 +21,14 @@ xmlns:mws="http://ode/bpel/unit-test.wsdl" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> + <import resource="classpath:jndi-entries.xml"/> - <sm:container - id="jbi" - embedded="true" + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" > </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/EmptyRespJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/EmptyRespJbiTest/smx.xml b/jbi/src/test/resources/EmptyRespJbiTest/smx.xml index 49de1cc..3c9ad22 100644 --- a/jbi/src/test/resources/EmptyRespJbiTest/smx.xml +++ b/jbi/src/test/resources/EmptyRespJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -25,13 +21,11 @@ xmlns:util="http://www.springframework.org/schema/util" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> - - <sm:container - id="jbi" - embedded="true" + <import resource="classpath:jndi-entries.xml"/> + + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" @@ -41,15 +35,15 @@ <sm:component> <eip:component> <eip:endpoints> - <eip:content-based-router service="pong:PongServiceFwd" endpoint="PongPort" forwardOperation="true"> - <eip:rules> - <eip:routing-rule> - <eip:target> - <eip:exchange-target service="pong:PongService"/> - </eip:target> - </eip:routing-rule> - </eip:rules> - </eip:content-based-router> + <eip:content-based-router service="pong:PongServiceFwd" endpoint="PongPort" forwardOperation="true"> + <eip:rules> + <eip:routing-rule> + <eip:target> + <eip:exchange-target service="pong:PongService"/> + </eip:target> + </eip:routing-rule> + </eip:rules> + </eip:content-based-router> </eip:endpoints> </eip:component> </sm:component> @@ -58,17 +52,17 @@ <sm:component> <http:component> <http:endpoints> - <http:endpoint + <http:endpoint service="ping:PingService" - endpoint="http" - targetService="ping:PingService" - targetEndpoint="PingPort" + endpoint="http" + targetService="ping:PingService" + targetEndpoint="PingPort" defaultOperation="Ping" role="consumer" locationURI="http://localhost:8198/PingHttp/" - defaultMep="http://www.w3.org/2004/08/wsdl/in-out" - wsdlResource="classpath:EmptyRespJbiTest/Ping.wsdl" - soapVersion="1.1" + defaultMep="http://www.w3.org/2004/08/wsdl/in-out" + wsdlResource="classpath:EmptyRespJbiTest/Ping.wsdl" + soapVersion="1.1" soap="true" /> </http:endpoints> </http:component> @@ -76,4 +70,4 @@ </sm:activationSpec> </sm:activationSpecs> </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/ExtVarJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/ExtVarJbiTest/smx.xml b/jbi/src/test/resources/ExtVarJbiTest/smx.xml index 894385e..7ff13b9 100644 --- a/jbi/src/test/resources/ExtVarJbiTest/smx.xml +++ b/jbi/src/test/resources/ExtVarJbiTest/smx.xml @@ -1,64 +1,61 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" - xmlns:http="http://servicemix.apache.org/http/1.0" - xmlns:eip="http://servicemix.apache.org/eip/1.0" + xmlns:http="http://servicemix.apache.org/http/1.0" + xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:util="http://www.springframework.org/schema/util" xmlns:jencks="http://jencks.org/2.0" - > - <jencks:poolingSupport - id="poolingSupport2" + > + <jencks:poolingSupport + id="poolingSupport2" connectionMaxIdleMinutes="5" poolMaxSize="20" /> - + <jencks:connectionManager id="connectionManager2" containerManagedSecurity="false" transaction="local" transactionManager="#transactionManager" poolingSupport="#poolingSupport2" - connectionTracker="#connectionTracker" + connectionTracker="#connectionTracker" /> <bean id="localDerbyMCF" class="org.tranql.connector.derby.EmbeddedLocalMCF"> - <property name="databaseName" value="target/test/testdb"/> - <property name="createDatabase" value="true"/> - <property name="userName" value = "sa"/> + <property name="databaseName" value="target/test/testdb"/> + <property name="createDatabase" value="true"/> + <property name="userName" value = "sa"/> <property name="password" value = ""/> - </bean> - <bean id="localDerbyDataSource" class="org.jencks.factory.ConnectionFactoryFactoryBean"> - <property name="managedConnectionFactory" ref="localDerbyMCF"/> - <property name="connectionManager" ref="connectionManager2"/> - </bean> - + </bean> + <bean id="localDerbyDataSource" class="org.jencks.factory.ConnectionFactoryFactoryBean"> + <property name="managedConnectionFactory" ref="localDerbyMCF"/> + <property name="connectionManager" ref="connectionManager2"/> + </bean> + <util:map id="jndiEntries"> <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> + <entry key="java:comp/UserTransaction" value-ref="transactionManager" /> <entry key="testds" value-ref="localDerbyDataSource"/> - </util:map> - - <sm:container - id="jbi" - embedded="true" - rootDir="target/test/smx" - transactionManager="#transactionManager" - depends-on="jndi" - > - </sm:container> -</beans> + </util:map> + + <sm:container + id="jbi" + embedded="true" + rootDir="target/test/smx" + transactionManager="#transactionManager" + depends-on="jndi" + > + </sm:container> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/HelloWorldJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/HelloWorldJbiTest/smx.xml b/jbi/src/test/resources/HelloWorldJbiTest/smx.xml index 167efa6..c2d48c4 100644 --- a/jbi/src/test/resources/HelloWorldJbiTest/smx.xml +++ b/jbi/src/test/resources/HelloWorldJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -24,13 +20,11 @@ xmlns:util="http://www.springframework.org/schema/util" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> - - <sm:container - id="jbi" - embedded="true" + <import resource="classpath:jndi-entries.xml"/> + + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" @@ -40,13 +34,13 @@ <sm:component> <http:component> <http:endpoints> - <http:endpoint + <http:endpoint service="hello:HelloService" - endpoint="http" + endpoint="http" defaultOperation="Hello" - role="consumer" + role="consumer" locationURI="http://localhost:8198/HelloHttp/" - defaultMep="http://www.w3.org/2004/08/wsdl/in-out" + defaultMep="http://www.w3.org/2004/08/wsdl/in-out" soap="true" /> </http:endpoints> </http:component> @@ -54,4 +48,4 @@ </sm:activationSpec> </sm:activationSpecs> </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/MagicSessionExternalJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/MagicSessionExternalJbiTest/smx.xml b/jbi/src/test/resources/MagicSessionExternalJbiTest/smx.xml index c0ea9b7..b247fa1 100644 --- a/jbi/src/test/resources/MagicSessionExternalJbiTest/smx.xml +++ b/jbi/src/test/resources/MagicSessionExternalJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -25,13 +21,11 @@ xmlns:mws="http://ode/bpel/unit-test.wsdl" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> + <import resource="classpath:jndi-entries.xml"/> - <sm:container - id="jbi" - embedded="true" + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" @@ -66,4 +60,4 @@ </sm:activationSpec> </sm:activationSpecs> </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/MagicSessionJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/MagicSessionJbiTest/smx.xml b/jbi/src/test/resources/MagicSessionJbiTest/smx.xml index ee8daa8..c61cedb 100644 --- a/jbi/src/test/resources/MagicSessionJbiTest/smx.xml +++ b/jbi/src/test/resources/MagicSessionJbiTest/smx.xml @@ -1,39 +1,33 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" - xmlns:http="http://servicemix.apache.org/http/1.0" - xmlns:eip="http://servicemix.apache.org/eip/1.0" + xmlns:http="http://servicemix.apache.org/http/1.0" + xmlns:eip="http://servicemix.apache.org/eip/1.0" xmlns:util="http://www.springframework.org/schema/util" xmlns:jencks="http://jencks.org/2.0" - > + > + + <import resource="classpath:jndi-entries.xml"/> - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> - - <sm:container - id="jbi" - embedded="true" - rootDir="target/test/smx" - transactionManager="#transactionManager" - depends-on="jndi" - > - </sm:container> -</beans> + <sm:container + id="jbi" + embedded="true" + rootDir="target/test/smx" + transactionManager="#transactionManager" + depends-on="jndi" + > + </sm:container> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/OnEventAlarmJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/OnEventAlarmJbiTest/smx.xml b/jbi/src/test/resources/OnEventAlarmJbiTest/smx.xml index 89d522c..985f5c8 100644 --- a/jbi/src/test/resources/OnEventAlarmJbiTest/smx.xml +++ b/jbi/src/test/resources/OnEventAlarmJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -26,13 +22,11 @@ xmlns:bpel="http://sample.bpel.org/bpel/sample" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> + <import resource="classpath:jndi-entries.xml"/> - <sm:container - id="jbi" - embedded="true" + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" @@ -42,19 +36,19 @@ <sm:component> <eip:component> <eip:endpoints> - <eip:content-based-router service="bpel:OnEventCorrelation2Fwd" endpoint="OnEventCorrelation2" forwardOperation="true"> - <eip:rules> - <eip:routing-rule> - <eip:target> - <eip:exchange-target service="bpel:OnEventCorrelation2"/> - </eip:target> - </eip:routing-rule> - </eip:rules> - </eip:content-based-router> + <eip:content-based-router service="bpel:OnEventCorrelation2Fwd" endpoint="OnEventCorrelation2" forwardOperation="true"> + <eip:rules> + <eip:routing-rule> + <eip:target> + <eip:exchange-target service="bpel:OnEventCorrelation2"/> + </eip:target> + </eip:routing-rule> + </eip:rules> + </eip:content-based-router> </eip:endpoints> </eip:component> </sm:component> </sm:activationSpec> </sm:activationSpecs> </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/ReplayerJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/ReplayerJbiTest/smx.xml b/jbi/src/test/resources/ReplayerJbiTest/smx.xml index 89d522c..985f5c8 100644 --- a/jbi/src/test/resources/ReplayerJbiTest/smx.xml +++ b/jbi/src/test/resources/ReplayerJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -26,13 +22,11 @@ xmlns:bpel="http://sample.bpel.org/bpel/sample" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> + <import resource="classpath:jndi-entries.xml"/> - <sm:container - id="jbi" - embedded="true" + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" @@ -42,19 +36,19 @@ <sm:component> <eip:component> <eip:endpoints> - <eip:content-based-router service="bpel:OnEventCorrelation2Fwd" endpoint="OnEventCorrelation2" forwardOperation="true"> - <eip:rules> - <eip:routing-rule> - <eip:target> - <eip:exchange-target service="bpel:OnEventCorrelation2"/> - </eip:target> - </eip:routing-rule> - </eip:rules> - </eip:content-based-router> + <eip:content-based-router service="bpel:OnEventCorrelation2Fwd" endpoint="OnEventCorrelation2" forwardOperation="true"> + <eip:rules> + <eip:routing-rule> + <eip:target> + <eip:exchange-target service="bpel:OnEventCorrelation2"/> + </eip:target> + </eip:routing-rule> + </eip:rules> + </eip:content-based-router> </eip:endpoints> </eip:component> </sm:component> </sm:activationSpec> </sm:activationSpecs> </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/RetireJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/RetireJbiTest/smx.xml b/jbi/src/test/resources/RetireJbiTest/smx.xml index 11d2fcf..3ea13a1 100644 --- a/jbi/src/test/resources/RetireJbiTest/smx.xml +++ b/jbi/src/test/resources/RetireJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -25,16 +21,14 @@ xmlns:mws="http://ode/bpel/unit-test.wsdl" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> + <import resource="classpath:jndi-entries.xml"/> - <sm:container - id="jbi" - embedded="true" + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" > </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/SpringPropertiesJbiTest/smx.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/SpringPropertiesJbiTest/smx.xml b/jbi/src/test/resources/SpringPropertiesJbiTest/smx.xml index 89d522c..985f5c8 100644 --- a/jbi/src/test/resources/SpringPropertiesJbiTest/smx.xml +++ b/jbi/src/test/resources/SpringPropertiesJbiTest/smx.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -26,13 +22,11 @@ xmlns:bpel="http://sample.bpel.org/bpel/sample" > - <util:map id="jndiEntries"> - <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> - </util:map> + <import resource="classpath:jndi-entries.xml"/> - <sm:container - id="jbi" - embedded="true" + <sm:container + id="jbi" + embedded="true" rootDir="target/test/smx" transactionManager="#transactionManager" depends-on="jndi" @@ -42,19 +36,19 @@ <sm:component> <eip:component> <eip:endpoints> - <eip:content-based-router service="bpel:OnEventCorrelation2Fwd" endpoint="OnEventCorrelation2" forwardOperation="true"> - <eip:rules> - <eip:routing-rule> - <eip:target> - <eip:exchange-target service="bpel:OnEventCorrelation2"/> - </eip:target> - </eip:routing-rule> - </eip:rules> - </eip:content-based-router> + <eip:content-based-router service="bpel:OnEventCorrelation2Fwd" endpoint="OnEventCorrelation2" forwardOperation="true"> + <eip:rules> + <eip:routing-rule> + <eip:target> + <eip:exchange-target service="bpel:OnEventCorrelation2"/> + </eip:target> + </eip:routing-rule> + </eip:rules> + </eip:content-based-router> </eip:endpoints> </eip:component> </sm:component> </sm:activationSpec> </sm:activationSpecs> </sm:container> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/jndi-entries.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/jndi-entries.xml b/jbi/src/test/resources/jndi-entries.xml new file mode 100644 index 0000000..eb37bc9 --- /dev/null +++ b/jbi/src/test/resources/jndi-entries.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<beans xmlns:sm="http://servicemix.apache.org/config/1.0" + xmlns:http="http://servicemix.apache.org/http/1.0" + xmlns:eip="http://servicemix.apache.org/eip/1.0" + xmlns:hello="urn:/HelloWorld2.wsdl" + xmlns:util="http://www.springframework.org/schema/util" + > + + <util:map id="jndiEntries"> + <entry key="java:comp/env/jdbc/ode" value-ref="odeDS"/> + <entry key="java:comp/UserTransaction" value-ref="transactionManager" /> + </util:map> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/jbi/src/test/resources/smx-base.xml ---------------------------------------------------------------------- diff --git a/jbi/src/test/resources/smx-base.xml b/jbi/src/test/resources/smx-base.xml index 6e0ce72..6989df3 100644 --- a/jbi/src/test/resources/smx-base.xml +++ b/jbi/src/test/resources/smx-base.xml @@ -1,21 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> <beans xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:http="http://servicemix.apache.org/http/1.0" @@ -27,30 +23,30 @@ <bean id="transactionManager" class="org.apache.geronimo.transaction.manager.GeronimoTransactionManager"/> <jencks:connectionTracker id="connectionTracker" geronimoTransactionManager="#transactionManager" /> - + <jencks:workManager id="workManager" threadPoolSize="200" transactionManager="#transactionManager" /> - + <jencks:bootstrapContext id="bootstrapContext" workManager="#workManager" transactionManager="#transactionManager" /> - - <jencks:poolingSupport - id="poolingSupport" + + <jencks:poolingSupport + id="poolingSupport" connectionMaxIdleMinutes="5" poolMaxSize="20" /> - + <jencks:connectionManager id="connectionManager" containerManagedSecurity="false" transaction="local" transactionManager="#transactionManager" poolingSupport="#poolingSupport" - connectionTracker="#connectionTracker" + connectionTracker="#connectionTracker" /> <bean id="odeMCF" class="org.tranql.connector.derby.EmbeddedLocalMCF"> @@ -59,7 +55,7 @@ <property name="userName" value = "sa"/> <property name="password" value = ""/> </bean> - <!-- + <!-- <bean id="odeMCF" class="org.tranql.connector.oracle.LocalMCF"> <property name="databaseName" value="XE"/> <property name="userName" value="ode12"/> @@ -69,18 +65,18 @@ <property name="driverType" value="thin"/> </bean> --> - + <bean id="odeDS" class="org.jencks.factory.ConnectionFactoryFactoryBean"> <property name="managedConnectionFactory" ref="odeMCF"/> <property name="connectionManager" ref="connectionManager"/> </bean> - + <bean id="jndi" - class="org.apache.xbean.spring.jndi.SpringInitialContextFactory" + class="org.apache.xbean.spring.jndi.SpringInitialContextFactory" factory-method="makeInitialContext" singleton="true" depends-on="bootstrapContext" > <property name="entries" ref="jndiEntries" /> </bean> -</beans> +</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/tasks/derby.rake ---------------------------------------------------------------------- diff --git a/tasks/derby.rake b/tasks/derby.rake index 4cb9f26..9dcad41 100644 --- a/tasks/derby.rake +++ b/tasks/derby.rake @@ -17,7 +17,7 @@ module Derby - REQUIRES = Buildr.group("derby", "derbytools", :under=>"org.apache.derby", :version=>"10.1.2.1") + REQUIRES = Buildr.group("derby", "derbytools", :under=>"org.apache.derby", :version=>"10.5.3.0_1") Java.classpath << REQUIRES @@ -47,4 +47,4 @@ module Derby end -end +end \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/28085edc/tasks/h2.rake ---------------------------------------------------------------------- diff --git a/tasks/h2.rake b/tasks/h2.rake index af5344b..60aa873 100644 --- a/tasks/h2.rake +++ b/tasks/h2.rake @@ -17,14 +17,14 @@ module H2 - REQUIRES = "com.h2database:h2:jar:1.3.173" + REQUIRES = "com.h2database:h2:jar:1.3.176" #Java.classpath << REQUIRES class << self # Returns a task that will create a new H2 database. The task name is the path to - # the H2 database. The prerequisites are all the SQL files for inclusion in the database. + # the H2 database. The prerequisites are all the SQL files for inclusion in the database # # For example: # H2.create "mydb"=>h2.sql @@ -33,11 +33,11 @@ module H2 targetDir=File.expand_path(db) file(targetDir=>prereqs) do |task| rm_rf task.name if File.exist?(task.name) - Java::Commands.java "org.h2.tools.RunScript", "-url", "jdbc:h2:file:"+Util.normalize_path("#{targetDir}/#{dbname}")+";DB_CLOSE_ON_EXIT=false;user=sa", "-showResults", "-script", prereqs, :classpath => REQUIRES + Java::Commands.java "org.h2.tools.RunScript", "-url", "jdbc:h2:file:"+Util.normalize_path("#{targetDir}/#{dbname}")+";DB_CLOSE_ON_EXIT=false", "-user", "sa", "-showResults", "-script", prereqs, :classpath => REQUIRES # Copy the SQL files into the database directory. Buildr.filter(prereqs).into(task.name).run touch task.name, :verbose=>false end end end -end +end \ No newline at end of file
