use of org.dbflute.logic.replaceschema.loaddata.impl.DfXlsDataHandlerImpl in project dbflute-core by dbflute.
the class DfXlsDataHandlerImplTest method test_processBoolean.
// -----------------------------------------------------
// Boolean
// -------
public void test_processBoolean() throws Exception {
// ## Arrange ##
final DfXlsDataHandlerImpl impl = new DfXlsDataHandlerImpl(null, null) {
@Override
protected Class<?> getBindType(String tableName, DfColumnMeta columnMetaInfo) {
return BigDecimal.class;
}
};
Map<String, DfColumnMeta> columnMetaInfoMap = StringKeyMap.createAsCaseInsensitive();
DfColumnMeta info = new DfColumnMeta();
info.setColumnName("foo");
info.setColumnSize(3);
info.setJdbcDefValue(Types.NUMERIC);
columnMetaInfoMap.put("foo", info);
// ## Act ##
boolean actual = impl.processBoolean("tbl", "foo", "0", null, null, 0, columnMetaInfoMap, 3);
// ## Assert ##
log("actual=" + actual);
assertFalse(actual);
}
use of org.dbflute.logic.replaceschema.loaddata.impl.DfXlsDataHandlerImpl in project dbflute-core by dbflute.
the class DfXlsDataHandlerImplTest method test_DfXlsDataHandlerImpl_isNotNullNotString.
// ===================================================================================
// Process per Type
// ================
// -----------------------------------------------------
// NotNull NotString
// -----------------
public void test_DfXlsDataHandlerImpl_isNotNullNotString() {
// ## Arrange ##
final DfXlsDataHandlerImpl impl = createHandler();
// ## Act & Assert ##
assertFalse(impl.isNotNullNotString(null));
assertFalse(impl.isNotNullNotString("abc"));
assertTrue(impl.isNotNullNotString(new Date()));
assertTrue(impl.isNotNullNotString(new Timestamp(System.currentTimeMillis())));
}
use of org.dbflute.logic.replaceschema.loaddata.impl.DfXlsDataHandlerImpl in project dbflute-core by dbflute.
the class DfXlsDataHandlerImplTest method test_DfXlsDataHandlerImpl_setSkipSheet_SyntaxError.
// ===================================================================================
// Skip Sheet
// ==========
public void test_DfXlsDataHandlerImpl_setSkipSheet_SyntaxError() {
// ## Arrange ##
final DfXlsDataHandlerImpl impl = createHandler();
// ## Act & Assert ##
try {
impl.setSkipSheet("MST.*+`*`+*P*`+*}+");
fail();
} catch (IllegalStateException e) {
// OK
log(e.getMessage());
assertNotNull(e.getCause());
log(e.getCause().getMessage());
assertTrue(e.getCause() instanceof PatternSyntaxException);
}
}
Aggregations