use of org.apache.cayenne.exp.parser.ASTLocate in project cayenne by apache.
the class FunctionExpressionFactoryTest method locateExp.
@Test
public void locateExp() throws Exception {
Expression exp1 = FunctionExpressionFactory.locateExp("abc", Artist.ARTIST_NAME.getExpression());
Expression exp2 = FunctionExpressionFactory.locateExp("abc", Artist.ARTIST_NAME.getName());
Expression exp3 = FunctionExpressionFactory.locateExp(new ASTScalar("abc"), Artist.ARTIST_NAME.getExpression());
assertTrue(exp1 instanceof ASTLocate);
assertEquals(2, exp1.getOperandCount());
assertEquals("abc", exp1.getOperand(0));
assertEquals(Artist.ARTIST_NAME.getExpression(), exp1.getOperand(1));
assertEquals(exp1, exp2);
assertEquals(exp2, exp3);
}