use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class TestExpressions method testString.
private static void testString(String string) {
Expr expr = parse(string);
NodeValue v = expr.eval(env, new FunctionEnvBase());
assertTrue(v.isString());
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class LibTestExpr method eval.
static NodeValue eval(String exprString) {
Expr expr = ExprUtils.parse(exprString, pmap);
NodeValue result = expr.eval(null, new FunctionEnvBase());
return result;
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class LibTestExpr method test.
static void test(String exprString, Node result) {
Expr expr = ExprUtils.parse(exprString, pmap);
NodeValue actual = expr.eval(null, new FunctionEnvBase());
NodeValue expected = NodeValue.makeNode(result);
assertTrue("Expected = " + expected + " : Actual = " + actual, NodeValue.sameAs(expected, actual));
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class LibTestExpr method testDouble.
static void testDouble(String exprString, Node result, double delta) {
Expr expr = ExprUtils.parse(exprString, pmap);
NodeValue actual = expr.eval(null, new FunctionEnvBase());
NodeValue expected = NodeValue.makeNode(result);
// between how things like doubles are expressed
if (NodeValue.sameAs(expected, actual))
return;
testDouble(exprString, expected.getDouble(), delta);
;
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class LibTestExpr method testError.
static void testError(String exprString) {
Expr expr = ExprUtils.parse(exprString, pmap);
expr.eval(null, new FunctionEnvBase());
}
Aggregations