Skip to content

Commit

Permalink
GH-4592 Reenable geosparql junit testing.
Browse files Browse the repository at this point in the history
Allow for non DAWG approved tests to run.
Adds a manifest-all.ttl file for geosparql like sparql 1.1. compliance.

Also remove some unused imports.
Signed-off-by: Jerven Bolleman <[email protected]>
  • Loading branch information
JervenBolleman committed Nov 10, 2023
1 parent 7beed16 commit da3e01e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQLQueryComplianceTest;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;

public abstract class GeoSPARQLManifestTest extends SPARQLQueryComplianceTest {

@TestFactory
public Collection<DynamicTest> tests() {
return getTestData("testcases-geosparql/functions/manifest.ttl");
return getTestData("testcases-geosparql/manifest-all.ttl", false);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix qt: <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .

<> rdf:type mf:Manifest ;
rdfs:label "GeoSPARQL Evaluation tests" ;
mf:include (
<functions/manifest.ttl>
).
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque;
Expand All @@ -28,7 +27,6 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.eclipse.rdf4j.common.io.IOUtil;
Expand Down Expand Up @@ -57,7 +55,6 @@
import org.eclipse.rdf4j.query.resultio.TupleQueryResultParser;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.RepositoryResult;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection;
import org.eclipse.rdf4j.rio.RDFFormat;
Expand Down Expand Up @@ -518,14 +515,17 @@ public List<String> getSubManifests() {
public abstract Collection<DynamicTest> tests();

public Collection<DynamicTest> getTestData(String manifestResource) {
return getTestData(manifestResource, true);
}

public Collection<DynamicTest> getTestData(String manifestResource, boolean approvedOnly) {
List<DynamicTest> tests = new ArrayList<>();

Deque<String> manifests = new ArrayDeque<>();
manifests.add(
SPARQL11UpdateComplianceTest.class.getClassLoader().getResource(manifestResource).toExternalForm());
manifests.add(this.getClass().getClassLoader().getResource(manifestResource).toExternalForm());
while (!manifests.isEmpty()) {
String pop = manifests.pop();
SPARQLQueryTestManifest manifest = new SPARQLQueryTestManifest(pop, excludedSubdirs);
SPARQLQueryTestManifest manifest = new SPARQLQueryTestManifest(pop, excludedSubdirs, approvedOnly);
tests.addAll(manifest.tests);
manifests.addAll(manifest.subManifests);
}
Expand Down

0 comments on commit da3e01e

Please sign in to comment.