Search in sources :

Example 21 with PoolingDataSource

use of org.jbpm.test.util.PoolingDataSource in project jbpm by kiegroup.

the class JbpmTestCase method setupPoolingDataSource.

@Override
protected PoolingDataSource setupPoolingDataSource() {
    Properties dsProps = PersistenceUtil.getDatasourceProperties();
    String jdbcUrl = dsProps.getProperty("url");
    String driverClass = dsProps.getProperty("driverClassName");
    // Setup the datasource
    PoolingDataSource ds1 = PersistenceUtil.setupPoolingDataSource(dsProps, "jdbc/jbpm-ds", false);
    if (driverClass.startsWith("org.h2")) {
        ds1.getDriverProperties().setProperty("url", jdbcUrl);
    }
    ds1.init();
    return ds1;
}
Also used : PoolingDataSource(org.jbpm.test.util.PoolingDataSource) Properties(java.util.Properties)

Example 22 with PoolingDataSource

use of org.jbpm.test.util.PoolingDataSource in project jbpm by kiegroup.

the class TestUtil method setupPoolingDataSource.

public static PoolingDataSource setupPoolingDataSource() {
    Properties dsProps = getDatasourceProperties();
    PoolingDataSource pds = PersistenceUtil.setupPoolingDataSource(dsProps, "jdbc/jbpm-ds", false);
    pds.init();
    return pds;
}
Also used : PoolingDataSource(org.jbpm.test.util.PoolingDataSource) Properties(java.util.Properties)

Aggregations

PoolingDataSource (org.jbpm.test.util.PoolingDataSource)22 Properties (java.util.Properties)12 EntityManagerFactory (javax.persistence.EntityManagerFactory)2 Before (org.junit.Before)2 File (java.io.File)1 IOException (java.io.IOException)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 SQLException (java.sql.SQLException)1 HashMap (java.util.HashMap)1