use of org.dbflute.twowaysql.exception.IfCommentNotFoundPropertyException in project dbflute-core by dbflute.
the class BeginNodeTest method test_parse_BEGIN_IF_notFoundProperty_with_likeSearch.
public void test_parse_BEGIN_IF_notFoundProperty_with_likeSearch() {
// ## Arrange ##
String sql = "/*BEGIN*/where";
sql = sql + " /*IF pmb.wrongMemberId != null*/member.MEMBER_ID = /*pmb.memberId*/3/*END*/";
sql = sql + " /*IF pmb.memberName != null*/and member.MEMBER_NAME like /*pmb.memberName*/'foo%'/*END*/";
sql = sql + "/*END*/";
SqlAnalyzer analyzer = new SqlAnalyzer(sql, false);
// ## Act ##
try {
MockLikeSearchMemberPmb pmb = new MockLikeSearchMemberPmb();
Node rootNode = analyzer.analyze();
CommandContext ctx = createCtx(pmb);
rootNode.accept(ctx);
// ## Assert ##
fail();
} catch (IfCommentNotFoundPropertyException e) {
// OK
log(e.getMessage());
}
}
use of org.dbflute.twowaysql.exception.IfCommentNotFoundPropertyException in project dbflute-core by dbflute.
the class BeginNodeTest method test_parse_BEGIN_IF_notFoundProperty_basic.
// ===================================================================================
// NotFound Property
// =================
public void test_parse_BEGIN_IF_notFoundProperty_basic() {
// ## Arrange ##
String sql = "/*BEGIN*/where";
sql = sql + " /*IF pmb.wrongMemberId != null*/member.MEMBER_ID = 3/*END*/";
sql = sql + " /*IF pmb.memberName != null*/and member.MEMBER_NAME = 'foo'/*END*/";
sql = sql + "/*END*/";
SqlAnalyzer analyzer = new SqlAnalyzer(sql, false);
// ## Act ##
try {
MockMemberPmb pmb = new MockMemberPmb();
pmb.setMemberName("foo");
Node rootNode = analyzer.analyze();
CommandContext ctx = createCtx(pmb);
rootNode.accept(ctx);
// ## Assert ##
fail();
} catch (IfCommentNotFoundPropertyException e) {
// OK
log(e.getMessage());
}
}
use of org.dbflute.twowaysql.exception.IfCommentNotFoundPropertyException in project dbflute-core by dbflute.
the class BeginNodeTest method test_parse_BEGIN_IF_notFoundProperty_with_parameterMap.
public void test_parse_BEGIN_IF_notFoundProperty_with_parameterMap() {
// ## Arrange ##
String sql = "/*BEGIN*/where";
sql = sql + " /*IF pmb.wrongMemberId != null*/member.MEMBER_ID = /*pmb.memberId*/3/*END*/";
sql = sql + " /*IF pmb.memberName != null*/and member.MEMBER_NAME like /*pmb.memberName*/'foo%'/*END*/";
sql = sql + "/*END*/";
SqlAnalyzer analyzer = new SqlAnalyzer(sql, false);
// ## Act ##
try {
MockPagingMemberPmb pmb = new MockPagingMemberPmb();
Node rootNode = analyzer.analyze();
CommandContext ctx = createCtx(pmb);
rootNode.accept(ctx);
// ## Assert ##
fail();
} catch (IfCommentNotFoundPropertyException e) {
// OK
log(e.getMessage());
}
}
Aggregations