Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-4592 Replace a Junit4 Suite with v5 DynamicTest #4593

Merged
merged 6 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@
*******************************************************************************/
package org.eclipse.rdf4j.query.algebra.geosparql;

import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.memory.MemoryStore;
import org.eclipse.rdf4j.testsuite.query.algebra.geosparql.GeoSPARQLManifestTest;

public class MemoryGeoSPARQLQueryTest extends GeoSPARQLManifestTest {

public MemoryGeoSPARQLQueryTest(String displayName, String testURI, String name, String queryFileURL,
String resultFileURL, Dataset dataset, boolean ordered, boolean laxCardinality) {
super(displayName, testURI, name, queryFileURL, resultFileURL, dataset, ordered, laxCardinality);
}

@Override
protected Repository newRepository() {
return new SailRepository(new MemoryStore());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.rdf4j.query.parser.sparql;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.rdf4j.query.parser.sparql.manifest;

import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.dataset.DatasetRepository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
Expand All @@ -24,11 +23,6 @@
*/
public class SPARQL12QueryTest extends SPARQL12QueryComplianceTest {

public SPARQL12QueryTest(String displayName, String testURI, String name, String queryFileURL, String resultFileURL,
Dataset dataset, boolean ordered, boolean laxCardinality) {
super(displayName, testURI, name, queryFileURL, resultFileURL, dataset, ordered, laxCardinality);
}

@Override
protected Repository newRepository() {
return new DatasetRepository(new SailRepository(new MemoryStore()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.rdf4j.query.parser.sparql.manifest;

import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.dataset.DatasetRepository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
Expand All @@ -24,20 +23,6 @@
*/
public class W3CApprovedSPARQL10QueryTest extends SPARQL10QueryComplianceTest {

/**
* @param displayName
* @param testURI
* @param name
* @param queryFileURL
* @param resultFileURL
* @param dataset
* @param ordered
*/
public W3CApprovedSPARQL10QueryTest(String displayName, String testURI, String name, String queryFileURL,
String resultFileURL, Dataset dataset, boolean ordered, boolean laxCardinality) {
super(displayName, testURI, name, queryFileURL, resultFileURL, dataset, ordered, laxCardinality);
}

@Override
protected Repository newRepository() {
return new DatasetRepository(new SailRepository(new MemoryStore()));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@

public class W3CApprovedSPARQL11SyntaxTest extends SPARQL11SyntaxComplianceTest {

/**
* @param displayName
* @param testURI
* @param name
* @param queryFileURL
* @param resultFileURL
* @param positiveTest
*/
public W3CApprovedSPARQL11SyntaxTest(String displayName, String testURI, String name, String queryFileURL,
boolean positiveTest) {
super(displayName, testURI, name, queryFileURL, positiveTest);
}

@Override
protected ParsedOperation parseOperation(String operation, String fileURL) throws MalformedQueryException {
return QueryParserUtil.parseOperation(QueryLanguage.SPARQL, operation, fileURL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
*******************************************************************************/
package org.eclipse.rdf4j.query.parser.sparql.manifest;

import java.util.Map;

import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.memory.MemoryStore;
Expand All @@ -26,13 +23,6 @@
@Deprecated
public class W3CApprovedSPARQL11UpdateTest extends SPARQL11UpdateComplianceTest {

public W3CApprovedSPARQL11UpdateTest(String displayName, String testURI, String name, String requestFile,
IRI defaultGraphURI, Map<String, IRI> inputNamedGraphs, IRI resultDefaultGraphURI,
Map<String, IRI> resultNamedGraphs) {
super(displayName, testURI, name, requestFile, defaultGraphURI, inputNamedGraphs, resultDefaultGraphURI,
resultNamedGraphs);
}

@Override
protected Repository newRepository() {
SailRepository repo = new SailRepository(new MemoryStore());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.rdf4j.sail.federation;

import java.io.File;
import java.io.IOException;

import org.eclipse.rdf4j.federated.FedXFactory;
import org.eclipse.rdf4j.federated.repository.FedXRepository;
import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryException;
import org.eclipse.rdf4j.repository.config.RepositoryConfig;
Expand All @@ -26,36 +26,28 @@
import org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig;
import org.eclipse.rdf4j.sail.memory.config.MemoryStoreConfig;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11QueryComplianceTest;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.jupiter.api.io.TempDir;

/**
* @author jeen
*/
public class FedXSPARQL11QueryComplianceTest extends SPARQL11QueryComplianceTest {

@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();

private static final String dirName = "testmanager";
@TempDir
public File tempFolder;

private RepositoryManager manager;

public FedXSPARQL11QueryComplianceTest(String displayName, String testURI, String name, String queryFileURL,
String resultFileURL, Dataset dataset, boolean ordered, boolean laxCardinality) {
super(displayName, testURI, name, queryFileURL, resultFileURL, dataset, ordered, laxCardinality);
public FedXSPARQL11QueryComplianceTest() {
super();

// FIXME see https://github.com/eclipse/rdf4j/issues/2173
addIgnoredTest("sq04 - Subquery within graph pattern, default graph does not apply");
}

private void initManager() {
if (manager == null) {
try {
manager = RepositoryProvider.getRepositoryManager(tempFolder.newFolder(dirName));
} catch (IOException e) {
throw new RuntimeException(e);
}
manager = RepositoryProvider.getRepositoryManager(tempFolder);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,26 @@
*******************************************************************************/
package org.eclipse.rdf4j.sail.lmdb;

import java.util.Map;
import java.io.File;

import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.dataset.DatasetRepository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.lmdb.config.LmdbStoreConfig;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11UpdateComplianceTest;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.jupiter.api.io.TempDir;

/**
* Test SPARQL 1.1 Update functionality on LMDB store.
*/
public class LmdbPARQL11UpdateComplianceTest extends SPARQL11UpdateComplianceTest {

public LmdbPARQL11UpdateComplianceTest(String displayName, String testURI, String name, String requestFile,
IRI defaultGraphURI, Map<String, IRI> inputNamedGraphs, IRI resultDefaultGraphURI,
Map<String, IRI> resultNamedGraphs) {
super(displayName, testURI, name, requestFile, defaultGraphURI, inputNamedGraphs, resultDefaultGraphURI,
resultNamedGraphs);
// TODO Auto-generated constructor stub
}

@Rule
public TemporaryFolder folder = new TemporaryFolder();
@TempDir
public File folder;

@Override
protected Repository newRepository() throws Exception {
return new DatasetRepository(
new SailRepository(new LmdbStore(folder.newFolder(), new LmdbStoreConfig("spoc"))));
new SailRepository(new LmdbStore(folder, new LmdbStoreConfig("spoc"))));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,27 @@
*******************************************************************************/
package org.eclipse.rdf4j.sail.lmdb;

import org.eclipse.rdf4j.query.Dataset;
import java.io.File;

import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.dataset.DatasetRepository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
import org.eclipse.rdf4j.sail.lmdb.config.LmdbStoreConfig;
import org.eclipse.rdf4j.testsuite.query.parser.sparql.manifest.SPARQL11QueryComplianceTest;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
import org.junit.jupiter.api.io.TempDir;

/**
* Test SPARQL 1.1 query functionality on LMDB store.
*/
public class LmdbSPARQL11QueryComplianceTest extends SPARQL11QueryComplianceTest {

public LmdbSPARQL11QueryComplianceTest(String displayName, String testURI, String name, String queryFileURL,
String resultFileURL, Dataset dataset, boolean ordered, boolean laxCardinality) {
super(displayName, testURI, name, queryFileURL, resultFileURL, dataset, ordered, laxCardinality);
}

@Rule
public TemporaryFolder folder = new TemporaryFolder();
@TempDir
public File folder;

@Override
protected Repository newRepository() throws Exception {
return new DatasetRepository(
new SailRepository(new LmdbStore(folder.newFolder(), new LmdbStoreConfig("spoc"))));
new SailRepository(new LmdbStore(folder, new LmdbStoreConfig("spoc"))));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,19 @@
import org.eclipse.rdf4j.repository.sail.config.SailRepositoryFactory;
import org.eclipse.rdf4j.sail.lmdb.config.LmdbStoreFactory;
import org.eclipse.rdf4j.testsuite.sparql.RepositorySPARQLComplianceTestSuite;
import org.junit.AfterClass;
import org.junit.BeforeClass;

/**
* Test additional SPARQL functionality on LMDB store.
*/
public class LmdbSPARQLComplianceTest extends RepositorySPARQLComplianceTestSuite {

@BeforeClass
public static void setUpFactory() throws Exception {
setRepositoryFactory(new SailRepositoryFactory() {
public LmdbSPARQLComplianceTest() {
super(new SailRepositoryFactory() {
@Override
public RepositoryImplConfig getConfig() {

return new SailRepositoryConfig(new LmdbStoreFactory().getConfig());
}
});
}

@AfterClass
public static void tearDownFactory() throws Exception {
setRepositoryFactory(null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.rdf4j.sail.memory;

import org.eclipse.rdf4j.query.Dataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.dataset.DatasetRepository;
import org.eclipse.rdf4j.repository.sail.SailRepository;
Expand All @@ -23,11 +22,6 @@
*/
public class MemorySPARQL11QueryComplianceTest extends SPARQL11QueryComplianceTest {

public MemorySPARQL11QueryComplianceTest(String displayName, String testURI, String name, String queryFileURL,
String resultFileURL, Dataset dataset, boolean ordered, boolean laxCardinality) {
super(displayName, testURI, name, queryFileURL, resultFileURL, dataset, ordered, laxCardinality);
}

@Override
protected Repository newRepository() {
return new DatasetRepository(new SailRepository(new MemoryStore()));
Expand Down
Loading
Loading