TupleExpression { public abstract void verify(); protected  TupleExpression(ExpressionOperatorEnum op, List<TupleExpression> exprs); boolean ifForDynamicColumn(); abstract void verify(); abstract Object calculate(IEvaluatableTuple tuple, IFilterCodeSystem<?> cs); abstract TupleExpression accept(ExpressionVisitor visitor); abstract void serialize(IFilterCodeSystem<?> cs, ByteBuffer buffer); abstract void deserialize(IFilterCodeSystem<?> cs, ByteBuffer buffer); ExpressionOperatorEnum getOperator(); void setDigest(String digest); String getDigest(); boolean hasChildren(); List<? extends TupleExpression> getChildren(); void addChild(TupleExpression child);  }
@Test public void testBinary() { BigDecimal value1 = BigDecimal.valueOf(10L); BigDecimal value2 = BigDecimal.valueOf(10L); TblColRef col1 = TblColRef.mockup(t, 1, "C1", "decimal"); TblColRef col2 = TblColRef.mockup(t, 2, "C2", "decimal"); NumberTupleExpression constTuple1 = new NumberTupleExpression(value1); NumberTupleExpression constTuple2 = new NumberTupleExpression(value2); ColumnTupleExpression colTuple1 = new ColumnTupleExpression(col1); ColumnTupleExpression colTuple2 = new ColumnTupleExpression(col2); BinaryTupleExpression biTuple1 = new BinaryTupleExpression(TupleExpression.ExpressionOperatorEnum.MULTIPLE, Lists.newArrayList(constTuple1, colTuple1)); biTuple1.verify(); BinaryTupleExpression biTuple2 = new BinaryTupleExpression(TupleExpression.ExpressionOperatorEnum.DIVIDE, Lists.newArrayList(constTuple2, colTuple2)); try { biTuple2.verify(); fail("QueryOnCubeException should be thrown，That the right side of the BinaryTupleExpression owns columns is not supported for /"); } catch (QueryOnCubeException e) { } biTuple2 = new BinaryTupleExpression(TupleExpression.ExpressionOperatorEnum.DIVIDE, Lists.newArrayList(colTuple2, constTuple2)); biTuple2.verify(); BinaryTupleExpression biTuple = new BinaryTupleExpression(TupleExpression.ExpressionOperatorEnum.MULTIPLE, Lists.<TupleExpression> newArrayList(biTuple1, biTuple2)); try { biTuple.verify(); fail("QueryOnCubeException should be thrown，That both of the two sides of the BinaryTupleExpression own columns is not supported for *"); } catch (QueryOnCubeException e) { } }