use of org.xenei.junit.contract.ContractTest in project jena by apache.
the class GraphContractTest method testContains_Node_Node_Node_ByValue.
@ContractTest
public void testContains_Node_Node_Node_ByValue() {
Node x = node("x");
Node P = node("P");
if (producer.newInstance().getCapabilities().handlesLiteralTyping()) {
Graph g1 = graphWith(producer.newInstance(), "x P '1'xsd:integer");
assertTrue(String.format("literal type equality failed, does %s really implement literal typing", g1.getClass()), g1.contains(x, P, node("'01'xsd:int")));
//
Graph g2 = graphWith(producer.newInstance(), "x P '1'xsd:int");
assertTrue("Literal equality with '1'xsd:integer failed", g2.contains(x, P, node("'1'xsd:integer")));
//
Graph g3 = graphWith(producer.newInstance(), "x P '123'xsd:string");
assertTrue("Literal equality with '123' failed", g3.contains(x, P, node("'123'")));
}
}
use of org.xenei.junit.contract.ContractTest in project jena by apache.
the class GraphMem_CS method testContainsConcreteDoesntUseFind.
@ContractTest
public void testContainsConcreteDoesntUseFind() {
Graph g = new GraphMemWithoutFind();
graphAdd(g, "x P y; a Q b");
assertTrue(g.contains(triple("x P y")));
assertTrue(g.contains(triple("a Q b")));
assertFalse(g.contains(triple("a P y")));
assertFalse(g.contains(triple("y R b")));
}
use of org.xenei.junit.contract.ContractTest in project jena by apache.
the class DatasetClauseTest method testGetDatasetHandler.
@ContractTest
public void testGetDatasetHandler() {
DatasetClause<?> datasetClause = getProducer().newInstance();
DatasetHandler dsHandler = datasetClause.getDatasetHandler();
assertNotNull(dsHandler);
}
use of org.xenei.junit.contract.ContractTest in project jena by apache.
the class PrologClauseTest method testGetPrologHandler.
@ContractTest
public void testGetPrologHandler() {
PrologClause<?> prologClause = getProducer().newInstance();
PrologHandler handler = prologClause.getPrologHandler();
assertNotNull(handler);
}
use of org.xenei.junit.contract.ContractTest in project jena by apache.
the class SelectClauseTest method testAddVarNode.
@ContractTest
public void testAddVarNode() throws Exception {
Var v = Var.alloc("one");
SelectClause<?> selectClause = getProducer().newInstance();
selectClause.addVar("one");
Query query = getQuery(selectClause.addVar(NodeFactory.createVariable("one")));
VarExprList expr = query.getProject();
assertEquals(1, expr.size());
assertTrue(expr.contains(v));
}
Aggregations