use of org.dbflute.helper.jdbc.DfRunnerInformation in project dbflute-core by dbflute.
the class DfCraftDiffAssertSqlFire method createRunnerInformation.
// ===================================================================================
// Runner Information
// ==================
protected DfRunnerInformation createRunnerInformation() {
final DfRunnerInformation runInfo = new DfRunnerInformation();
final DfDatabaseProperties prop = getDatabaseProperties();
runInfo.setDriver(prop.getDatabaseDriver());
runInfo.setUrl(prop.getDatabaseUrl());
runInfo.setUser(prop.getDatabaseUser());
runInfo.setPassword(prop.getDatabasePassword());
runInfo.setEncoding(getSqlFileEncoding());
runInfo.setBreakCauseThrow(true);
runInfo.setErrorContinue(false);
runInfo.setAutoCommit(false);
runInfo.setRollbackOnly(true);
runInfo.setSuppressLoggingSql(false);
return runInfo;
}
use of org.dbflute.helper.jdbc.DfRunnerInformation in project dbflute-core by dbflute.
the class DfAlterCheckProcess method executeAlterSql.
// -----------------------------------------------------
// Alter Fire
// ----------
protected void executeAlterSql(DfAlterCheckFinalInfo finalInfo) {
List<File> alterSqlFileList = getMigrationAlterSqlFileList();
if (alterSqlFileList.isEmpty()) {
restoreLatestCheckedAlterSql();
alterSqlFileList = getMigrationAlterSqlFileList();
if (alterSqlFileList.isEmpty()) {
createEmptyAlterSqlFileIfNotExists();
alterSqlFileList = getMigrationAlterSqlFileList();
if (alterSqlFileList.isEmpty()) {
// no way
throwAlterCheckAlterSqlNotFoundException();
}
}
}
final DfRunnerInformation runInfo = createRunnerInformation();
final DfSqlFileFireMan fireMan = createSqlFileFireMan();
fireMan.setExecutorName("Alter Schema");
final DfSqlFileRunner runner = createSqlFileRunner(runInfo);
finalInfo.addAlterSqlFileAll(alterSqlFileList);
try {
final DfSqlFileFireResult result = fireMan.fire(runner, alterSqlFileList);
reflectAlterResultToFinalInfo(finalInfo, result);
} catch (DfTakeFinallyAssertionFailureException e) {
handleTakeFinallyAssertionFailureException(finalInfo, e);
}
}
use of org.dbflute.helper.jdbc.DfRunnerInformation in project dbflute-core by dbflute.
the class DfCraftDiffAssertSqlFire method fire.
// ===================================================================================
// SQL Fire
// ========
/**
* Fire the SQLs for assertion.
* @param tableList The list of table meta, e.g. to auto-generate SQL for table-equals. (NotNull)
*/
public void fire(List<DfTableMeta> tableList) {
final List<File> craftSqlFileList = getCraftSqlFileList();
if (craftSqlFileList.isEmpty()) {
return;
}
final DfRunnerInformation runInfo = createRunnerInformation();
final DfSqlFileFireMan fireMan = new DfSqlFileFireMan();
fireMan.setExecutorName("Craft Diff");
// result file is ignored because of break cause
final DfCraftDiffAssertProvider provider = createAssertProvider(tableList);
fireMan.fire(getSqlFileRunner4CraftDiff(runInfo, provider), craftSqlFileList);
}
use of org.dbflute.helper.jdbc.DfRunnerInformation in project dbflute-core by dbflute.
the class DfOutsideSqlTestTask method doExecute.
// ===================================================================================
// Execute
// =======
@Override
protected void doExecute() {
final DfRunnerInformation runInfo = createRunnerInformation();
final DfSqlFileFireMan fireMan = createSqlFileFireMan();
final List<File> sqlFileList = getTargetSqlFileList();
_fireResult = fireMan.fire(getSqlFileRunner(runInfo), sqlFileList);
handleSqlFileFailure(_fireResult, sqlFileList);
}
use of org.dbflute.helper.jdbc.DfRunnerInformation in project dbflute-core by dbflute.
the class DfOutsideSqlTestTask method createRunnerInformation.
protected DfRunnerInformation createRunnerInformation() {
final DfRunnerInformation runInfo = new DfRunnerInformation();
runInfo.setDriver(getDriver());
runInfo.setUrl(getUrl());
runInfo.setUser(getUser());
runInfo.setPassword(getPassword());
runInfo.setBreakCauseThrow(isBreakCauseThrow());
runInfo.setErrorContinue(isErrorContinue());
runInfo.setAutoCommit(isAutoCommit());
runInfo.setRollbackOnly(isRollbackOnly());
runInfo.setIgnoreTxError(isIgnoreTxError());
customizeRunnerInformation(runInfo);
return runInfo;
}
Aggregations