当前位置: 首页>>代码示例>>Java>>正文


Java H2DataTypeFactory类代码示例

本文整理汇总了Java中org.dbunit.ext.h2.H2DataTypeFactory的典型用法代码示例。如果您正苦于以下问题:Java H2DataTypeFactory类的具体用法?Java H2DataTypeFactory怎么用?Java H2DataTypeFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


H2DataTypeFactory类属于org.dbunit.ext.h2包,在下文中一共展示了H2DataTypeFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configDatabaseProperties

import org.dbunit.ext.h2.H2DataTypeFactory; //导入依赖的package包/类
private void configDatabaseProperties() throws SQLException {
    DatabaseConfig config = dbUnitConnection.getConfig();
    for (Map.Entry<String, Object> p : dbUnitConfig.getProperties().entrySet()) {
        ConfigProperty byShortName = DatabaseConfig.findByShortName(p.getKey());
        if (byShortName != null) {
            config.setProperty(byShortName.getProperty(), p.getValue());
        }
    }

    switch (dbType) {
    case HSQLDB:
        config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new HsqldbDataTypeFactory());
        break;
    case H2:
        config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new H2DataTypeFactory());
        break;
    case MYSQL:
        config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new MySqlDataTypeFactory());
        break;
    case POSTGRESQL:
        config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new PostgresqlDataTypeFactory());
        break;
    case ORACLE:
        config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new Oracle10DataTypeFactory());
        break;
    }
}
 
开发者ID:database-rider,项目名称:database-rider,代码行数:28,代码来源:RiderDataSource.java

示例2: testConnection

import org.dbunit.ext.h2.H2DataTypeFactory; //导入依赖的package包/类
@SuppressWarnings("ProhibitedExceptionDeclared")
@Bean
public DatabaseDataSourceConnection testConnection(final DataSource dataSource) throws Exception {
    final DatabaseConfigBean databaseConfigBean = new DatabaseConfigBean();
    databaseConfigBean.setDatatypeFactory(new H2DataTypeFactory());
    databaseConfigBean.setCaseSensitiveTableNames(false);

    final DatabaseDataSourceConnectionFactoryBean databaseDataSourceConnectionFactoryBean = new DatabaseDataSourceConnectionFactoryBean();
    databaseDataSourceConnectionFactoryBean.setDataSource(dataSource);
    databaseDataSourceConnectionFactoryBean.setDatabaseConfig(databaseConfigBean);
    databaseDataSourceConnectionFactoryBean.setSchema("FIND");

    return databaseDataSourceConnectionFactoryBean.getObject();
}
 
开发者ID:hpe-idol,项目名称:find,代码行数:15,代码来源:SavedSearchTestConfiguration.java

示例3: TestCaseDataSourceDatabaseTesterRule

import org.dbunit.ext.h2.H2DataTypeFactory; //导入依赖的package包/类
public TestCaseDataSourceDatabaseTesterRule() {
  super();
  final H2Rule h2 = new H2Rule();
  final LiquiunitRule liquibase = new LiquiunitRule(h2);
  final DataSourceDatabaseTesterRule dbUnit = new DataSourceDatabaseTesterRule(h2, new H2DataTypeFactory());
  this.rule = RuleChain.outerRule(h2).around(liquibase).around(dbUnit);
}
 
开发者ID:ljnelson,项目名称:liquiunit,代码行数:8,代码来源:TestCaseDataSourceDatabaseTesterRule.java

示例4: TestCaseJPARule

import org.dbunit.ext.h2.H2DataTypeFactory; //导入依赖的package包/类
public TestCaseJPARule() {
  super();
  final H2Rule h2 = new H2Rule(archive);
  final LiquiunitRule liquibase = new LiquiunitRule(h2);
  final DataSourceDatabaseTesterRule dbUnit = new DataSourceDatabaseTesterRule(h2, new H2DataTypeFactory());
  final TestRule jpaRule = new JPARule(this, "test", h2);
  this.rule = RuleChain.outerRule(h2).around(liquibase).around(dbUnit).around(jpaRule);
}
 
开发者ID:ljnelson,项目名称:liquiunit,代码行数:9,代码来源:TestCaseJPARule.java

示例5: setUpDatabaseConfig

import org.dbunit.ext.h2.H2DataTypeFactory; //导入依赖的package包/类
@Override
protected void setUpDatabaseConfig(DatabaseConfig config) {
	config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new H2DataTypeFactory());
}
 
开发者ID:dianping,项目名称:zebra,代码行数:5,代码来源:SingleDBBaseTestCase.java

示例6: createDbUnitH2Connection

import org.dbunit.ext.h2.H2DataTypeFactory; //导入依赖的package包/类
private IDatabaseConnection createDbUnitH2Connection(Connection connection) throws DatabaseUnitException {
	IDatabaseConnection dbUnitConnection = new DatabaseConnection(connection);
	dbUnitConnection.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new H2DataTypeFactory());
	return dbUnitConnection;
}
 
开发者ID:Ryudo302,项目名称:mychart,代码行数:6,代码来源:AbstractDbUnitTest.java

示例7: typical

import org.dbunit.ext.h2.H2DataTypeFactory; //导入依赖的package包/类
/**
 * A convenience "fire-and-forget" method that returns a {@link
 * TestRule} constructed in the following manner:
 *
 * <blockquote><pre>final H2Rule h2 = new H2Rule(archive);
 *final LiquiunitRule liquibase = new LiquiunitRule(h2);
 *final DataSourceDatabaseTesterRule dbUnit = new DataSourceDatabaseTesterRule(h2, new H2DataTypeFactory());
 *final TestRule jpaRule = new JPARule(this, "test", h2);
 *return RuleChain.outerRule(h2).around(liquibase).around(dbUnit).around(jpaRule);</pre></blockquote>
 *
 * @param testInstance the JUnit test instance being set up; should
 * not be {@code null}
 * 
 * @param archive an {@link H2Archive} to store the "blank" state of
 * the underlying in-memory H2 database; may be {@code null}
 * 
 * @return a non-{@code null} {@link TestRule} set up for
 * JPA-oriented testing
 */
public static TestRule typical(final Object testInstance, final H2Archive archive) {
  final H2Rule h2 = new H2Rule(archive);
  final LiquiunitRule liquibase = new LiquiunitRule(h2);
  final DataSourceDatabaseTesterRule dbUnit = new DataSourceDatabaseTesterRule(h2, new H2DataTypeFactory());
  final TestRule jpaRule = new JPARule(testInstance, "test", h2);
  // H2, then Liquibase, then dbUnit, then JPA.
  return RuleChain.outerRule(h2).around(liquibase).around(dbUnit).around(jpaRule);
}
 
开发者ID:ljnelson,项目名称:liquiunit,代码行数:28,代码来源:JPARule.java


注:本文中的org.dbunit.ext.h2.H2DataTypeFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。