public static TableColumnInfo getEasyMockTableColumnInfo(String catalogName,
String schemaName, String tableName, String columnName, int dataType,
int columnSize, String defaultValue, String remarks,
int decimalDigits, int octetLength, int radix, boolean nullable) {
TableColumnInfo info = createMock(TableColumnInfo.class);
expect(info.getCatalogName()).andReturn(catalogName).anyTimes();
expect(info.getSchemaName()).andReturn(schemaName).anyTimes();
expect(info.getTableName()).andReturn(tableName).anyTimes();
expect(info.getColumnName()).andReturn(columnName).anyTimes();
expect(info.getDataType()).andReturn(dataType).anyTimes();
expect(info.getTypeName()).andReturn(JDBCTypeMapper.getJdbcTypeName(dataType))
.anyTimes();
expect(info.getColumnSize()).andReturn(columnSize).anyTimes();
expect(info.getDatabaseObjectType()).andReturn(DatabaseObjectType.COLUMN)
.anyTimes();
expect(info.getDefaultValue()).andReturn(defaultValue).anyTimes();
expect(info.getRemarks()).andReturn(remarks).anyTimes();
expect(info.getDecimalDigits()).andReturn(decimalDigits).anyTimes();
expect(info.getOctetLength()).andReturn(octetLength).anyTimes();
expect(info.getQualifiedName()).andReturn(schemaName + "." + tableName
+ "." + columnName).anyTimes();
expect(info.getRadix()).andReturn(radix).anyTimes();
if (nullable) {
expect(info.isNullable()).andReturn("YES").anyTimes();
expect(info.isNullAllowed()).andReturn(1).anyTimes();
} else {
expect(info.isNullable()).andReturn("NO").anyTimes();
expect(info.isNullAllowed()).andReturn(0).anyTimes();
}
replay(info);
return info;
}