Search in sources :

Example 1 with NodeValueBoolean

use of org.apache.jena.sparql.expr.nodevalue.NodeValueBoolean in project jena by apache.

the class TestFunctionExpansion method test_function_expansion_01.

@Test
public void test_function_expansion_01() {
    Expr e = new ExprVar("x");
    UserDefinedFunctionFactory.getFactory().add("http://example/simple", e, new ArrayList<>(e.getVarsMentioned()));
    UserDefinedFunction f = (UserDefinedFunction) UserDefinedFunctionFactory.getFactory().create("http://example/simple");
    f.build("http://example/simple", new ExprList(new NodeValueBoolean(true)));
    Expr actual = f.getActualExpr();
    Assert.assertFalse(e.equals(actual));
    Assert.assertEquals(0, actual.getVarsMentioned().size());
    Assert.assertEquals(new NodeValueBoolean(true), actual);
}
Also used : NodeValueBoolean(org.apache.jena.sparql.expr.nodevalue.NodeValueBoolean) UserDefinedFunction(org.apache.jena.sparql.function.user.UserDefinedFunction) Test(org.junit.Test)

Aggregations

NodeValueBoolean (org.apache.jena.sparql.expr.nodevalue.NodeValueBoolean)1 UserDefinedFunction (org.apache.jena.sparql.function.user.UserDefinedFunction)1 Test (org.junit.Test)1