use of mondrian.olap.fun.CustomizedFunctionTable in project mondrian by pentaho.
the class CustomizedParserTest method testMultipleMultiplication.
public void testMultipleMultiplication() {
Set<String> functionNameSet = new HashSet<String>();
functionNameSet.add("*");
CustomizedFunctionTable cftab = getCustomizedFunctionTable(functionNameSet);
try {
Query q = getParsedQueryForExpr(cftab, "([Measures].[Store Cost] * [Measures].[Unit Sales] * [Measures].[Store Sales])");
q.resolve(q.createValidator(cftab, true));
} catch (Throwable e) {
fail(e.getMessage());
}
}
use of mondrian.olap.fun.CustomizedFunctionTable in project mondrian by pentaho.
the class CustomizedParserTest method testLiterals.
public void testLiterals() {
Set<String> functionNameSet = new HashSet<String>();
functionNameSet.add("+");
CustomizedFunctionTable cftab = getCustomizedFunctionTable(functionNameSet);
try {
Query q = getParsedQueryForExpr(cftab, "([Measures].[Store Cost] + 10)");
q.resolve(q.createValidator(cftab, true));
} catch (Throwable e) {
fail(e.getMessage());
}
}
use of mondrian.olap.fun.CustomizedFunctionTable in project mondrian by pentaho.
the class CustomizedParserTest method testMeasureSlicerFail.
public void testMeasureSlicerFail() {
Set<String> functionNameSet = new HashSet<String>();
functionNameSet.add("+");
functionNameSet.add("-");
functionNameSet.add("*");
functionNameSet.add("/");
CustomizedFunctionTable cftab = getCustomizedFunctionTable(functionNameSet);
try {
Query q = getParsedQueryForExpr(cftab, "([Measures].[Store Cost], [Gender].[F])");
q.resolve(q.createValidator(cftab, true));
// Shouldn't reach here
fail("Expected error did not occur.");
} catch (Throwable e) {
checkErrorMsg(e, "Mondrian Error:No function matches signature '(<Member>, <Member>)'");
}
}
use of mondrian.olap.fun.CustomizedFunctionTable in project mondrian by pentaho.
the class CustomizedParserTest method testAddition.
public void testAddition() {
Set<String> functionNameSet = new HashSet<String>();
functionNameSet.add("+");
CustomizedFunctionTable cftab = getCustomizedFunctionTable(functionNameSet);
try {
Query q = getParsedQueryForExpr(cftab, "([Measures].[Store Cost] + [Measures].[Unit Sales])");
q.resolve(q.createValidator(cftab, true));
} catch (Throwable e) {
fail(e.getMessage());
}
}
use of mondrian.olap.fun.CustomizedFunctionTable in project mondrian by pentaho.
the class CustomizedParserTest method testMixingAttributesFail.
public void testMixingAttributesFail() {
Set<String> functionNameSet = new HashSet<String>();
functionNameSet.add("+");
CustomizedFunctionTable cftab = getCustomizedFunctionTable(functionNameSet);
try {
Query q = getParsedQueryForExpr(cftab, "([Measures].[Store Cost] + [Store].[Store Country])");
q.resolve(q.createValidator(cftab, true));
// Shouldn't reach here
fail("Expected error did not occur.");
} catch (Throwable e) {
checkErrorMsg(e, "Mondrian Error:No function matches signature '<Member> + <Level>'");
}
}
Aggregations