LessThanExpression lt1 = new LessThanExpression(plan, constant1, constant2);
LessThanEqualExpression lte1 = new LessThanEqualExpression(plan, constant1, constant2);
GreaterThanExpression gt1 = new GreaterThanExpression(plan, constant3, constant4);
GreaterThanEqualExpression gte1 = new GreaterThanEqualExpression(plan, constant3, constant4);
EqualExpression eq1 = new EqualExpression(plan, constant0, constant1);
NotEqualExpression neq1 = new NotEqualExpression(plan, constant0, constant2);
CompilationMessageCollector collector = new CompilationMessageCollector();
TypeCheckingExpVisitor expTypeChecker = new TypeCheckingExpVisitor(
plan, collector, null);
expTypeChecker.visit();
plan.explain(System.out, "text", true);
printMessageCollector(collector);
// printTypeGraph(plan) ;
if (collector.hasError()) {
throw new Exception("Error during type checking");
}
// Induction check
assertEquals(DataType.BOOLEAN, lt1.getType());
assertEquals(DataType.BOOLEAN, lte1.getType());
assertEquals(DataType.BOOLEAN, gt1.getType());
assertEquals(DataType.BOOLEAN, gte1.getType());
assertEquals(DataType.BOOLEAN, eq1.getType());
assertEquals(DataType.BOOLEAN, neq1.getType());
// Cast insertion check
assertEquals(DataType.DATETIME, gt1.getRhs().getType());
assertEquals(DataType.DATETIME, gte1.getRhs().getType());
}