use of org.dbflute.logic.replaceschema.finalinfo.DfTakeFinallyFinalInfo in project dbflute-core by dbflute.
the class DfAlterCheckProcess method takeFinally.
// -----------------------------------------------------
// Take Finally
// ------------
protected void takeFinally(DfAlterCheckFinalInfo finalInfo) {
// alter-take-finally.sql for assertion
final String sqlRootDir = getMigrationAlterDirectory();
final DfTakeFinallyProcess process = DfTakeFinallyProcess.createAsAlterSchema(sqlRootDir, _dataSource);
final DfTakeFinallyFinalInfo takeFinally = process.execute();
finalInfo.addAlterSqlFileAll(takeFinally.getTakeFinallySqlFileList());
reflectTakeFinallyResultToFinalInfo(finalInfo, takeFinally);
}
use of org.dbflute.logic.replaceschema.finalinfo.DfTakeFinallyFinalInfo in project dbflute-core by dbflute.
the class DfTakeFinallyProcess method execute.
// ===================================================================================
// Execute
// =======
public DfTakeFinallyFinalInfo execute() {
final long before = System.currentTimeMillis();
final DfRunnerInformation runInfo = createRunnerInformation();
DfSqlFileFireResult fireResult = null;
DfTakeFinallyAssertionFailureException assertionEx = null;
try {
fireResult = takeFinally(runInfo);
if (_continueIfAssetionFailure && !_continuedExList.isEmpty()) {
// override result with saved exceptions
// this message uses the first exception
fireResult = createFailureFireResult(_continuedExList.get(0), fireResult);
}
} catch (DfTakeFinallyAssertionFailureException e) {
// if take-assert, the exception does not thrown
fireResult = createFailureFireResult(e, null);
assertionEx = e;
}
final DfTakeFinallyFinalInfo finalInfo = createFinalInfo(fireResult, assertionEx);
if (!finalInfo.isFailure()) {
// because it might fail to create sequence
incrementSequenceToDataMax();
}
final long after = System.currentTimeMillis();
final long processPerformanceMillis = after - before;
finalInfo.setProcessPerformanceMillis(processPerformanceMillis);
return finalInfo;
}
use of org.dbflute.logic.replaceschema.finalinfo.DfTakeFinallyFinalInfo in project dbflute-core by dbflute.
the class DfTakeFinallyProcess method createFinalInfo.
// ===================================================================================
// Final Info
// ==========
protected DfTakeFinallyFinalInfo createFinalInfo(DfSqlFileFireResult fireResult, DfTakeFinallyAssertionFailureException assertionEx) {
final DfTakeFinallyFinalInfo finalInfo = new DfTakeFinallyFinalInfo();
finalInfo.addTakeFinallySqlFileAll(_executedSqlFileList);
if (fireResult != null) {
finalInfo.setResultMessage(fireResult.getResultMessage());
final List<String> detailMessageList = extractDetailMessageList(fireResult);
for (String detailMessage : detailMessageList) {
finalInfo.addDetailMessage(detailMessage);
}
finalInfo.setBreakCause(fireResult.getBreakCause());
finalInfo.setFailure(fireResult.isExistsError());
}
finalInfo.setAssertionEx(assertionEx);
// finalInfo.setProcessPerformanceMillis(processPerformanceMillis);
return finalInfo;
}
use of org.dbflute.logic.replaceschema.finalinfo.DfTakeFinallyFinalInfo in project dbflute-core by dbflute.
the class DfAlterCheckProcess method takeFinally.
// -----------------------------------------------------
// Take Finally
// ------------
protected void takeFinally(DfAlterCheckFinalInfo finalInfo) {
// alter-take-finally.sql for assertion
final String sqlRootDir = getMigrationAlterDirectory();
final DfTakeFinallyProcess process = DfTakeFinallyProcess.createAsAlterSchema(sqlRootDir, _dataSource);
final DfTakeFinallyFinalInfo takeFinally = process.execute();
finalInfo.addAlterSqlFileAll(takeFinally.getTakeFinallySqlFileList());
reflectTakeFinallyResultToFinalInfo(finalInfo, takeFinally);
}
use of org.dbflute.logic.replaceschema.finalinfo.DfTakeFinallyFinalInfo in project dbflute-core by dbflute.
the class DfTakeAssertTask method buildFinalMessage.
protected String buildFinalMessage() {
// might be null
final DfTakeFinallyFinalInfo finalInfo = _finalInfo;
final List<DfTakeFinallyAssertionFailureException> takeAssertExList = _takeAssertExList;
final StringBuilder sb = new StringBuilder();
if (finalInfo != null) {
if (finalInfo.isValidInfo()) {
buildSchemaTaskContents(sb, finalInfo);
}
if (takeAssertExList != null && !takeAssertExList.isEmpty()) {
sb.append(ln()).append(" * * * * * * * * * * *");
sb.append(ln()).append(" * Assertion Failure *");
sb.append(ln()).append(" * * * * * * * * * * *");
}
}
return sb.toString();
}
Aggregations