use of org.dbflute.logic.outsidesqltest.DfOutsideSqlChecker in project dbflute-core by dbflute.
the class OutsideSqlCheckerTest method test_check_ifCommentExpression_unsupported.
public void test_check_ifCommentExpression_unsupported() {
// ## Arrange ##
DfOutsideSqlChecker ker = new DfOutsideSqlChecker();
String fn = "test.sql";
// ## Act & Assert ##
try {
ker.check(fn, "/*IF (pmb.memberId != null && pmb.memberName != null) || pmb.exists*/bar/*END*/");
} catch (IfCommentUnsupportedExpressionException e) {
// OK
log(e.getMessage());
}
try {
ker.check(fn, "/*IF pmb.memberId != null && pmb.memberName != null || pmb.exists*/bar/*END*/");
} catch (IfCommentUnsupportedExpressionException e) {
// OK
log(e.getMessage());
}
try {
ker.check(fn, "/*IF pmb.memberId = null && pmb.memberName != null*/bar/*END*/");
} catch (IfCommentUnsupportedExpressionException e) {
// OK
log(e.getMessage());
}
try {
ker.check(fn, "/*IF pmb.memberId <> null && pmb.memberName != null*/bar/*END*/");
} catch (IfCommentUnsupportedExpressionException e) {
// OK
log(e.getMessage());
}
try {
ker.check(fn, "/*IF pmb.memberName == \"abc\"*/bar/*END*/");
} catch (IfCommentUnsupportedExpressionException e) {
// OK
log(e.getMessage());
}
}
use of org.dbflute.logic.outsidesqltest.DfOutsideSqlChecker in project dbflute-core by dbflute.
the class OutsideSqlCheckerTest method test_check_ifCommentExpression_basic.
public void test_check_ifCommentExpression_basic() {
// ## Arrange ##
DfOutsideSqlChecker ker = new DfOutsideSqlChecker();
String fn = "test.sql";
// ## Act & Assert ##
ker.check(fn, "/*IF pmb.memberId != null && pmb.memberName != null*/bar/*END*/");
ker.check(fn, "/*IF pmb.memberId != null || pmb.memberName != null*/bar/*END*/");
ker.check(fn, "/*IF pmb.getMemberId() != null || pmb.memberName != null*/bar/*END*/");
}
use of org.dbflute.logic.outsidesqltest.DfOutsideSqlChecker in project dbflute-core by dbflute.
the class DfOutsideSqlTestTask method createOutsideSqlChecker.
protected DfOutsideSqlChecker createOutsideSqlChecker(DfOutsideSqlProperties outsideSqlProp) {
final DfOutsideSqlChecker checker = new DfOutsideSqlChecker();
if (outsideSqlProp.isRequiredSqlTitle()) {
checker.enableRequiredTitleCheck();
}
if (outsideSqlProp.isSuppressSqlTitleUniqueCheck()) {
checker.suppressTitleUniqueCheck();
}
if (outsideSqlProp.isRequiredSqlDescription()) {
checker.enableRequiredDescriptionCheck();
}
if (outsideSqlProp.isSuppressSqlDescriptionUniqueCheck()) {
checker.suppressDescriptionUniqueCheck();
}
final DfLanguageImplStyle languageImplStyle = getBasicProperties().getLanguageDependency().getLanguageImplStyle();
if (languageImplStyle.isIfCommentExpressionCheckEnabled()) {
// might be different specification between language
checker.enableIfCommentExpressionCheck();
}
return checker;
}
Aggregations