Parser p = new Parser(sess);
sess.getValueRegistry().add("foo");
Prepared prep = p.parseOnly("SELECT x1.id FROM \"Log\" x1 JOIN \"PERSON\" x0 ON x1.\"parent\" = x0.\"id\" WHERE (x0.\"owner\" = ?)");
Select s = (Select) prep;
assertEquals(2, s.getFilters().size());
TableFilter tf0 = s.getFilters().get(0);
TableFilter tf1 = s.getFilters().get(1);
assertTrue(tf0.getJoin() == tf1);
// assertTrue(s != null);
// ExpressionColumn ec = (ExpressionColumn) s.getExpressions().get(0);
//
// assertEquals("ID", ec.getSQL(new ArrayList()));
//
// assertEquals(1, s.getFilters().size());
// TableFilter tf = s.getFilters().get(0);
// assertTrue(tf != null);
// assertEquals("PERSON", tf.getTable().getName());
// assertEquals("X1", tf.getAlias());
//
// Comparison c = (Comparison) s.getCondition();
// test output
List outArgs = new ArrayList();
String outSql = s.getSQL(outArgs);
assertEquals("SELECT X1.ID\nFROM Log X1\nINNER JOIN PERSON X0 ON X1.parent = X0.id\nWHERE (X0.owner = ?)", outSql);
assertEquals("foo", outArgs.get(0));
}