Search in sources :

Example 6 with Configuration

use of org.apache.openejb.testing.Configuration in project tomee by apache.

the class ManagedDataSourceIsClosedTest method config.

@Configuration
public Properties config() {
    final Properties p = new Properties();
    p.put("openejb.jdbc.datasource-creator", "dbcp-alternative");
    p.put("managed", "new://Resource?type=DataSource");
    p.put("managed.JdbcDriver", "org.hsqldb.jdbcDriver");
    p.put("managed.JdbcUrl", URL);
    p.put("managed.UserName", USER);
    p.put("managed.Password", PASSWORD);
    p.put("managed.JtaManaged", "true");
    return p;
}
Also used : Properties(java.util.Properties) Configuration(org.apache.openejb.testing.Configuration)

Example 7 with Configuration

use of org.apache.openejb.testing.Configuration in project tomee by apache.

the class ManagedDataSourceTest method config.

@Configuration
public Properties config() {
    final Properties p = new Properties();
    p.put("openejb.jdbc.datasource-creator", "dbcp-alternative");
    p.put("managed", "new://Resource?type=DataSource");
    p.put("managed.JdbcDriver", "org.hsqldb.jdbcDriver");
    p.put("managed.JdbcUrl", URL);
    p.put("managed.UserName", USER);
    p.put("managed.Password", PASSWORD);
    p.put("managed.JtaManaged", "true");
    return p;
}
Also used : Properties(java.util.Properties) Configuration(org.apache.openejb.testing.Configuration)

Example 8 with Configuration

use of org.apache.openejb.testing.Configuration in project tomee by apache.

the class UTManagedDataSourceTest method config.

@Configuration
public Properties config() {
    final Properties p = new Properties();
    p.put("openejb.jdbc.datasource-creator", "dbcp-alternative");
    p.put("managed", "new://Resource?type=DataSource");
    p.put("managed.JdbcDriver", "org.hsqldb.jdbcDriver");
    p.put("managed.JdbcUrl", URL);
    p.put("managed.UserName", USER);
    p.put("managed.Password", PASSWORD);
    p.put("managed.JtaManaged", "true");
    return p;
}
Also used : Properties(java.util.Properties) Configuration(org.apache.openejb.testing.Configuration)

Example 9 with Configuration

use of org.apache.openejb.testing.Configuration in project tomee by apache.

the class XADataSourceTest method config.

@Configuration
public java.util.Properties config() {
    final File file = new File("target/test/xa/howl");
    if (file.isDirectory()) {
        Files.delete(file);
    }
    final Properties p = new Properties();
    // default dbcp pool supports xaDataSource config, not our proxy layer
    p.put(DataSourceCreator.class.getName(), DbcpDataSourceCreator.class.getName());
    p.put("txMgr", "new://TransactionManager?type=TransactionManager");
    p.put("txMgr.txRecovery", "true");
    p.put("txMgr.logFileDir", "target/test/xa/howl");
    // real XA datasources
    p.put("xa", "new://Resource?class-name=" + JDBCXADataSource.class.getName());
    p.put("xa.url", "jdbc:hsqldb:mem:xa");
    p.put("xa.user", "sa");
    p.put("xa.password", "");
    // conflict with connectionProperties
    p.put("xa.SkipImplicitAttributes", "true");
    p.put("xa2", "new://Resource?class-name=" + JDBCXADataSource.class.getName());
    p.put("xa2.url", "jdbc:hsqldb:mem:xa2");
    p.put("xa2.user", "sa");
    p.put("xa2.password", "");
    p.put("xa2.SkipImplicitAttributes", "true");
    // pooled "XA" datasources
    p.put("xadb", "new://Resource?type=DataSource");
    // to be xa
    p.put("xadb.XaDataSource", "xa");
    p.put("xadb.JtaManaged", "true");
    p.put("xadb2", "new://Resource?type=DataSource");
    // to be xa
    p.put("xadb2.XaDataSource", "xa2");
    p.put("xadb2.JtaManaged", "true");
    // non jta datasources
    p.put("xadbn", "new://Resource?class-name=" + JDBCXADataSource.class.getName());
    p.put("xadbn.JdbcDriver", jdbcDriver.class.getName());
    p.put("xadbn.url", "jdbc:hsqldb:mem:xa");
    p.put("xadbn.user", "sa");
    p.put("xadbn.password", "");
    p.put("xadbn2", "new://Resource?type=DataSource");
    p.put("xadbn2.JdbcDriver", jdbcDriver.class.getName());
    p.put("xadbn2.JdbcUrl", "jdbc:hsqldb:mem:xa2");
    p.put("xadbn2.UserName", "sa");
    p.put("xadbn2.Password", "");
    p.put("xadbn2.JtaManaged", "false");
    return p;
}
Also used : org.hsqldb.jdbcDriver(org.hsqldb.jdbcDriver) DbcpDataSourceCreator(org.apache.openejb.resource.jdbc.dbcp.DbcpDataSourceCreator) Properties(java.util.Properties) File(java.io.File) DataSourceCreator(org.apache.openejb.resource.jdbc.pool.DataSourceCreator) DbcpDataSourceCreator(org.apache.openejb.resource.jdbc.dbcp.DbcpDataSourceCreator) Configuration(org.apache.openejb.testing.Configuration)

Example 10 with Configuration

use of org.apache.openejb.testing.Configuration in project tomee by apache.

the class DynamicEJBImplTest method config.

@Configuration
public Properties config() {
    final Properties p = new Properties();
    p.put("dynamicEjbDatabase", "new://Resource?type=DataSource");
    p.put("dynamicEjbDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");
    p.put("dynamicEjbDatabase.JdbcUrl", "jdbc:hsqldb:mem:bval");
    return p;
}
Also used : Properties(java.util.Properties) Configuration(org.apache.openejb.testing.Configuration)

Aggregations

Configuration (org.apache.openejb.testing.Configuration)44 Properties (java.util.Properties)43 File (java.io.File)5 DbcpDataSourceCreator (org.apache.openejb.resource.jdbc.dbcp.DbcpDataSourceCreator)2 DataSourceCreator (org.apache.openejb.resource.jdbc.pool.DataSourceCreator)2 Path (java.nio.file.Path)1 PropertiesResourceProvider (org.apache.openejb.api.resource.PropertiesResourceProvider)1 OpenEjbConfiguration (org.apache.openejb.assembler.classic.OpenEjbConfiguration)1 IsDifferentXaDataSourceWrapper (org.apache.openejb.resource.jdbc.xa.IsDifferentXaDataSourceWrapper)1 PropertiesBuilder (org.apache.openejb.testng.PropertiesBuilder)1 org.hsqldb.jdbcDriver (org.hsqldb.jdbcDriver)1