Search in sources :

Example 1 with NodeValueNode

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

the class ExprFactoryTest method asExprTest_URInode.

@Test
public void asExprTest_URInode() {
    Expr e = factory.asExpr(NodeFactory.createURI("http://example.com/foo"));
    assertTrue(e instanceof NodeValueNode);
    NodeValueNode n = (NodeValueNode) e;
    assertEquals("http://example.com/foo", n.asNode().getURI());
}
Also used : Expr(org.apache.jena.sparql.expr.Expr) NodeValueNode(org.apache.jena.sparql.expr.nodevalue.NodeValueNode) Test(org.junit.Test)

Example 2 with NodeValueNode

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

the class NodeValueRewriterTest method visitNodeValueNodeTest.

@Test
public void visitNodeValueNodeTest() {
    NodeValue nv = new NodeValueNode(Node.ANY);
    nv.visit(rewriter);
    NodeValue result = rewriter.getResult();
    assertEquals(nv, result);
    assertEquals(nv.getClass(), result.getClass());
}
Also used : NodeValue(org.apache.jena.sparql.expr.NodeValue) NodeValueNode(org.apache.jena.sparql.expr.nodevalue.NodeValueNode) Test(org.junit.Test)

Aggregations

NodeValueNode (org.apache.jena.sparql.expr.nodevalue.NodeValueNode)2 Test (org.junit.Test)2 Expr (org.apache.jena.sparql.expr.Expr)1 NodeValue (org.apache.jena.sparql.expr.NodeValue)1