Search in sources :

Example 1 with IfCommentUnsupportedExpressionException

use of org.dbflute.twowaysql.exception.IfCommentUnsupportedExpressionException 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());
    }
}
Also used : IfCommentUnsupportedExpressionException(org.dbflute.twowaysql.exception.IfCommentUnsupportedExpressionException) DfOutsideSqlChecker(org.dbflute.logic.outsidesqltest.DfOutsideSqlChecker)

Aggregations

DfOutsideSqlChecker (org.dbflute.logic.outsidesqltest.DfOutsideSqlChecker)1 IfCommentUnsupportedExpressionException (org.dbflute.twowaysql.exception.IfCommentUnsupportedExpressionException)1