Skip to content

Commit

Permalink
Correct tests for sparkqljenaengine
Browse files Browse the repository at this point in the history
  • Loading branch information
Reamer committed Oct 28, 2024
1 parent 773eecc commit ef181d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.http.HttpStatus;

import org.apache.jena.atlas.web.HttpException;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryParseException;
import org.apache.jena.query.ResultSet;
Expand Down Expand Up @@ -84,7 +85,7 @@ public InterpreterResult query(String query) {
InterpreterResult.Code.SUCCESS,
InterpreterResult.Type.TABLE,
tsv);
} catch (QueryParseException e) {
} catch (QueryParseException | HttpException e) {
LOGGER.error(e.toString());
return new InterpreterResult(
InterpreterResult.Code.ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ void testSuccessfulRawQuery() {
assertEquals(Code.SUCCESS, result.code());

final String expected = "?subject\t?predicate\t?object\n" +
"<http://example.org/#green-goblin>\t<http://xmlns.com/foaf/0.1/name>\t\"Green Goblin\"\n" +
"<http://example.org/#green-goblin>\t<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>" +
"\t<http://xmlns.com/foaf/0.1/Person>\n<http://example.org/#green-goblin>\t" +
"<http://www.perceive.net/schemas/relationship/enemyOf>\t<http://example.org/#spiderman>\n" +
"<http://example.org/#spiderman>\t<http://xmlns.com/foaf/0.1/name>" +
"\t\"Человек-паук\"@ru\n<http://example.org/#spiderman>\t" +
"<http://xmlns.com/foaf/0.1/name>\t\"Spiderman\"\n" +
Expand All @@ -116,12 +120,7 @@ void testSuccessfulRawQuery() {
"<http://www.perceive.net/schemas/relationship/enemyOf>\t" +
"<http://example.org/#green-goblin>\n<http://example.org/#spiderman>\t" +
"<http://example.org/stats#born>\t\"1962-10-15T14:00.00\"^^" +
"<http://www.w3.org/2001/XMLSchema#dateTime>\n<http://example.org/#green-goblin>\t" +
"<http://xmlns.com/foaf/0.1/name>\t\"Green Goblin\"\n" +
"<http://example.org/#green-goblin>\t" +
"<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>" +
"\t<http://xmlns.com/foaf/0.1/Person>\n<http://example.org/#green-goblin>\t" +
"<http://www.perceive.net/schemas/relationship/enemyOf>\t<http://example.org/#spiderman>\n";
"<http://www.w3.org/2001/XMLSchema#dateTime>\n";
assertEquals(expected, result.message().get(0).getData());
}

Expand All @@ -141,19 +140,19 @@ void testSuccessfulReplaceRemoveQuery() {
assertEquals(Code.SUCCESS, result.code());

final String expected = "?subject\t?predicate\t?object\n" +
"<http://example.org/#green-goblin>\t<foaf:name>\t\"Green Goblin\"\n" +
"<http://example.org/#green-goblin>\t" +
"<rdf:type>" +
"\t<foaf:Person>\n<http://example.org/#green-goblin>\t" +
"<rel:enemyOf>\t<http://example.org/#spiderman>\n" +
"<http://example.org/#spiderman>\t<foaf:name>" +
"\t\"Человек-паук\"@ru\n<http://example.org/#spiderman>\t" +
"<foaf:name>\t\"Spiderman\"\n" +
"<http://example.org/#spiderman>\t<rdf:type>" +
"\t<foaf:Person>\n<http://example.org/#spiderman>\t" +
"<rel:enemyOf>\t" +
"<http://example.org/#green-goblin>\n<http://example.org/#spiderman>\t" +
"<http://example.org/stats#born>\t1962-10-15T14:00.00\n" +
"<http://example.org/#green-goblin>\t<foaf:name>\t\"Green Goblin\"\n" +
"<http://example.org/#green-goblin>\t" +
"<rdf:type>" +
"\t<foaf:Person>\n<http://example.org/#green-goblin>\t" +
"<rel:enemyOf>\t<http://example.org/#spiderman>\n";
"<http://example.org/stats#born>\t1962-10-15T14:00.00\n";

assertEquals(expected, result.message().get(0).getData());
}
Expand Down

0 comments on commit ef181d8

Please sign in to comment.