ARTEMIS-568 Catch broken JMS selector expressions

Enforce an EOF on the expression so the selector parser keeps going and
catches the broken selector statement.
This commit is contained in:
Timothy Bish 2016-06-14 19:05:27 -04:00
parent 369f2e0063
commit 5c29cc9a28
3 changed files with 4 additions and 2 deletions

View File

@ -142,7 +142,7 @@ BooleanExpression JmsSelector() :
}
{
(
left = orExpression()
left = orExpression() <EOF>
)
{
return asBooleanExpression(left);

View File

@ -142,7 +142,7 @@ BooleanExpression JmsSelector() :
}
{
(
left = orExpression()
left = orExpression() <EOF>
)
{
return asBooleanExpression(left);

View File

@ -470,6 +470,8 @@ public class SelectorTest {
assertInvalidSelector(message, "3+5");
assertInvalidSelector(message, "True AND 3+5");
assertInvalidSelector(message, "=TEST 'test'");
assertInvalidSelector(message, "prop1 = prop2 foo AND string = 'Test'");
assertInvalidSelector(message, "a = 1 AMD b = 2");
}
protected MockMessage createMessage() {