use of mondrian.olap.Exp in project mondrian by pentaho.
the class SqlConstraintUtilsTest method makeSupportedExpressionForCalculatedMember.
private Exp makeSupportedExpressionForCalculatedMember() {
Exp memberExpr = new MemberExpr(Mockito.mock(Member.class));
Assert.assertEquals(true, SqlConstraintUtils.isSupportedExpressionForCalculatedMember(memberExpr));
return memberExpr;
}
use of mondrian.olap.Exp in project mondrian by pentaho.
the class TopCountNativeEvaluatorTest method testNonNative_WhenTwoParametersArePassed.
/**
* For now, prohibit native evaluation of the function if has two
* parameters. According to the specification, this means
* the function should behave similarly to {@code HEAD} function.
* However, native evaluation joins data with the fact table and if there
* is no data there, then some records are ignored, what is not correct.
*
* @see <a href="http://jira.pentaho.com/browse/MONDRIAN-2394">MONDRIAN-2394</a>
*/
public void testNonNative_WhenTwoParametersArePassed() throws Exception {
RolapNativeTopCount nativeTopCount = createTopCountSpy();
doReturn(true).when(nativeTopCount).isValidContext(any(RolapEvaluator.class));
Exp[] arguments = new Exp[] { new DummyExp(new EmptyType()), Literal.create(BigDecimal.ONE) };
assertNull("Native evaluator should not be created when " + "two parameters are passed", nativeTopCount.createEvaluator(null, mockFunctionDef(), arguments));
}
use of mondrian.olap.Exp in project mondrian by pentaho.
the class NumberSqlCompilerTest method checkAcceptsString.
private void checkAcceptsString(String value) {
Exp exp = Literal.createString(value);
assertNotNull(value, compiler.compile(exp));
}
use of mondrian.olap.Exp in project mondrian by pentaho.
the class NumberSqlCompilerTest method checkRejectsString.
private void checkRejectsString(String value) {
Exp exp = Literal.createString(value);
try {
compiler.compile(exp);
} catch (MondrianEvaluationException e) {
return;
}
fail("Expected to get MondrianEvaluationException for " + value);
}
use of mondrian.olap.Exp in project mondrian by pentaho.
the class NumberSqlCompilerTest method testAcceptsNumeric.
public void testAcceptsNumeric() {
Exp exp = Literal.create(BigDecimal.ONE);
assertNotNull(compiler.compile(exp));
}
Aggregations