Search in sources :

Example 6 with ResultSetRewindable

use of org.apache.jena.query.ResultSetRewindable in project jena by apache.

the class TestResultSetThrift method resultSet_02.

@Test
public void resultSet_02() {
    ResultSetRewindable r1 = test(rs1);
    // not reordered
    r1.reset();
    rs2.reset();
    assertFalse(ResultSetCompare.equalsByTermAndOrder(r1, rs2));
    rs2.reset();
}
Also used : ResultSetRewindable(org.apache.jena.query.ResultSetRewindable) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 7 with ResultSetRewindable

use of org.apache.jena.query.ResultSetRewindable in project jena by apache.

the class TestResultSetThrift method resultSet_03.

@Test
public void resultSet_03() {
    ResultSetRewindable r2 = test(rs2);
    // not reordered
    r2.reset();
    rs1.reset();
    assertFalse(ResultSetCompare.equalsByTermAndOrder(r2, rs1));
    rs1.reset();
}
Also used : ResultSetRewindable(org.apache.jena.query.ResultSetRewindable) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 8 with ResultSetRewindable

use of org.apache.jena.query.ResultSetRewindable in project jena by apache.

the class TestResultSetThrift method make.

private static ResultSetRewindable make(String... strings) {
    String s = StrUtils.strjoinNL(strings);
    Item item = SSE.parse(s);
    ResultSetRewindable rs = ResultSetFactory.makeRewindable(BuilderResultSet.build(item));
    return rs;
}
Also used : Item(org.apache.jena.sparql.sse.Item) ResultSetRewindable(org.apache.jena.query.ResultSetRewindable)

Example 9 with ResultSetRewindable

use of org.apache.jena.query.ResultSetRewindable in project jena by apache.

the class TestResultSet method test_RS_2_str.

@Test
public void test_RS_2_str() {
    ResultSetRewindable rs1 = makeRewindable("x", org.apache.jena.graph.NodeFactory.createURI("tag:local"));
    String x = ResultSetFormatter.asXMLString(rs1);
    rs1.reset();
    ResultSet rs2 = ResultSetFactory.fromXML(x);
    assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
}
Also used : BuilderResultSet(org.apache.jena.sparql.sse.builders.BuilderResultSet) ResultSet(org.apache.jena.query.ResultSet) ResultSetRewindable(org.apache.jena.query.ResultSetRewindable) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 10 with ResultSetRewindable

use of org.apache.jena.query.ResultSetRewindable in project jena by apache.

the class TestResultSet method test_RS_cmp_5.

@Test
public void test_RS_cmp_5() {
    // Same variable, different values
    ResultSetRewindable rs1 = makeRewindable("x", org.apache.jena.graph.NodeFactory.createURI("tag:local:1"));
    ResultSetRewindable rs2 = makeRewindable("x", org.apache.jena.graph.NodeFactory.createURI("tag:local:2"));
    assertFalse(ResultSetCompare.equalsByTerm(rs1, rs2));
    rs1.reset();
    rs2.reset();
    assertFalse(ResultSetCompare.equalsByTerm(rs1, rs2));
}
Also used : ResultSetRewindable(org.apache.jena.query.ResultSetRewindable) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Aggregations

ResultSetRewindable (org.apache.jena.query.ResultSetRewindable)32 Test (org.junit.Test)18 BaseTest (org.apache.jena.atlas.junit.BaseTest)17 ResultSet (org.apache.jena.query.ResultSet)11 BuilderResultSet (org.apache.jena.sparql.sse.builders.BuilderResultSet)11 ByteArrayInputStream (java.io.ByteArrayInputStream)7 ByteArrayOutputStream (java.io.ByteArrayOutputStream)7 QuerySolution (org.apache.jena.query.QuerySolution)5 Extractor (infoeval.main.WikiData.Extractor)3 RDFNode (org.apache.jena.rdf.model.RDFNode)3 Model (org.apache.jena.rdf.model.Model)2 SqlTablesFiller (infoeval.main.WikiData.SqlTablesFiller)1 Date (java.sql.Date)1 ArrayList (java.util.ArrayList)1 Item (org.apache.jena.sparql.sse.Item)1 Ignore (org.junit.Ignore)1