use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_4.
@Test
public void test_RS_4() {
ResultSetRewindable rs1 = makeRewindable("x", org.apache.jena.graph.NodeFactory.createURI("tag:local"));
Model model = RDFOutput.encodeAsModel(rs1);
rs1.reset();
ResultSetRewindable rs2 = ResultSetFactory.makeRewindable(RDFInput.fromRDF(model));
boolean b = ResultSetCompare.equalsByTerm(rs1, rs2);
if (!b) {
rs1.reset();
rs2.reset();
ResultSetFormatter.out(rs1);
ResultSetFormatter.out(rs2);
}
assertTrue(b);
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_2.
@Test
public void test_RS_2() {
ResultSetRewindable rs1 = makeRewindable("x", org.apache.jena.graph.NodeFactory.createURI("tag:local"));
ByteArrayOutputStream arr = new ByteArrayOutputStream();
ResultSetFormatter.outputAsXML(arr, rs1);
rs1.reset();
ByteArrayInputStream ins = new ByteArrayInputStream(arr.toByteArray());
ResultSet rs2 = ResultSetFactory.fromXML(ins);
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method isotest.
private void isotest(String[] rs1$2, String[] rs2$2) {
ResultSetRewindable rs1 = ResultSetFactory.makeRewindable(BuilderResultSet.build(SSE.parseItem(StrUtils.strjoinNL(rs1$))));
ResultSetRewindable rs2 = ResultSetFactory.makeRewindable(BuilderResultSet.build(SSE.parseItem(StrUtils.strjoinNL(rs2$))));
assertTrue(ResultSetCompare.isomorphic(rs1, rs2));
rs1.reset();
rs2.reset();
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
assertTrue(ResultSetCompare.equalsByValue(rs1, rs2));
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_cmp_value_1.
// Value based
@Test
public void test_RS_cmp_value_1() {
ResultSetRewindable rs1 = makeRewindable("x", NodeFactoryExtra.parseNode("123"));
ResultSetRewindable rs2 = makeRewindable("x", NodeFactoryExtra.parseNode("0123"));
assertFalse(ResultSetCompare.equalsByTerm(rs1, rs2));
assertTrue(ResultSetCompare.equalsByValue(rs1, rs2));
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_3.
// RDF
@Test
public void test_RS_3() {
ResultSetRewindable rs1 = new ResultSetMem();
Model model = RDFOutput.encodeAsModel(rs1);
rs1.reset();
ResultSet rs2 = RDFInput.fromRDF(model);
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
}
Aggregations