Skip to content

Commit

Permalink
fixed compliance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad committed Jan 15, 2024
1 parent 74f46d4 commit 8ed6954
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 94 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.the_qa_company.qendpoint.store.experimental;

import com.the_qa_company.qendpoint.core.options.HDTOptions;
import com.the_qa_company.qendpoint.core.options.HDTOptionsKeys;
import com.the_qa_company.qendpoint.store.Utility;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.NotifyingSailConnection;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11QueryComplianceTest;
import org.junit.jupiter.api.io.TempDir;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

public class ExperimentalQEndpointSPARQL11ComplianceQueryTest extends SPARQL11QueryComplianceTest {
/*
* Set this to true to print the call to the store when doing the compliance
* tests
*/
private static final boolean PRINT_CALLS = false;

/*
* Set this to false to enable the graph tests
*/
private static final boolean DISABLE_GRAPH_TESTS = true;

@TempDir
public Path tempDir;

public ExperimentalQEndpointSPARQL11ComplianceQueryTest() {

if (DISABLE_GRAPH_TESTS) {
this.setIgnoredTests(new ArrayList<>(List.of("constructwhere04 - CONSTRUCT WHERE",
"Exists within graph pattern", "(pp07) Path with one graph", "(pp34) Named Graph 1",
"(pp35) Named Graph 2", "sq01 - Subquery within graph pattern",
"sq02 - Subquery within graph pattern, graph variable is bound",
"sq03 - Subquery within graph pattern, graph variable is not bound",
"sq04 - Subquery within graph pattern, default graph does not apply",
"sq05 - Subquery within graph pattern, from named applies",
"sq06 - Subquery with graph pattern, from named applies", "sq07 - Subquery with from",
"sq11 - Subquery limit per resource", "sq13 - Subqueries don't inject bindings")));
}
}

@Override
protected Repository newRepository() throws Exception {
HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS_LANG);
ExperimentalQEndpointSail sail = new ExperimentalQEndpointSail(tempDir, spec);

if (PRINT_CALLS) {
return Utility.convertToDumpRepository(new SailRepository(Utility.convertToDumpSail(sail)));
}
return new SailRepository(sail);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.the_qa_company.qendpoint.store.experimental;

import com.the_qa_company.qendpoint.core.options.HDTOptions;
import com.the_qa_company.qendpoint.core.options.HDTOptionsKeys;
import com.the_qa_company.qendpoint.store.Utility;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.NotifyingSailConnection;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11UpdateComplianceTest;
import org.junit.jupiter.api.io.TempDir;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

public class ExperimentalQEndpointSPARQL11ComplianceUpdateTest extends SPARQL11UpdateComplianceTest {
/*
* Set this to true to print the call to the store when doing the compliance
* tests
*/
private static final boolean PRINT_CALLS = false;

/*
* Set this to false to enable the graph tests
*/
private static final boolean DISABLE_GRAPH_TESTS = true;

@TempDir
public Path tempDir;

public ExperimentalQEndpointSPARQL11ComplianceUpdateTest() {

if (DISABLE_GRAPH_TESTS) {
this.setIgnoredTests(new ArrayList<>(List.of("INSERT 03", "INSERT 04", "INSERT USING 01",
"DELETE INSERT 1b", "DELETE INSERT 1c", "INSERT same bnode twice", "CLEAR NAMED", "DROP NAMED",
"DROP GRAPH", "DROP DEFAULT", "CLEAR GRAPH", "CLEAR DEFAULT", "COPY 1", "COPY 3", "COPY 6",
"MOVE 1", "MOVE 3", "MOVE 6", "Graph-specific DELETE DATA 1", "Graph-specific DELETE DATA 2",
"Graph-specific DELETE 1", "Graph-specific DELETE 1 (WITH)", "Graph-specific DELETE 1 (USING)",
"Simple DELETE 1 (USING)", "Simple DELETE 2 (WITH)", "Simple DELETE 4 (WITH)")));
}
}

@Override
protected Repository newRepository() throws Exception {
HDTOptions spec = HDTOptions.of(HDTOptionsKeys.DICTIONARY_TYPE_KEY,
HDTOptionsKeys.DICTIONARY_TYPE_VALUE_MULTI_OBJECTS_LANG);
ExperimentalQEndpointSail sail = new ExperimentalQEndpointSail(tempDir, spec);

if (PRINT_CALLS) {
return Utility.convertToDumpRepository(new SailRepository(Utility.convertToDumpSail(sail)));
}
return new SailRepository(sail);
}

}

0 comments on commit 8ed6954

Please sign in to comment.