@Test
public void testExpressionEquality() throws FrontendException {
LogicalExpressionPlan ep1 = new LogicalExpressionPlan();
ConstantExpression c1 = new ConstantExpression(ep1, new Integer(5));
ProjectExpression p1 = new ProjectExpression(ep1, 0, 0, null);
EqualExpression e1 = new EqualExpression(ep1, p1, c1);
ConstantExpression ca1 = new ConstantExpression(ep1, new Boolean("true"));
AndExpression a1 = new AndExpression(ep1, e1, ca1);
LogicalExpressionPlan ep2 = new LogicalExpressionPlan();
ConstantExpression c2 = new ConstantExpression(ep2, new Integer(5));
ProjectExpression p2 = new ProjectExpression(ep2, 0, 0, null);
EqualExpression e2 = new EqualExpression(ep2, p2, c2);
ConstantExpression ca2 = new ConstantExpression(ep2, new Boolean("true"));
AndExpression a2 = new AndExpression(ep2, e2, ca2);
assertTrue(ep1.isEqual(ep2));
assertTrue(c1.isEqual(c2));
assertTrue(p1.isEqual(p2));
assertTrue(e1.isEqual(e2));
assertTrue(ca1.isEqual(ca2));
assertTrue(a1.isEqual(a2));
LogicalExpressionPlan ep3 = new LogicalExpressionPlan();
ConstantExpression c3 = new ConstantExpression(ep3, new Integer(3));
ProjectExpression p3 = new ProjectExpression(ep3, 0, 1, null);
EqualExpression e3 = new EqualExpression(ep3, p3, c3);
ConstantExpression ca3 = new ConstantExpression(ep3, "true");
AndExpression a3 = new AndExpression(ep3, e3, ca3);
assertFalse(ep1.isEqual(ep3));
assertFalse(c1.isEqual(c3));