#831 - EQL query language parser needs to throw exception on invalid query ... "find ..." - tests

This commit is contained in:
Rob Bygrave
2016-10-14 21:07:31 +13:00
parent 504a209a78
commit d6cd41f8d2
@@ -15,6 +15,12 @@ import static org.assertj.core.api.Assertions.assertThat;
public class EqlParserTest extends BaseTestCase {
@Test(expected = IllegalArgumentException.class)
public void illegal_syntax() throws Exception {
parse("find Article where name = :p0");
}
@Test
public void where_eq() throws Exception {
@@ -52,6 +58,11 @@ public class EqlParserTest extends BaseTestCase {
assertThat(query.getGeneratedSql()).contains("where t0.name = ?");
}
@Test(expected = IllegalArgumentException.class)
public void where_namedParam_otherOrder() {
parse("where :name < plannedEnd");
}
@Test
public void where_namedParam_startsWith() throws Exception {