String query = "SELECT testName, inputURL, outputURL " + "FROM {} mf:name {testName}; "
+ " mf:result {outputURL}; " + " mf:action {} qt:data {inputURL} "
+ "USING NAMESPACE " + " mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
+ " qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";
TupleResult queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
// Add all positive parser tests to the test suite
while (queryResult.hasNext()) {
BindingSet bindingSet = queryResult.next();
String testName = bindingSet.getValue("testName").toString();
String inputURL = bindingSet.getValue("inputURL").toString();
String outputURL = bindingSet.getValue("outputURL").toString();
String baseURL = BASE_URL + testName + ".ttl";
suite.addTest(new PositiveParserTest(testName, inputURL, outputURL, baseURL));
}
queryResult.close();
// Add the manifest for negative test cases to a repository and query it
con.clear();
url = TriGParserTestCase.class.getResource(MANIFEST_BAD_URL);
con.add(url, base(url.toExternalForm()), RDFFormat.TURTLE);
query = "SELECT testName, inputURL " + "FROM {} mf:name {testName}; "
+ " mf:action {} qt:data {inputURL} " + "USING NAMESPACE "
+ " mf = <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#>, "
+ " qt = <http://www.w3.org/2001/sw/DataAccess/tests/test-query#>";
queryResult = con.prepareTupleQuery(QueryLanguage.SERQL, query).evaluate();
// Add all negative parser tests to the test suite
while (queryResult.hasNext()) {
BindingSet bindingSet = queryResult.next();
String testName = bindingSet.getValue("testName").toString();
String inputURL = bindingSet.getValue("inputURL").toString();
String baseURL = BASE_URL + testName + ".ttl";
suite.addTest(new NegativeParserTest(testName, inputURL, baseURL));
}
queryResult.close();
con.close();
repository.shutDown();
return suite;
}