use of mondrian.calc.DummyExp in project mondrian by pentaho.
the class NumberSqlCompilerTest method testRejectsNonLiteral.
public void testRejectsNonLiteral() {
Exp exp = new DummyExp(new NullType());
assertNull(compiler.compile(exp));
}
use of mondrian.calc.DummyExp 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));
}