-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-2081 reorg sparql custom compliance tests as JUnit 4 Test suite
- old suite left in deprecated
- Loading branch information
1 parent
f0eb270
commit c141201
Showing
26 changed files
with
3,317 additions
and
108 deletions.
There are no files selected for viewing
43 changes: 0 additions & 43 deletions
43
compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/lmdb/LmdbComplexSPARQLQueryTest.java
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
compliance/sparql/src/test/java/org/eclipse/rdf4j/sail/lmdb/LmdbSPARQLComplianceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Eclipse RDF4J contributors. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Distribution License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
*******************************************************************************/ | ||
package org.eclipse.rdf4j.sail.lmdb; | ||
|
||
import org.eclipse.rdf4j.repository.config.RepositoryImplConfig; | ||
import org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig; | ||
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() { | ||
@Override | ||
public RepositoryImplConfig getConfig() { | ||
|
||
return new SailRepositoryConfig(new LmdbStoreFactory().getConfig()); | ||
} | ||
}); | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownFactory() throws Exception { | ||
setRepositoryFactory(null); | ||
} | ||
} |
24 changes: 0 additions & 24 deletions
24
...ance/sparql/src/test/java/org/eclipse/rdf4j/sail/memory/MemoryComplexSPARQLQueryTest.java
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...liance/sparql/src/test/java/org/eclipse/rdf4j/sail/memory/MemorySPARQLComplianceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Eclipse RDF4J contributors. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Distribution License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
*******************************************************************************/ | ||
package org.eclipse.rdf4j.sail.memory; | ||
|
||
import org.eclipse.rdf4j.repository.config.RepositoryImplConfig; | ||
import org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig; | ||
import org.eclipse.rdf4j.repository.sail.config.SailRepositoryFactory; | ||
import org.eclipse.rdf4j.sail.memory.config.MemoryStoreFactory; | ||
import org.eclipse.rdf4j.testsuite.sparql.RepositorySPARQLComplianceTestSuite; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
|
||
/** | ||
* @author jeen | ||
*/ | ||
public class MemorySPARQLComplianceTest extends RepositorySPARQLComplianceTestSuite { | ||
|
||
@BeforeClass | ||
public static void setUpFactory() throws Exception { | ||
setRepositoryFactory(new SailRepositoryFactory() { | ||
@Override | ||
public RepositoryImplConfig getConfig() { | ||
return new SailRepositoryConfig(new MemoryStoreFactory().getConfig()); | ||
} | ||
}); | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownFactory() throws Exception { | ||
setRepositoryFactory(null); | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
...e/sparql/src/test/java/org/eclipse/rdf4j/sail/nativerdf/NativeComplexSPARQLQueryTest.java
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
...nce/sparql/src/test/java/org/eclipse/rdf4j/sail/nativerdf/NativeSPARQLComplianceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Eclipse RDF4J contributors. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Distribution License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
*******************************************************************************/ | ||
package org.eclipse.rdf4j.sail.nativerdf; | ||
|
||
import org.eclipse.rdf4j.repository.config.RepositoryImplConfig; | ||
import org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig; | ||
import org.eclipse.rdf4j.repository.sail.config.SailRepositoryFactory; | ||
import org.eclipse.rdf4j.sail.nativerdf.config.NativeStoreFactory; | ||
import org.eclipse.rdf4j.testsuite.sparql.RepositorySPARQLComplianceTestSuite; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
|
||
/** | ||
* @author jeen | ||
*/ | ||
public class NativeSPARQLComplianceTest extends RepositorySPARQLComplianceTestSuite { | ||
|
||
@BeforeClass | ||
public static void setUpFactory() throws Exception { | ||
setRepositoryFactory(new SailRepositoryFactory() { | ||
@Override | ||
public RepositoryImplConfig getConfig() { | ||
|
||
return new SailRepositoryConfig(new NativeStoreFactory().getConfig()); | ||
} | ||
}); | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownFactory() throws Exception { | ||
setRepositoryFactory(null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...uites/sparql/src/main/java/org/eclipse/rdf4j/testsuite/sparql/AbstractComplianceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2022 Eclipse RDF4J contributors. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Distribution License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
*******************************************************************************/ | ||
package org.eclipse.rdf4j.testsuite.sparql; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import org.eclipse.rdf4j.model.Resource; | ||
import org.eclipse.rdf4j.model.vocabulary.DCTERMS; | ||
import org.eclipse.rdf4j.model.vocabulary.FOAF; | ||
import org.eclipse.rdf4j.repository.Repository; | ||
import org.eclipse.rdf4j.repository.RepositoryConnection; | ||
import org.eclipse.rdf4j.repository.RepositoryException; | ||
import org.eclipse.rdf4j.rio.RDFParseException; | ||
import org.eclipse.rdf4j.rio.Rio; | ||
import org.eclipse.rdf4j.testsuite.sparql.vocabulary.EX; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Abstract base class for tests included in the {@link RepositorySPARQLComplianceTestSuite}. | ||
* | ||
* @author Jeen Broekstra | ||
* | ||
*/ | ||
public abstract class AbstractComplianceTest { | ||
|
||
protected final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
|
||
protected Repository repo; | ||
protected RepositoryConnection conn; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
repo = RepositorySPARQLComplianceTestSuite.getEmptyInitializedRepository(this.getClass()); | ||
conn = repo.getConnection(); | ||
} | ||
|
||
@After | ||
public void tearDown() throws Exception { | ||
try { | ||
conn.close(); | ||
} finally { | ||
repo.shutDown(); | ||
} | ||
} | ||
|
||
protected void loadTestData(String dataFile, Resource... contexts) | ||
throws RDFParseException, RepositoryException, IOException { | ||
logger.debug("loading dataset {}", dataFile); | ||
try (InputStream dataset = this.getClass().getResourceAsStream(dataFile)) { | ||
conn.add(dataset, "", Rio.getParserFormatForFileName(dataFile).orElseThrow(Rio.unsupportedFormat(dataFile)), | ||
contexts); | ||
} | ||
logger.debug("dataset loaded."); | ||
} | ||
|
||
/** | ||
* Get a set of useful namespace prefix declarations. | ||
* | ||
* @return namespace prefix declarations for dc, foaf and ex. | ||
*/ | ||
protected String getNamespaceDeclarations() { | ||
return "PREFIX dc: <" + DCTERMS.NAMESPACE + "> \n" + | ||
"PREFIX foaf: <" + FOAF.NAMESPACE + "> \n" + | ||
"PREFIX ex: <" + EX.NAMESPACE + "> \n" + | ||
"\n"; | ||
} | ||
} |
Oops, something went wrong.