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


Java DataTypeException类代码示例

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


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

示例1: createDataType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Override
public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException {
    if (sqlType == 1111) {
        if ("jsonb".equals(sqlTypeName)) {
            return new JsonbDataType();
        }
    }

    return super.createDataType(sqlType, sqlTypeName);
}
 
开发者ID:drinkwater-io,项目名称:drinkwater-java,代码行数:11,代码来源:DWPostgresqlDataTypeFactory.java

示例2: createDataType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Override
public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException {
  logger.debug("createDataType(sqlType={}, sqlTypeName={}) - start", new Integer(sqlType),
      sqlTypeName);

  DataType customDataType = customDataTypeMap.get(sqlTypeName);
  if (customDataType != null) {
    logger.debug("use custom dataType(sqlTypeName={}, dataType=)", sqlTypeName, customDataType);
    return customDataType;
  } else {
    return super.createDataType(sqlType, sqlTypeName);
  }
}
 
开发者ID:frank780117,项目名称:dbunit-ext,代码行数:14,代码来源:CustomableDataTypeFactory.java

示例3: testCreateDataType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Test
public void testCreateDataType() throws DataTypeException {
  ClikeDataTypeFactory factory = new ClikeDataTypeFactory();
  DataType dataType = factory.createDataType(Types.TIMESTAMP, "TIMESTAMP");
  
  assertThat(dataType, is(instanceOf(IntervalNowTimestampType.class)));

}
 
开发者ID:frank780117,项目名称:dbunit-ext,代码行数:9,代码来源:ClikeDataTypeFactoryTest.java

示例4: testAddCustomType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Test
public void testAddCustomType() throws DataTypeException {
  CustomableDataTypeFactory factory = new CustomableDataTypeFactory();
  factory.addCustomType("MYTYPE", DataType.BOOLEAN);
  factory.addCustomType("MYTYPE2", DataType.BOOLEAN);
  
  DataType dataType = factory.createDataType(55, "MYTYPE");
  DataType dataType2 = factory.createDataType(1, "MYTYPE2");
  DataType dataType3 = factory.createDataType(1, "VARCHAR");
  
  assertThat(dataType, is(DataType.BOOLEAN));
  assertThat(dataType2, is(DataType.BOOLEAN));
  assertThat(dataType3, not(DataType.BOOLEAN));
}
 
开发者ID:frank780117,项目名称:dbunit-ext,代码行数:15,代码来源:CustomableDataTypeFactoryTest.java

示例5: createDataType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Override
public DataType createDataType(int sqlType, String sqlTypeName, String tableName, String columnName)
        throws DataTypeException {

    if ((columnName.startsWith("COL") || columnName.startsWith("col")) && sqlType == Types.BIGINT) {
        return DataType.INTEGER;
    }
    return super.createDataType(sqlType, sqlTypeName);
}
 
开发者ID:apache,项目名称:kylin,代码行数:10,代码来源:KylinTestBase.java

示例6: createDataType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
public DataType createDataType(int sqlType, String sqlTypeName)
    throws DataTypeException {
  if (sqlType == Types.TIMESTAMP) {
    return new CustomTimestampDataType();
  }
  else {
    return super.createDataType(sqlType, sqlTypeName);
  }
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:10,代码来源:MessageDAOImplTest.java

示例7: createDataType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Override
public DataType createDataType(int sqlType, String sqlTypeName, String tableName, String columnName) throws DataTypeException {

    if ((columnName.startsWith("COL") || columnName.startsWith("col")) && sqlType == Types.BIGINT) {
        return DataType.INTEGER;
    }
    return super.createDataType(sqlType, sqlTypeName);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:9,代码来源:KylinTestBase.java

示例8: createDataType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Override
public DataType createDataType(int sqlType, String sqlTypeName) throws DataTypeException {
    return super.createDataType(sqlType, sqlTypeName);
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:5,代码来源:ExtendedOracle10DataTypeFactory.java

示例9: testRemoveCustomType

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Test
public void testRemoveCustomType() throws DataTypeException {
  CustomableDataTypeFactory factory = new CustomableDataTypeFactory();
  
  DataType customedDatatype = DataType.DOUBLE;
  DataType customDatatype = DataType.BOOLEAN;
  
  factory.addCustomType(customedDatatype.toString(), customDatatype);
  
  DataType dataType = factory.createDataType(customedDatatype.getSqlType(), customedDatatype.toString());
  
  factory.removeCustomType(customedDatatype.toString());
  
  DataType dataType2 = factory.createDataType(customedDatatype.getSqlType(), customedDatatype.toString());

  assertThat(dataType, is(customDatatype));
  assertThat(dataType2, not(customDatatype));
}
 
开发者ID:frank780117,项目名称:dbunit-ext,代码行数:19,代码来源:CustomableDataTypeFactoryTest.java

示例10: getValue

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
public Object getValue(int row, String column) throws DataSetException {
    if (logger.isDebugEnabled())
        logger.debug("getValue(row={}, columnName={}) - start", Integer.toString(row), column);

    assertValidRowIndex(row);

    int columnIndex = getColumnIndex(column);
    HSSFCell cell = _sheet.getRow(row + 1).getCell(columnIndex);
    if (cell == null) {
        return null;
    }

    int type = cell.getCellType();
    switch (type) {
    case HSSFCell.CELL_TYPE_NUMERIC:
        HSSFCellStyle style = cell.getCellStyle();
        if (HSSFDateUtil.isCellDateFormatted(cell)) {
            return getDateValue(cell);
        } else if (XlsDataSetWriter.DATE_FORMAT_AS_NUMBER_DBUNIT.equals(style.getDataFormatString())) {
            // The special dbunit date format
            return getDateValueFromJavaNumber(cell);
        } else {
            return getNumericValue(cell);
            }

    case HSSFCell.CELL_TYPE_STRING:
        return cell.getRichStringCellValue().getString();

        case HSSFCell.CELL_TYPE_FORMULA:
        throw new DataTypeException("Formula not supported at row=" +
                row + ", column=" + column);

        case HSSFCell.CELL_TYPE_BLANK:
        return null;

        case HSSFCell.CELL_TYPE_BOOLEAN:
        return cell.getBooleanCellValue() ? Boolean.TRUE : Boolean.FALSE;

        case HSSFCell.CELL_TYPE_ERROR:
        throw new DataTypeException("Error at row=" + row +
                ", column=" + column);

        default:
        throw new DataTypeException("Unsupported type at row=" + row +
                ", column=" + column);
    }
}
 
开发者ID:sapientTest,项目名称:Sapient,代码行数:48,代码来源:XlsTable.java

示例11: testSetCurrentIntervalSecondLength

import org.dbunit.dataset.datatype.DataTypeException; //导入依赖的package包/类
@Test
public void testSetCurrentIntervalSecondLength() throws DataTypeException {
  ClikeDataTypeFactory factory = new ClikeDataTypeFactory();
  
  DataType dataType = factory.createDataType(Types.TIMESTAMP, "TIMESTAMP");
  
  assertThat(dataType, is(instanceOf(IntervalNowTimestampType.class)));
  
  factory.setCurrentIntervalSecondLength(3L);
  DataType dataType2 = factory.createDataType(Types.TIMESTAMP, "TIMESTAMP");
  
  assertThat(dataType, not(dataType2));
}
 
开发者ID:frank780117,项目名称:dbunit-ext,代码行数:14,代码来源:ClikeDataTypeFactoryTest.java


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