use of org.dbflute.exception.CommentTerminatorNotFoundException in project dbflute-core by dbflute.
the class IfNodeTest method test_parse_IF_terminatorNotFound.
// ===================================================================================
// Exception
// =========
public void test_parse_IF_terminatorNotFound() {
// ## Arrange ##
String sql = "where";
sql = sql + " /*IF pmb.memberId*";
sql = sql + " select foo";
SqlAnalyzer analyzer = new SqlAnalyzer(sql, false);
// ## Act ##
try {
analyzer.analyze();
// ## Assert ##
fail();
} catch (CommentTerminatorNotFoundException e) {
// OK
log(e.getMessage());
}
}
use of org.dbflute.exception.CommentTerminatorNotFoundException in project dbflute-core by dbflute.
the class SqlTokenizer method throwCommentTerminatorNotFoundException.
protected void throwCommentTerminatorNotFoundException(String expression) {
final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
br.addNotice("The comment end was NOT found!");
br.addItem("Advice");
br.addElement("Please confirm the SQL comment writing.");
br.addElement("Any comments DOESN'T have a comment end.");
br.addElement("For example:");
br.addElement(" (x) -- /*pmb.xxxId3");
br.addElement(" (o) -- /*pmb.xxxId*/3");
br.addItem("Specified SQL");
br.addElement(expression);
br.addItem("Comment Expression");
br.addElement(_sql);
final String msg = br.buildExceptionMessage();
throw new CommentTerminatorNotFoundException(msg);
}
Aggregations