|
12 | 12 |
|
13 | 13 | package org.eclipse.rdf4j.sail.shacl; |
14 | 14 |
|
| 15 | +import java.util.Set; |
| 16 | + |
| 17 | +import org.eclipse.rdf4j.common.transaction.IsolationLevel; |
15 | 18 | import org.eclipse.rdf4j.common.transaction.QueryEvaluationMode; |
16 | 19 | import org.eclipse.rdf4j.repository.sail.SailRepository; |
17 | 20 | import org.eclipse.rdf4j.sail.inferencer.fc.SchemaCachingRDFSInferencer; |
18 | 21 | import org.eclipse.rdf4j.sail.memory.MemoryStore; |
19 | 22 | import org.junit.jupiter.api.Tag; |
| 23 | +import org.junit.jupiter.params.ParameterizedTest; |
| 24 | +import org.junit.jupiter.params.provider.MethodSource; |
20 | 25 |
|
21 | 26 | /** |
22 | 27 | * @author Håvard Ottestad |
23 | 28 | */ |
24 | 29 | @Tag("slow") |
25 | 30 | public class ShaclTestWithSchemaCachingRdfsInferencerTest extends ShaclTest { |
26 | 31 |
|
| 32 | + private static final Set<String> IGNORED_TEST_CASE_PREFIXES = Set.of( |
| 33 | + "test-cases/datatype/allObjects/", |
| 34 | + "test-cases/hasValue/targetShapeAnd/", |
| 35 | + "test-cases/hasValue/targetShapeAnd2/", |
| 36 | + "test-cases/hasValue/targetShapeAndOr/", |
| 37 | + "test-cases/hasValue/targetShapeAndOr3/", |
| 38 | + "test-cases/hasValue/targetShapeOr/", |
| 39 | + "test-cases/hasValueIn/targetShapeOr/" |
| 40 | + ); |
| 41 | + |
| 42 | + @ParameterizedTest |
| 43 | + @MethodSource("testsToRunWithIsolationLevel") |
| 44 | + public void test(TestCase testCase, IsolationLevel isolationLevel) { |
| 45 | + if (ignoredTest(testCase)) { |
| 46 | + return; |
| 47 | + } |
| 48 | + runWithAutomaticLogging(() -> runTestCase(testCase, isolationLevel, false)); |
| 49 | + } |
| 50 | + |
| 51 | + @ParameterizedTest |
| 52 | + @MethodSource("testCases") |
| 53 | + public void testSingleTransaction(TestCase testCase) { |
| 54 | + if (ignoredTest(testCase)) { |
| 55 | + return; |
| 56 | + } |
| 57 | + runWithAutomaticLogging(() -> runTestCaseSingleTransaction(testCase)); |
| 58 | + } |
| 59 | + |
| 60 | + @ParameterizedTest |
| 61 | + @MethodSource("testsToRunWithIsolationLevel") |
| 62 | + public void testRevalidation(TestCase testCase, IsolationLevel isolationLevel) { |
| 63 | + if (ignoredTest(testCase)) { |
| 64 | + return; |
| 65 | + } |
| 66 | + runWithAutomaticLogging(() -> runTestCaseRevalidate(testCase, isolationLevel)); |
| 67 | + } |
| 68 | + |
| 69 | + @ParameterizedTest |
| 70 | + @MethodSource("testsToRunWithIsolationLevel") |
| 71 | + public void testNonEmpty(TestCase testCase, IsolationLevel isolationLevel) { |
| 72 | + if (ignoredTest(testCase)) { |
| 73 | + return; |
| 74 | + } |
| 75 | + runWithAutomaticLogging(() -> runTestCase(testCase, isolationLevel, true)); |
| 76 | + } |
| 77 | + |
| 78 | + @ParameterizedTest |
| 79 | + @MethodSource("testCases") |
| 80 | + public void testParsing(TestCase testCase) { |
| 81 | + if (ignoredTest(testCase)) { |
| 82 | + return; |
| 83 | + } |
| 84 | + runWithAutomaticLogging(() -> runParsingTest(testCase)); |
| 85 | + } |
| 86 | + |
| 87 | + @ParameterizedTest |
| 88 | + @MethodSource("testCases") |
| 89 | + public void testReferenceImplementation(TestCase testCase) { |
| 90 | + if (ignoredTest(testCase)) { |
| 91 | + return; |
| 92 | + } |
| 93 | + runWithAutomaticLogging(() -> referenceImplementationTestCaseValidation(testCase)); |
| 94 | + } |
| 95 | + |
| 96 | + @ParameterizedTest |
| 97 | + @MethodSource("testCases") |
| 98 | + public void testShaclValidator(TestCase testCase) { |
| 99 | + if (ignoredTest(testCase)) { |
| 100 | + return; |
| 101 | + } |
| 102 | + runWithAutomaticLogging(() -> runWithShaclValidator(testCase)); |
| 103 | + } |
| 104 | + |
| 105 | + private static boolean ignoredTest(TestCase testCase) { |
| 106 | + String testCasePath = testCase.getTestCasePath(); |
| 107 | + return IGNORED_TEST_CASE_PREFIXES.stream().anyMatch(testCasePath::startsWith); |
| 108 | + } |
| 109 | + |
27 | 110 | @Override |
28 | 111 | SailRepository getShaclSail(TestCase testCase) { |
29 | 112 | MemoryStore memoryStore = new MemoryStore(); |
|
0 commit comments