String expectedGroupResult = "";
if (successTestCases[i].length == 3) {
expectedGroupResult = successTestCases[i][2];
}
ExpressionEvaluator evaluator = new ExpressionEvaluator();
evaluator.setTestMode(true); // to prevent actual query from happening
for (String expression : inputExpressions.split(";")) {
try {
evaluator.addExpression(expression); // do not trim, evaluator must handle sloppy expressions
} catch (Exception e) {
e.printStackTrace(System.out);
assert false : "Error in TestCase[" + i + "], could not add expression[" + expression
+ "], input[" + inputExpressions + "]";
}
}
evaluator.execute(); // execute will compute the JPQL statements
String actualTopResult = evaluator.getComputedJPQLStatement();
String actualGroupResult = evaluator.getComputedJPQLGroupStatement();
expectedTopResult = cleanUp(expectedTopResult);
actualTopResult = cleanUp(actualTopResult);
expectedGroupResult = cleanUp(expectedGroupResult);
actualGroupResult = cleanUp(actualGroupResult);