use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_1.
// Test reading, writing and comparison
@Test
public void test_RS_1() {
ResultSetRewindable rs1 = new ResultSetMem();
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 TestSolverTDB method same.
private static void same(ResultSet rs1, ResultSet rs2, boolean result) {
ResultSetRewindable rsw1 = ResultSetFactory.makeRewindable(rs1);
ResultSetRewindable rsw2 = ResultSetFactory.makeRewindable(rs2);
boolean b = ResultSetCompare.equalsByValue(rsw1, rsw2);
if (b != result) {
System.out.println("Different: ");
rsw1.reset();
rsw2.reset();
ResultSetFormatter.out(rsw1);
ResultSetFormatter.out(rsw2);
System.out.println();
}
assertTrue(b == result);
}
Aggregations