use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class TestFunctions2 method test.
private static void test(String string, String result) {
Expr expr = ExprUtils.parse(string, pmap);
NodeValue nv = expr.eval(null, new FunctionEnvBase());
Node r = NodeFactoryExtra.parseNode(result);
NodeValue nvr = NodeValue.makeNode(r);
assertTrue("Not same value: Expected: " + nvr + " : Actual = " + nv, NodeValue.sameAs(nvr, nv));
// test result must be lexical form exact.
assertEquals(r, nv.asNode());
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class TestExpressions method testEval.
private static void testEval(String string) {
Expr expr = parse(string);
NodeValue v = expr.eval(BindingFactory.binding(), new FunctionEnvBase());
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class TestExpressions method testNumeric.
private static void testNumeric(String string, BigInteger integer) {
Expr expr = parse(string);
NodeValue v = expr.eval(BindingFactory.binding(), new FunctionEnvBase());
assertTrue(v.isInteger());
assertEquals(integer, v.getInteger());
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class TestExpressions method testNumeric.
private static void testNumeric(String string, BigDecimal decimal) {
Expr expr = parse(string);
NodeValue v = expr.eval(BindingFactory.binding(), new FunctionEnvBase());
assertTrue(v.isDecimal());
assertEquals(decimal, v.getDecimal());
}
use of org.apache.jena.sparql.function.FunctionEnvBase in project jena by apache.
the class TestExpressions method testURI.
private static void testURI(String string, String uri) {
Expr expr = parse(string);
NodeValue v = expr.eval(env, new FunctionEnvBase());
assertTrue(v.isIRI());
assertEquals(uri, v.getNode().getURI());
}
Aggregations