This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-rdf.git
The following commit(s) were added to refs/heads/master by this push: new 39a3e433 Use JUnit 5 convention for test method visibility 39a3e433 is described below commit 39a3e4337e15b9d7503f111dff4fa74473cc3541 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sat Jun 7 18:27:03 2025 -0400 Use JUnit 5 convention for test method visibility --- .../commons/rdf/api/AbstractDatasetTest.java | 42 ++++++++++---------- .../apache/commons/rdf/api/AbstractGraphTest.java | 30 +++++++------- .../apache/commons/rdf/api/AbstractRDFTest.java | 46 +++++++++++----------- .../apache/commons/rdf/api/DefaultDatasetTest.java | 6 +-- .../apache/commons/rdf/api/DefaultGraphTest.java | 10 ++--- .../apache/commons/rdf/api/DefaultQuadTest.java | 2 +- .../apache/commons/rdf/api/DummyDatasetTest.java | 24 +++++------ .../org/apache/commons/rdf/api/DummyGraphTest.java | 16 ++++---- .../org/apache/commons/rdf/api/DummyIRITest.java | 12 +++--- .../org/apache/commons/rdf/api/DummyQuadTest.java | 12 +++--- .../apache/commons/rdf/api/DummyTripleTest.java | 10 ++--- .../org/apache/commons/rdf/api/RDFSyntaxTest.java | 40 +++++++++---------- .../src/example/IntroToRDFTest.java | 2 +- .../src/example/UserGuideTest.java | 14 +++---- .../commons/rdf/integrationtests/AllToAllTest.java | 4 +- .../rdf/integrationtests/JSONLDParsingTest.java | 12 +++--- .../apache/commons/rdf/jena/DatasetJenaTest.java | 2 +- .../commons/rdf/jena/DefaultGraphInQuadTest.java | 16 ++++---- .../commons/rdf/jena/GeneralizedRDFQuadTest.java | 12 +++--- .../commons/rdf/jena/GeneralizedRDFTripleTest.java | 8 ++-- .../org/apache/commons/rdf/jena/JenaRDFTest.java | 4 +- .../commons/rdf/jena/JenaServiceLoaderTest.java | 2 +- .../rdf/jena/TestJenaGraphToCommonsRDFGraph.java | 2 +- .../commons/rdf/jena/TestRDFParserBuilder.java | 2 +- .../rdf/jsonldjava/JsonLdComparisonTest.java | 20 +++++----- .../rdf/jsonldjava/JsonLdParserBuilderTest.java | 6 +-- .../rdf/jsonldjava/JsonLdServiceLoaderTest.java | 2 +- .../rdf/rdf4j/RDF4JMethodOverloadsTest.java | 2 +- .../commons/rdf/rdf4j/RDF4JServiceLoaderTest.java | 2 +- .../commons/rdf/simple/SimpleDatasetTest.java | 2 +- .../apache/commons/rdf/simple/SimpleGraphTest.java | 2 +- .../rdf/simple/SimpleRDFTermFactoryTest.java | 16 ++++---- .../rdf/simple/SimpleServiceLoaderTest.java | 2 +- .../commons/rdf/simple/TestWritingGraph.java | 10 ++--- .../simple/experimental/AbstractRDFParserTest.java | 24 +++++------ .../simple/experimental/RDFParseExceptionTest.java | 8 ++-- 36 files changed, 213 insertions(+), 213 deletions(-) diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractDatasetTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractDatasetTest.java index 0c031edd..61834796 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractDatasetTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractDatasetTest.java @@ -248,7 +248,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testAddBlankNodesFromMultipleDatasets() throws Exception { + void testAddBlankNodesFromMultipleDatasets() throws Exception { // Create two separate Dataset instances try (final Dataset g1 = createDataset1(); final Dataset g2 = createDataset2(); @@ -315,7 +315,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testClear() throws Exception { + void testClear() throws Exception { dataset.clear(); assertFalse(dataset.contains(null, alice, knows, bob)); assertEquals(0, dataset.size()); @@ -325,7 +325,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testContains() throws Exception { + void testContains() throws Exception { assertFalse(dataset.contains(null, bob, knows, alice)); // or so he claims. assertTrue(dataset.contains(Optional.of(graph1), alice, knows, bob)); @@ -347,7 +347,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testContainsLanguageTagsCaseInsensitive() { + void testContainsLanguageTagsCaseInsensitive() { // COMMONSRDF-51: Ensure we can add/contains/remove with any casing // of literal language tag final Literal lower = factory.createLiteral("Hello there", "en-gb"); @@ -371,7 +371,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testContainsLanguageTagsCaseInsensitiveTurkish() { + void testContainsLanguageTagsCaseInsensitiveTurkish() { // COMMONSRDF-51: Special test for Turkish issue where // "i".toLowerCase() != "i" // See also: @@ -429,7 +429,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testGetGraph() throws Exception { + void testGetGraph() throws Exception { try (final Graph defaultGraph = dataset.getGraph()) { // TODO: Can we assume the default graph was empty before our new triples? assertEquals(2, defaultGraph.size()); @@ -454,7 +454,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testGetGraph1() throws Exception { + void testGetGraph1() throws Exception { // graph1 should be present try (final Graph g1 = dataset.getGraph(graph1).get()) { assertEquals(4, g1.size()); @@ -467,7 +467,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testGetGraph2() throws Exception { + void testGetGraph2() throws Exception { // graph2 should be present, even if is named by a BlankNode // We'll look up the potentially mapped graph2 blanknode final BlankNodeOrIRI graph2Name = (BlankNodeOrIRI) dataset.stream(Optional.empty(), bob, isPrimaryTopicOf, null) @@ -491,7 +491,7 @@ public abstract class AbstractDatasetTest { * If test fails */ @Test - public void testGetGraphNames() throws Exception { + void testGetGraphNames() throws Exception { final Set<BlankNodeOrIRI> names = dataset.getGraphNames().collect(Collectors.toSet()); assertTrue(names.contains(graph1), "Can't find graph name " + graph1); assertTrue(dataset.contains(Optional.of(graph1), null, null, null), "Found no quads in graph1"); @@ -506,7 +506,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testGetGraphNull() throws Exception { + void testGetGraphNull() throws Exception { // Default graph should be present try (final Graph defaultGraph = dataset.getGraph(null).get()) { // TODO: Can we assume the default graph was empty before our new triples? @@ -518,7 +518,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testGetQuads() throws Exception { + void testGetQuads() throws Exception { long quadCount; try (Stream<? extends Quad> stream = dataset.stream()) { quadCount = stream.count(); @@ -535,7 +535,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testGetQuadsQuery() throws Exception { + void testGetQuadsQuery() throws Exception { try (Stream<? extends Quad> stream = dataset.stream(Optional.of(graph1), alice, null, null)) { final long aliceCount = stream.count(); @@ -555,7 +555,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testIterate() throws Exception { + void testIterate() throws Exception { assumeFalse(dataset.isEmpty()); final List<Quad> quads = new ArrayList<>(); for (final Quad t : dataset.iterate()) { @@ -613,7 +613,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testIterateFilter() throws Exception { + void testIterateFilter() throws Exception { final List<RDFTerm> friends = new ArrayList<>(); final IRI alice = factory.createIRI("http://example.com/alice"); final IRI knows = factory.createIRI("http://xmlns.com/foaf/0.1/knows"); @@ -632,7 +632,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testRemove() throws Exception { + void testRemove() throws Exception { final long fullSize = dataset.size(); dataset.remove(Optional.of(graph1), alice, knows, bob); final long shrunkSize = dataset.size(); @@ -672,7 +672,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testRemoveLanguageTagsCaseInsensitive() { + void testRemoveLanguageTagsCaseInsensitive() { // COMMONSRDF-51: Ensure we can remove with any casing // of literal language tag final Literal lower = factory.createLiteral("Howdy", "en-us"); @@ -698,12 +698,12 @@ public abstract class AbstractDatasetTest { } @Test - public void testSize() throws Exception { + void testSize() throws Exception { assertEquals(10, dataset.size()); } @Test - public void testStreamDefaultGraphNameAlice() throws Exception { + void testStreamDefaultGraphNameAlice() throws Exception { // null below would match in ANY graph (including default graph) final Optional<? extends Quad> aliceTopic = dataset.stream(null, alice, isPrimaryTopicOf, null).findAny(); assertTrue(aliceTopic.isPresent()); @@ -713,7 +713,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testStreamDefaultGraphNameByPattern() throws Exception { + void testStreamDefaultGraphNameByPattern() throws Exception { dataset.stream(Optional.empty(), null, null, null).forEach(quad -> { // COMMONSRDF-55: should not be <urn:x-arq:defaultgraph> or similar Boolean isGraph1 = quad.getGraphName().map(gn -> gn.equals(graph1)).orElse(false); @@ -726,7 +726,7 @@ public abstract class AbstractDatasetTest { } @Test - public void testStreamLanguageTagsCaseInsensitive() { + void testStreamLanguageTagsCaseInsensitive() { // COMMONSRDF-51: Ensure we can add/contains/remove with any casing // of literal language tag final Literal lower = factory.createLiteral("Good afternoon", "en-gb"); @@ -766,7 +766,7 @@ public abstract class AbstractDatasetTest { * @throws Exception If test fails */ @Test - public void testWhyJavaStreamsMightNotTakeOverFromSparql() throws Exception { + void testWhyJavaStreamsMightNotTakeOverFromSparql() throws Exception { assumeTrue(bnode1 != null && bnode2 != null && secretClubName != null); // Find a secret organizations try (Stream<? extends Quad> stream = dataset.stream(null, null, knows, null)) { diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java index 4064a2bb..9c6f2c13 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java @@ -255,7 +255,7 @@ public abstract class AbstractGraphTest { } @Test - public void testAddBlankNodesFromMultipleGraphs() throws Exception { + void testAddBlankNodesFromMultipleGraphs() throws Exception { // Create two separate Graph instances // and add them to a new Graph g3 @@ -322,7 +322,7 @@ public abstract class AbstractGraphTest { } @Test - public void testClear() throws Exception { + void testClear() throws Exception { graph.clear(); assertFalse(graph.contains(alice, knows, bob)); assertEquals(0, graph.size()); @@ -331,7 +331,7 @@ public abstract class AbstractGraphTest { } @Test - public void testContains() throws Exception { + void testContains() throws Exception { assertFalse(graph.contains(bob, knows, alice)); // or so he claims. assertTrue(graph.contains(alice, knows, bob)); @@ -358,7 +358,7 @@ public abstract class AbstractGraphTest { } @Test - public void testContainsLanguageTagsCaseInsensitive() throws Exception { + void testContainsLanguageTagsCaseInsensitive() throws Exception { // COMMONSRDF-51: Ensure we can add/contains/remove with any casing // of literal language tag final Literal lower = factory.createLiteral("Hello", "en-gb"); @@ -384,7 +384,7 @@ public abstract class AbstractGraphTest { } @Test - public void testContainsLanguageTagsCaseInsensitiveTurkish() throws Exception { + void testContainsLanguageTagsCaseInsensitiveTurkish() throws Exception { // COMMONSRDF-51: Special test for Turkish issue where // "i".toLowerCase() != "i" // See also: @@ -442,7 +442,7 @@ public abstract class AbstractGraphTest { } @Test - public void testGetTriples() throws Exception { + void testGetTriples() throws Exception { long tripleCount; try (Stream<? extends Triple> stream = graph.stream()) { tripleCount = stream.count(); @@ -459,7 +459,7 @@ public abstract class AbstractGraphTest { } @Test - public void testGetTriplesQuery() throws Exception { + void testGetTriplesQuery() throws Exception { try (Stream<? extends Triple> stream = graph.stream(alice, null, null)) { final long aliceCount = stream.count(); @@ -479,7 +479,7 @@ public abstract class AbstractGraphTest { } @Test - public void testIterate() throws Exception { + void testIterate() throws Exception { assumeFalse(graph.isEmpty()); @@ -512,7 +512,7 @@ public abstract class AbstractGraphTest { } @Test - public void testIterateFilter() throws Exception { + void testIterateFilter() throws Exception { final List<RDFTerm> friends = new ArrayList<>(); final IRI alice = factory.createIRI("http://example.com/alice"); final IRI knows = factory.createIRI("http://xmlns.com/foaf/0.1/knows"); @@ -531,7 +531,7 @@ public abstract class AbstractGraphTest { } @Test - public void testRemove() throws Exception { + void testRemove() throws Exception { final long fullSize = graph.size(); graph.remove(alice, knows, bob); final long shrunkSize = graph.size(); @@ -571,7 +571,7 @@ public abstract class AbstractGraphTest { } @Test - public void testRemoveLanguageTagsCaseInsensitive() throws Exception { + void testRemoveLanguageTagsCaseInsensitive() throws Exception { // COMMONSRDF-51: Ensure we can remove with any casing // of literal language tag final Literal lower = factory.createLiteral("Hello", "en-gb"); @@ -599,7 +599,7 @@ public abstract class AbstractGraphTest { } @Test - public void testSize() throws Exception { + void testSize() throws Exception { assertFalse(graph.isEmpty()); assumeTrue(bnode1 != null && bnode2 != null && aliceName != null && bobName != null && secretClubName != null && companyName != null && bobNameTriple != null); // Can only reliably predict size if we could create all triples @@ -607,7 +607,7 @@ public abstract class AbstractGraphTest { } @Test - public void testStreamLanguageTagsCaseInsensitive() throws Exception { + void testStreamLanguageTagsCaseInsensitive() throws Exception { // COMMONSRDF-51: Ensure we can add/contains/remove with any casing // of literal language tag final Literal lower = factory.createLiteral("Hello", "en-gb"); @@ -649,7 +649,7 @@ public abstract class AbstractGraphTest { * @throws Exception If test fails */ @Test - public void testWhyJavaStreamsMightNotTakeOverFromSparql() throws Exception { + void testWhyJavaStreamsMightNotTakeOverFromSparql() throws Exception { assumeTrue(bnode1 != null && bnode2 != null && secretClubName != null); // Find a secret organizations try (Stream<? extends Triple> stream = graph.stream(null, knows, null)) { @@ -684,7 +684,7 @@ public abstract class AbstractGraphTest { * See https://github.com/apache/commons-rdf/pull/328 */ @Test - public void testSequentialStream() { + void testSequentialStream() { assertFalse(graph.stream().isParallel()); assertFalse(graph.stream(null, null, null).isParallel()); } diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java index ec796fee..1790b48b 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTest.java @@ -66,7 +66,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateBlankNode() throws Exception { + void testCreateBlankNode() throws Exception { final BlankNode bnode = factory.createBlankNode(); final BlankNode bnode2 = factory.createBlankNode(); @@ -76,12 +76,12 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateBlankNodeIdentifier() throws Exception { + void testCreateBlankNodeIdentifier() throws Exception { factory.createBlankNode("example1"); } @Test - public void testCreateBlankNodeIdentifierEmpty() throws Exception { + void testCreateBlankNodeIdentifierEmpty() throws Exception { try { factory.createBlankNode(""); } catch (final IllegalArgumentException e) { @@ -90,7 +90,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateBlankNodeIdentifierTwice() throws Exception { + void testCreateBlankNodeIdentifierTwice() throws Exception { BlankNode bnode1, bnode2, bnode3; bnode1 = factory.createBlankNode("example1"); bnode2 = factory.createBlankNode("example1"); @@ -105,7 +105,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateBlankNodeIdentifierTwiceDifferentFactories() throws Exception { + void testCreateBlankNodeIdentifierTwiceDifferentFactories() throws Exception { BlankNode bnode1, differentFactory; bnode1 = factory.createBlankNode(); // it MUST differ from a second factory @@ -127,7 +127,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateGraph() throws Exception { + void testCreateGraph() throws Exception { try (final Graph graph = factory.createGraph(); final Graph graph2 = factory.createGraph()) { assertEquals(0, graph.size(), "Graph was not empty"); @@ -140,7 +140,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateIRI() throws Exception { + void testCreateIRI() throws Exception { final IRI example = factory.createIRI("http://example.com/"); assertEquals("http://example.com/", example.getIRIString()); @@ -166,7 +166,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteral() throws Exception { + void testCreateLiteral() throws Exception { final Literal example = factory.createLiteral("Example"); assertEquals("Example", example.getLexicalForm()); assertFalse(example.getLanguageTag().isPresent()); @@ -176,7 +176,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteralDateTime() throws Exception { + void testCreateLiteralDateTime() throws Exception { final Literal dateTime = factory.createLiteral("2014-12-27T00:50:00T-0600", factory.createIRI("http://www.w3.org/2001/XMLSchema#dateTime")); assertEquals("2014-12-27T00:50:00T-0600", dateTime.getLexicalForm()); @@ -187,7 +187,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteralLang() throws Exception { + void testCreateLiteralLang() throws Exception { final Literal example = factory.createLiteral("Example", "en"); assertEquals("Example", example.getLexicalForm()); @@ -197,7 +197,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteralLangCaseInsensitive() throws Exception { + void testCreateLiteralLangCaseInsensitive() throws Exception { /* * COMMONSRDF-51: Literal langtag may not be in lowercase, but must be * COMPARED (aka .equals and .hashCode()) in lowercase as the language @@ -241,7 +241,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteralLangCaseInsensitiveInTurkish() throws Exception { + void testCreateLiteralLangCaseInsensitiveInTurkish() throws Exception { // COMMONSRDF-51: Special test for Turkish issue where // "i".toLowerCase() != "i" // See also: @@ -293,7 +293,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteralLangCaseInsensitiveOther() throws Exception { + void testCreateLiteralLangCaseInsensitiveOther() throws Exception { // COMMONSRDF-51: Ensure the Literal is using case insensitive // comparison against any literal implementation // which may not have done .toLowerString() in their constructor @@ -332,7 +332,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteralLangISO693_3() throws Exception { + void testCreateLiteralLangISO693_3() throws Exception { // see https://issues.apache.org/jira/browse/JENA-827 final Literal vls = factory.createLiteral("Herbert Van de Sompel", "vls"); // JENA-827 @@ -342,7 +342,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateLiteralString() throws Exception { + void testCreateLiteralString() throws Exception { final Literal example = factory.createLiteral("Example", factory.createIRI("http://www.w3.org/2001/XMLSchema#string")); assertEquals("Example", example.getLexicalForm()); @@ -353,7 +353,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateTripleBnodeBnode() { + void testCreateTripleBnodeBnode() { final BlankNode subject = factory.createBlankNode("b1"); final IRI predicate = factory.createIRI("http://example.com/pred"); final BlankNode object = factory.createBlankNode("b2"); @@ -367,7 +367,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateTripleBnodeIRI() { + void testCreateTripleBnodeIRI() { final BlankNode subject = factory.createBlankNode("b1"); final IRI predicate = factory.createIRI("http://example.com/pred"); final IRI object = factory.createIRI("http://example.com/obj"); @@ -381,7 +381,7 @@ public abstract class AbstractRDFTest { } @Test - public void testCreateTripleBnodeTriple() { + void testCreateTripleBnodeTriple() { final BlankNode subject = factory.createBlankNode(); final IRI predicate = factory.createIRI("http://example.com/pred"); final Literal object = factory.createLiteral("Example", "en"); @@ -395,26 +395,26 @@ public abstract class AbstractRDFTest { } @Test - public void testHashCodeBlankNode() throws Exception { + void testHashCodeBlankNode() throws Exception { final BlankNode bnode1 = factory.createBlankNode(); assertEquals(bnode1.uniqueReference().hashCode(), bnode1.hashCode()); } @Test - public void testHashCodeIRI() throws Exception { + void testHashCodeIRI() throws Exception { final IRI iri = factory.createIRI("http://example.com/"); assertEquals(iri.getIRIString().hashCode(), iri.hashCode()); } @Test - public void testHashCodeLiteral() throws Exception { + void testHashCodeLiteral() throws Exception { final Literal literal = factory.createLiteral("Hello"); assertEquals(Objects.hash(literal.getLexicalForm(), literal.getDatatype(), literal.getLanguageTag()), literal.hashCode()); } @Test - public void testHashCodeTriple() throws Exception { + void testHashCodeTriple() throws Exception { final IRI iri = factory.createIRI("http://example.com/"); final Triple triple = factory.createTriple(iri, iri, iri); assertEquals(Objects.hash(iri, iri, iri), triple.hashCode()); @@ -433,7 +433,7 @@ public abstract class AbstractRDFTest { } @Test - public void testInvalidTriplePredicate() { + void testInvalidTriplePredicate() { assertThrows(Exception.class, () -> { final BlankNode subject = factory.createBlankNode("b1"); final BlankNode predicate = factory.createBlankNode("b2"); diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultDatasetTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultDatasetTest.java index bad0f3ea..0e90e8e0 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultDatasetTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultDatasetTest.java @@ -28,12 +28,12 @@ public class DefaultDatasetTest { DummyDataset dataset = new DummyDataset(); @Test - public void testClose() throws Exception { + void testClose() throws Exception { dataset.close(); // no-op } @Test - public void testDefaultFilteredIterate() throws Exception { + void testDefaultFilteredIterate() throws Exception { assertFalse(dataset.streamCalled); assertFalse(dataset.filteredStreamCalled); for (final Quad t : dataset.iterate(null, null, new DummyIRI(2), null)) { @@ -44,7 +44,7 @@ public class DefaultDatasetTest { } @Test - public void testDefaultIterate() throws Exception { + void testDefaultIterate() throws Exception { assertFalse(dataset.streamCalled); assertFalse(dataset.filteredStreamCalled); for (final Quad t : dataset.iterate()) { diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultGraphTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultGraphTest.java index 835ebc78..e3b12c35 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultGraphTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultGraphTest.java @@ -28,12 +28,12 @@ public class DefaultGraphTest { DummyGraph graph = new DummyGraph(); @Test - public void testClose() throws Exception { + void testClose() throws Exception { graph.close(); // no-op } @Test - public void testDefaultFilteredIterate() throws Exception { + void testDefaultFilteredIterate() throws Exception { assertFalse(graph.streamCalled); assertFalse(graph.filteredStreamCalled); for (final Triple t : graph.iterate(null, new DummyIRI(2), null)) { @@ -45,7 +45,7 @@ public class DefaultGraphTest { @SuppressWarnings("deprecation") @Test - public void testDefaultGetTriples() throws Exception { + void testDefaultGetTriples() throws Exception { assertFalse(graph.streamCalled); assertFalse(graph.filteredStreamCalled); assertEquals(1L, graph.getTriples().count()); @@ -55,7 +55,7 @@ public class DefaultGraphTest { @SuppressWarnings("deprecation") @Test - public void testDefaultGetTriplesFiltered() throws Exception { + void testDefaultGetTriplesFiltered() throws Exception { assertFalse(graph.streamCalled); assertFalse(graph.filteredStreamCalled); assertEquals(1L, graph.getTriples(null,null,null).count()); @@ -66,7 +66,7 @@ public class DefaultGraphTest { } @Test - public void testDefaultIterate() throws Exception { + void testDefaultIterate() throws Exception { assertFalse(graph.streamCalled); assertFalse(graph.filteredStreamCalled); for (final Triple t : graph.iterate()) { diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultQuadTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultQuadTest.java index 22659754..65c03774 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultQuadTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DefaultQuadTest.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; public class DefaultQuadTest { @Test - public void testAsQuad() throws Exception { + void testAsQuad() throws Exception { final Quad q = new DummyQuad(); final Triple t = q.asTriple(); assertEquals(t, t); diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyDatasetTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyDatasetTest.java index 83e21547..d9bad76a 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyDatasetTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyDatasetTest.java @@ -41,64 +41,64 @@ public class DummyDatasetTest { } @Test - public void testAdd() throws Exception { + void testAdd() throws Exception { dataset.add(new DummyQuad()); } @Test - public void testAddSPO() throws Exception { + void testAddSPO() throws Exception { dataset.add(null, new DummyIRI(1), new DummyIRI(2), new DummyIRI(3)); } @Test - public void testContains() throws Exception { + void testContains() throws Exception { assertTrue(dataset.contains(new DummyQuad())); } @Test - public void testContainsSPO() throws Exception { + void testContainsSPO() throws Exception { assertTrue(dataset.contains(null, null, null, null)); assertTrue(dataset.contains(null, new DummyIRI(1), new DummyIRI(2), new DummyIRI(3))); assertFalse(dataset.contains(null, new DummyIRI(0), new DummyIRI(0), new DummyIRI(0))); } @Test - public void testGetGraph() throws Exception { + void testGetGraph() throws Exception { assertInstanceOf(DummyGraph.class, dataset.getGraph()); } @Test - public void testGetGraphNamed() throws Exception { + void testGetGraphNamed() throws Exception { assertFalse(dataset.getGraph(new DummyIRI(0)).isPresent()); } @Test - public void testGetGraphNames() throws Exception { + void testGetGraphNames() throws Exception { assertFalse(dataset.getGraphNames().findAny().isPresent()); } @Test - public void testGetGraphNull() throws Exception { + void testGetGraphNull() throws Exception { assertInstanceOf(DummyGraph.class, dataset.getGraph(null).get()); } @Test - public void testRemoveSPO() throws Exception { + void testRemoveSPO() throws Exception { dataset.remove(null, new DummyIRI(0), new DummyIRI(0), new DummyIRI(0)); } @Test - public void testSize() throws Exception { + void testSize() throws Exception { assertEquals(1, dataset.size()); } @Test - public void testStream() throws Exception { + void testStream() throws Exception { assertEquals(new DummyQuad(), dataset.stream().findAny().get()); } @Test - public void testStreamFiltered() throws Exception { + void testStreamFiltered() throws Exception { assertEquals(new DummyQuad(), dataset.stream(null, null, null, null).findAny().get()); assertEquals(new DummyQuad(), dataset.stream(null, new DummyIRI(1), new DummyIRI(2), new DummyIRI(3)).findAny().get()); diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyGraphTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyGraphTest.java index 80fe5b67..fe656862 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyGraphTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyGraphTest.java @@ -40,44 +40,44 @@ public class DummyGraphTest { } @Test - public void testAdd() throws Exception { + void testAdd() throws Exception { graph.add(new DummyTriple()); } @Test - public void testAddSPO() throws Exception { + void testAddSPO() throws Exception { graph.add(new DummyIRI(1), new DummyIRI(2), new DummyIRI(3)); } @Test - public void testContains() throws Exception { + void testContains() throws Exception { assertTrue(graph.contains(new DummyTriple())); } @Test - public void testContainsSPO() throws Exception { + void testContainsSPO() throws Exception { assertTrue(graph.contains(null, null, null)); assertTrue(graph.contains(new DummyIRI(1), new DummyIRI(2), new DummyIRI(3))); assertFalse(graph.contains(new DummyIRI(0), new DummyIRI(0), new DummyIRI(0))); } @Test - public void testRemoveSPO() throws Exception { + void testRemoveSPO() throws Exception { graph.remove(new DummyIRI(0), new DummyIRI(0), new DummyIRI(0)); } @Test - public void testSize() throws Exception { + void testSize() throws Exception { assertEquals(1, graph.size()); } @Test - public void testStream() throws Exception { + void testStream() throws Exception { assertEquals(new DummyTriple(), graph.stream().findAny().get()); } @Test - public void testStreamFiltered() throws Exception { + void testStreamFiltered() throws Exception { assertEquals(new DummyTriple(), graph.stream(null, null, null).findAny().get()); assertEquals(new DummyTriple(), graph.stream(new DummyIRI(1), new DummyIRI(2), new DummyIRI(3)).findAny().get()); diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyIRITest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyIRITest.java index 0ccf6474..28597741 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyIRITest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyIRITest.java @@ -26,32 +26,32 @@ public class DummyIRITest { DummyIRI iri = new DummyIRI(1337); @Test - public void testEquals() throws Exception { + void testEquals() throws Exception { assertEquals(new DummyIRI(1337), iri); } @Test - public void testGetIRIString() throws Exception { + void testGetIRIString() throws Exception { assertEquals("http://example.com/1337", iri.getIRIString()); } @Test - public void testHashCode() throws Exception { + void testHashCode() throws Exception { assertEquals("http://example.com/1337".hashCode(), iri.hashCode()); } @Test - public void testI() throws Exception { + void testI() throws Exception { assertEquals(1337, iri.i); } @Test - public void testNotEquals() throws Exception { + void testNotEquals() throws Exception { assertNotEquals(new DummyIRI(1), iri); } @Test - public void testNtriplesString() throws Exception { + void testNtriplesString() throws Exception { assertEquals("<http://example.com/1337>", iri.ntriplesString()); } } diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyQuadTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyQuadTest.java index fdd9223f..43156a35 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyQuadTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyQuadTest.java @@ -28,32 +28,32 @@ public class DummyQuadTest { Quad quad = new DummyQuad(); @Test - public void testEquals() throws Exception { + void testEquals() throws Exception { assertEquals(new DummyQuad(), quad); } @Test - public void testGetGraphName() throws Exception { + void testGetGraphName() throws Exception { assertFalse(quad.getGraphName().isPresent()); } @Test - public void testGetObject() throws Exception { + void testGetObject() throws Exception { assertEquals(3, ((DummyIRI) quad.getObject()).i); } @Test - public void testGetPredicate() throws Exception { + void testGetPredicate() throws Exception { assertEquals(2, ((DummyIRI) quad.getPredicate()).i); } @Test - public void testGetSubject() throws Exception { + void testGetSubject() throws Exception { assertEquals(1, ((DummyIRI) quad.getSubject()).i); } @Test - public void testHashCode() { + void testHashCode() { final int expected = Objects.hash(quad.getSubject(), quad.getPredicate(), quad.getObject(), quad.getGraphName()); assertEquals(expected, quad.hashCode()); } diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyTripleTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyTripleTest.java index 5062d700..cef35947 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyTripleTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/DummyTripleTest.java @@ -27,27 +27,27 @@ public class DummyTripleTest { Triple triple = new DummyTriple(); @Test - public void testEquals() throws Exception { + void testEquals() throws Exception { assertEquals(new DummyTriple(), triple); } @Test - public void testGetObject() throws Exception { + void testGetObject() throws Exception { assertEquals(3, ((DummyIRI) triple.getObject()).i); } @Test - public void testGetPredicate() throws Exception { + void testGetPredicate() throws Exception { assertEquals(2, ((DummyIRI) triple.getPredicate()).i); } @Test - public void testGetSubject() throws Exception { + void testGetSubject() throws Exception { assertEquals(1, ((DummyIRI) triple.getSubject()).i); } @Test - public void testHashCode() { + void testHashCode() { final int expected = Objects.hash(triple.getSubject(), triple.getPredicate(), triple.getObject()); assertEquals(expected, triple.hashCode()); } diff --git a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/RDFSyntaxTest.java b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/RDFSyntaxTest.java index 92b699e1..cf06aef1 100644 --- a/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/RDFSyntaxTest.java +++ b/commons-rdf-api/src/test/java/org/apache/commons/rdf/api/RDFSyntaxTest.java @@ -38,7 +38,7 @@ public class RDFSyntaxTest { } @Test - public void testByFileExtension() throws Exception { + void testByFileExtension() throws Exception { assertEquals(RDFSyntax.JSONLD, RDFSyntax.byFileExtension(".jsonld").get()); assertEquals(RDFSyntax.NQUADS, RDFSyntax.byFileExtension(".nq").get()); assertEquals(RDFSyntax.NTRIPLES, RDFSyntax.byFileExtension(".nt").get()); @@ -49,22 +49,22 @@ public class RDFSyntaxTest { } @Test - public void testByFileExtensionFailsWithoutDot() throws Exception { + void testByFileExtensionFailsWithoutDot() throws Exception { assertEquals(Optional.empty(), RDFSyntax.byFileExtension("rdf")); } @Test - public void testByFileExtensionLowerCase() throws Exception { + void testByFileExtensionLowerCase() throws Exception { assertEquals(RDFSyntax.TURTLE, RDFSyntax.byFileExtension(".TtL").get()); } @Test - public void testByFileExtensionUnknown() throws Exception { + void testByFileExtensionUnknown() throws Exception { assertEquals(Optional.empty(), RDFSyntax.byFileExtension(".tar")); } @Test - public void testByMediaType() throws Exception { + void testByMediaType() throws Exception { assertEquals(RDFSyntax.JSONLD, RDFSyntax.byMediaType("application/ld+json").get()); assertEquals(RDFSyntax.NQUADS, RDFSyntax.byMediaType("application/n-quads").get()); assertEquals(RDFSyntax.NTRIPLES, RDFSyntax.byMediaType("application/n-triples").get()); @@ -76,7 +76,7 @@ public class RDFSyntaxTest { } @Test - public void testByMediaTypeContentType() throws Exception { + void testByMediaTypeContentType() throws Exception { assertEquals(RDFSyntax.TURTLE, RDFSyntax.byMediaType("text/turtle; charset=\"UTF-8\"").get()); assertEquals(RDFSyntax.TURTLE, RDFSyntax.byMediaType("text/turtle ; charset=\"UTF-8\"").get()); // That's a Content-Type, not media type; we won't split by "," @@ -86,17 +86,17 @@ public class RDFSyntaxTest { } @Test - public void testByMediaTypeLowerCase() throws Exception { + void testByMediaTypeLowerCase() throws Exception { assertEquals(RDFSyntax.JSONLD, RDFSyntax.byMediaType("APPLICATION/ld+JSON").get()); } @Test - public void testByMediaTypeUnknown() throws Exception { + void testByMediaTypeUnknown() throws Exception { assertEquals(Optional.empty(), RDFSyntax.byMediaType("application/octet-stream")); } @Test - public void testByName() throws Exception { + void testByName() throws Exception { for (final RDFSyntax s : RDFSyntax.w3cSyntaxes()) { assertEquals(s, RDFSyntax.byName(s.name()).get()); } @@ -104,7 +104,7 @@ public class RDFSyntaxTest { @CartesianTest @CartesianTest.MethodFactory("providerRDFSyntax") - public void testEqualsAndHashCode(final RDFSyntax left, final RDFSyntax right) { + void testEqualsAndHashCode(final RDFSyntax left, final RDFSyntax right) { assertNotNull(left); assertNotNull(right); assertEquals(left, left); @@ -132,7 +132,7 @@ public class RDFSyntaxTest { } @Test - public void testFileExtension() throws Exception { + void testFileExtension() throws Exception { assertEquals(".jsonld", RDFSyntax.JSONLD.fileExtension()); assertEquals(".nq", RDFSyntax.NQUADS.fileExtension()); assertEquals(".nt", RDFSyntax.NTRIPLES.fileExtension()); @@ -143,7 +143,7 @@ public class RDFSyntaxTest { } @Test - public void testFileExtensions() throws Exception { + void testFileExtensions() throws Exception { assertTrue(RDFSyntax.JSONLD.fileExtensions().contains(".jsonld")); assertTrue(RDFSyntax.NQUADS.fileExtensions().contains(".nq")); assertTrue(RDFSyntax.NTRIPLES.fileExtensions().contains(".nt")); @@ -155,7 +155,7 @@ public class RDFSyntaxTest { } @Test - public void testIriGetIRIString() throws Exception { + void testIriGetIRIString() throws Exception { assertEquals("http://www.w3.org/ns/formats/JSON-LD", RDFSyntax.JSONLD.iri().getIRIString()); assertEquals("http://www.w3.org/ns/formats/N-Quads", RDFSyntax.NQUADS.iri().getIRIString()); assertEquals("http://www.w3.org/ns/formats/N-Triples", RDFSyntax.NTRIPLES.iri().getIRIString()); @@ -167,7 +167,7 @@ public class RDFSyntaxTest { } @Test - public void testIriNtriplesString() throws Exception { + void testIriNtriplesString() throws Exception { assertEquals("<http://www.w3.org/ns/formats/JSON-LD>", RDFSyntax.JSONLD.iri().ntriplesString()); assertEquals("<http://www.w3.org/ns/formats/N-Quads>", RDFSyntax.NQUADS.iri().ntriplesString()); assertEquals("<http://www.w3.org/ns/formats/N-Triples>", RDFSyntax.NTRIPLES.iri().ntriplesString()); @@ -179,7 +179,7 @@ public class RDFSyntaxTest { } @Test - public void testIriToString() throws Exception { + void testIriToString() throws Exception { assertEquals("<http://www.w3.org/ns/formats/JSON-LD>", RDFSyntax.JSONLD.iri().toString()); assertEquals("<http://www.w3.org/ns/formats/N-Quads>", RDFSyntax.NQUADS.iri().toString()); assertEquals("<http://www.w3.org/ns/formats/N-Triples>", RDFSyntax.NTRIPLES.iri().toString()); @@ -191,7 +191,7 @@ public class RDFSyntaxTest { } @Test - public void testMediaType() throws Exception { + void testMediaType() throws Exception { assertEquals("application/ld+json", RDFSyntax.JSONLD.mediaType()); assertEquals("application/n-quads", RDFSyntax.NQUADS.mediaType()); assertEquals("application/n-triples", RDFSyntax.NTRIPLES.mediaType()); @@ -202,7 +202,7 @@ public class RDFSyntaxTest { } @Test - public void testMediaTypes() throws Exception { + void testMediaTypes() throws Exception { assertTrue(RDFSyntax.JSONLD.mediaTypes().contains("application/ld+json")); assertTrue(RDFSyntax.NQUADS.mediaTypes().contains("application/n-quads")); assertTrue(RDFSyntax.NTRIPLES.mediaTypes().contains("application/n-triples")); @@ -214,13 +214,13 @@ public class RDFSyntaxTest { } @Test - public void testString() throws Exception { + void testString() throws Exception { assertEquals("JSON-LD 1.0", RDFSyntax.JSONLD.toString()); assertEquals("RDF 1.1 Turtle", RDFSyntax.TURTLE.toString()); } @Test - public void testSupportsDataset() throws Exception { + void testSupportsDataset() throws Exception { assertTrue(RDFSyntax.JSONLD.supportsDataset()); assertTrue(RDFSyntax.NQUADS.supportsDataset()); assertFalse(RDFSyntax.NTRIPLES.supportsDataset()); @@ -232,7 +232,7 @@ public class RDFSyntaxTest { } @Test - public void testTitle() throws Exception { + void testTitle() throws Exception { assertEquals("JSON-LD 1.0", RDFSyntax.JSONLD.title()); assertEquals("RDF 1.1 N-Quads", RDFSyntax.NQUADS.title()); assertEquals("RDF 1.1 N-Triples", RDFSyntax.NTRIPLES.title()); diff --git a/commons-rdf-examples/src/example/IntroToRDFTest.java b/commons-rdf-examples/src/example/IntroToRDFTest.java index bd75921a..2b1ee516 100644 --- a/commons-rdf-examples/src/example/IntroToRDFTest.java +++ b/commons-rdf-examples/src/example/IntroToRDFTest.java @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test; public class IntroToRDFTest { @Test - public void testRunIntroToRDF() { + void testRunIntroToRDF() { IntroToRDF.main(new String[0]); } diff --git a/commons-rdf-examples/src/example/UserGuideTest.java b/commons-rdf-examples/src/example/UserGuideTest.java index e2ac9479..3c431245 100644 --- a/commons-rdf-examples/src/example/UserGuideTest.java +++ b/commons-rdf-examples/src/example/UserGuideTest.java @@ -50,7 +50,7 @@ public class UserGuideTest { } @Test - public void testCreating() throws Exception { + void testCreating() throws Exception { BlankNode aliceBlankNode = factory.createBlankNode(); IRI nameIri = factory.createIRI("http://example.com/name"); Literal aliceLiteral = factory.createLiteral("Alice"); @@ -63,7 +63,7 @@ public class UserGuideTest { } @Test - public void testNtriples() throws Exception { + void testNtriples() throws Exception { IRI iri = factory.createIRI("http://example.com/alice"); System.out.println(iri.getIRIString()); @@ -79,7 +79,7 @@ public class UserGuideTest { } @Test - public void testBlanknode() throws Exception { + void testBlanknode() throws Exception { BlankNode bnode = factory.createBlankNode(); System.out.println(bnode.equals(bnode)); System.out.println(bnode.equals(factory.createBlankNode())); @@ -95,7 +95,7 @@ public class UserGuideTest { } @Test - public void testLiteral() throws Exception { + void testLiteral() throws Exception { Literal literal = factory.createLiteral("Hello world!"); System.out.println(literal.ntriplesString()); @@ -128,7 +128,7 @@ public class UserGuideTest { } @Test - public void testTriple() throws Exception { + void testTriple() throws Exception { BlankNodeOrIRI subject = factory.createBlankNode(); IRI predicate = factory.createIRI("http://example.com/says"); RDFTerm object = factory.createLiteral("Hello"); @@ -157,7 +157,7 @@ public class UserGuideTest { } @Test - public void testQuad() throws Exception { + void testQuad() throws Exception { BlankNodeOrIRI graph = factory.createIRI("http://example.com/graph"); BlankNodeOrIRI subject = factory.createBlankNode(); IRI predicate = factory.createIRI("http://example.com/says"); @@ -197,7 +197,7 @@ public class UserGuideTest { } @Test - public void testGraph() throws Exception { + void testGraph() throws Exception { IRI nameIri = factory.createIRI("http://example.com/name"); BlankNode aliceBlankNode = factory.createBlankNode(); Literal aliceLiteral = factory.createLiteral("Alice"); diff --git a/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java b/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java index 38cef52b..1b52b43a 100644 --- a/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java +++ b/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/AllToAllTest.java @@ -68,7 +68,7 @@ public class AllToAllTest { */ @MethodSource("data") @ParameterizedTest(name = "{index}: {0} -> {1}") - public void testAddTermsFromOtherFactory(final Class<? extends RDF> from, final Class<? extends RDF> to) throws Exception { + void testAddTermsFromOtherFactory(final Class<? extends RDF> from, final Class<? extends RDF> to) throws Exception { RDF nodeFactory = from.getConstructor().newInstance(); RDF graphFactory = to.newInstance(); @@ -120,7 +120,7 @@ public class AllToAllTest { */ @MethodSource("data") @ParameterizedTest(name = "{index}: {0} -> {1}") - public void testAddTriplesFromOtherFactory(final Class<? extends RDF> from, final Class<? extends RDF> to) throws Exception { + void testAddTriplesFromOtherFactory(final Class<? extends RDF> from, final Class<? extends RDF> to) throws Exception { RDF nodeFactory = from.getConstructor().newInstance(); RDF graphFactory = to.newInstance(); diff --git a/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/JSONLDParsingTest.java b/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/JSONLDParsingTest.java index 88043784..e6be2058 100644 --- a/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/JSONLDParsingTest.java +++ b/commons-rdf-integration-tests/src/test/java/org/apache/commons/rdf/integrationtests/JSONLDParsingTest.java @@ -127,38 +127,38 @@ public class JSONLDParsingTest { } @Test - public void testJenaParseCached() throws Exception { + void testJenaParseCached() throws Exception { // Check if HTTPClient cache is used from // jarcache.json jenaParse(aliceCached); } @Test - public void testJenaParseEmbedded() throws Exception { + void testJenaParseEmbedded() throws Exception { jenaParse(aliceEmbedded); } @Test - public void testJsonldParseCached() throws Exception { + void testJsonldParseCached() throws Exception { // Check if HTTPClient cache is used from // jarcache.json jsonldParse(aliceCached); } @Test - public void testJsonldParseEmbedded() throws Exception { + void testJsonldParseEmbedded() throws Exception { jsonldParse(aliceEmbedded); } @Test - public void testRdf4jParseCached() throws Exception { + void testRdf4jParseCached() throws Exception { // Check if HTTPClient cache is used from // jarcache.json rdf4jParse(aliceCached); } @Test - public void testRdf4jParseEmbedded() throws Exception { + void testRdf4jParseEmbedded() throws Exception { rdf4jParse(aliceEmbedded); } } diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DatasetJenaTest.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DatasetJenaTest.java index f4823347..5d9d26b9 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DatasetJenaTest.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DatasetJenaTest.java @@ -34,7 +34,7 @@ public class DatasetJenaTest extends AbstractDatasetTest { } @Test - public void testDatasetImplToStringTest() { + void testDatasetImplToStringTest() { final RDF rdf = createFactory(); final JenaDataset jena = (JenaDataset) rdf.createDataset(); final IRI graph = rdf.createIRI("http://example.com/"); diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DefaultGraphInQuadTest.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DefaultGraphInQuadTest.java index edb30e81..6a8054d8 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DefaultGraphInQuadTest.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/DefaultGraphInQuadTest.java @@ -40,7 +40,7 @@ public class DefaultGraphInQuadTest { Node exampleJena = NodeFactory.createURI("http://example.com/"); @Test - public void testCreateFromDefaultGraphIRI() throws Exception { + void testCreateFromDefaultGraphIRI() throws Exception { final JenaIRI defaultGraph = (JenaIRI) rdf.asRDFTerm(Quad.defaultGraphIRI); final JenaQuad q = rdf.createQuad(defaultGraph, example, example, example); // NOTE: JenaRDF specially recognize this JenaIRI constant, @@ -53,7 +53,7 @@ public class DefaultGraphInQuadTest { } @Test - public void testCreateFromDefaultGraphNodeGeneratedIRINode() throws Exception { + void testCreateFromDefaultGraphNodeGeneratedIRINode() throws Exception { // What if <urn:x-arq:DefaultGraphNode> appear as an IRI instance? final IRI foreignDefaultGraph = rdf.createIRI(Quad.defaultGraphNodeGenerated.getURI()); final JenaQuad q = rdf.createQuad(foreignDefaultGraph, example, example, example); @@ -66,7 +66,7 @@ public class DefaultGraphInQuadTest { } @Test - public void testCreateFromDefaultGraphNodeGeneratedIRIString() throws Exception { + void testCreateFromDefaultGraphNodeGeneratedIRIString() throws Exception { // What if <urn:x-arq:DefaultGraphNode> appear in a non-Jena IRI? final IRI foreignDefaultGraph = simpleRDF.createIRI(Quad.defaultGraphNodeGenerated.getURI()); final JenaQuad q = rdf.createQuad(foreignDefaultGraph, example, example, example); @@ -79,7 +79,7 @@ public class DefaultGraphInQuadTest { } @Test - public void testCreateFromForeignDefaultGraph() throws Exception { + void testCreateFromForeignDefaultGraph() throws Exception { // What if <urn:x-arq:DefaultGraph> appear in a non-Jena IRI? final IRI foreignDefaultGraph = simpleRDF.createIRI(Quad.defaultGraphIRI.getURI()); final JenaQuad q = rdf.createQuad(foreignDefaultGraph, example, example, example); @@ -94,7 +94,7 @@ public class DefaultGraphInQuadTest { } @Test - public void testCreateFromNull() throws Exception { + void testCreateFromNull() throws Exception { final JenaQuad q = rdf.createQuad(null, example, example, example); assertFalse(q.getGraphName().isPresent()); assertTrue(q.asJenaQuad().isDefaultGraph()); @@ -102,7 +102,7 @@ public class DefaultGraphInQuadTest { } @Test - public void testDefaultGraphIRI() throws Exception { + void testDefaultGraphIRI() throws Exception { final Quad jenaQuad = Quad.create(Quad.defaultGraphIRI, exampleJena, exampleJena, exampleJena); final JenaQuad q = rdf.asQuad(jenaQuad); assertFalse(q.getGraphName().isPresent()); @@ -110,7 +110,7 @@ public class DefaultGraphInQuadTest { } @Test - public void testDefaultGraphNodeGenerated() throws Exception { + void testDefaultGraphNodeGenerated() throws Exception { // <urn:x-arq:DefaultGraphNode> might appear in parser output final Quad jenaQuad = Quad.create(Quad.defaultGraphNodeGenerated, exampleJena, exampleJena, exampleJena); final JenaQuad q = rdf.asQuad(jenaQuad); @@ -121,7 +121,7 @@ public class DefaultGraphInQuadTest { } @Test - public void testUnionGraph() throws Exception { + void testUnionGraph() throws Exception { // unionGraph shouldn't really appear as a quad except // in a pattern final Quad jenaQuad = Quad.create(Quad.unionGraph, exampleJena, exampleJena, exampleJena); diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFQuadTest.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFQuadTest.java index f7548364..dec34163 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFQuadTest.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFQuadTest.java @@ -33,7 +33,7 @@ public class GeneralizedRDFQuadTest { private final JenaRDF jena = new JenaRDF(); @Test - public void testAsGeneralizedQuad() throws Exception { + void testAsGeneralizedQuad() throws Exception { final Node s = NodeFactory.createLiteral("Hello"); final Node p = NodeFactory.createBlankNode(); final Node o = NodeFactory.createURI("http://example.com/ex"); @@ -47,7 +47,7 @@ public class GeneralizedRDFQuadTest { } @Test - public void testBnodeProperty() throws Exception { + void testBnodeProperty() throws Exception { final BlankNode b1 = jena.createBlankNode("b1"); final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); @@ -62,7 +62,7 @@ public class GeneralizedRDFQuadTest { } @Test - public void testLiteralGraph() throws Exception { + void testLiteralGraph() throws Exception { final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); final JenaIRI ex3 = jena.createIRI("http://example.com/ex3"); @@ -77,7 +77,7 @@ public class GeneralizedRDFQuadTest { } @Test - public void testLiteralPredicate() throws Exception { + void testLiteralPredicate() throws Exception { final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); final JenaIRI ex3 = jena.createIRI("http://example.com/ex3"); @@ -92,7 +92,7 @@ public class GeneralizedRDFQuadTest { } @Test - public void testLiteralSubject() throws Exception { + void testLiteralSubject() throws Exception { final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); final JenaIRI ex3 = jena.createIRI("http://example.com/ex3"); @@ -107,7 +107,7 @@ public class GeneralizedRDFQuadTest { } @Test - public void testLiteralSubjectDefaultGraphGen() throws Exception { + void testLiteralSubjectDefaultGraphGen() throws Exception { final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); // No need to cast to JenaIRI diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFTripleTest.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFTripleTest.java index 83e6eb1c..eb767e26 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFTripleTest.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/GeneralizedRDFTripleTest.java @@ -31,7 +31,7 @@ public class GeneralizedRDFTripleTest { private final JenaRDF jena = new JenaRDF(); @Test - public void testAsGeneralizedTriple() throws Exception { + void testAsGeneralizedTriple() throws Exception { final Node s = NodeFactory.createLiteral("Hello"); final Node p = NodeFactory.createBlankNode(); final Node o = NodeFactory.createURI("http://example.com/ex"); @@ -43,7 +43,7 @@ public class GeneralizedRDFTripleTest { } @Test - public void testBnodeProperty() throws Exception { + void testBnodeProperty() throws Exception { final BlankNode b1 = jena.createBlankNode("b1"); final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); @@ -56,7 +56,7 @@ public class GeneralizedRDFTripleTest { } @Test - public void testLiteralPredicate() throws Exception { + void testLiteralPredicate() throws Exception { final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); final JenaLiteral lit = jena.createLiteral("Hello"); @@ -69,7 +69,7 @@ public class GeneralizedRDFTripleTest { } @Test - public void testLiteralSubject() throws Exception { + void testLiteralSubject() throws Exception { final JenaIRI ex1 = jena.createIRI("http://example.com/ex1"); final JenaIRI ex2 = jena.createIRI("http://example.com/ex2"); final JenaLiteral lit = jena.createLiteral("Hello"); diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java index bbf77f2c..bd278d5a 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaRDFTest.java @@ -44,7 +44,7 @@ public class JenaRDFTest extends AbstractRDFTest { } @Test - public void testRoundTripDatasetGraphShouldMaintainIdentity() { + void testRoundTripDatasetGraphShouldMaintainIdentity() { final DatasetGraph dsg = DatasetGraphFactory.create(); final JenaDataset dataset = createFactory().asDataset(dsg); final DatasetGraph roundTrippedDSG = createFactory().asJenaDatasetGraph(dataset); @@ -52,7 +52,7 @@ public class JenaRDFTest extends AbstractRDFTest { } @Test - public void testSimpleDatasetConversion() { + void testSimpleDatasetConversion() { final SimpleRDF factory = new SimpleRDF(); final Dataset ds = factory.createDataset(); final BlankNode subject = factory.createBlankNode("b1"); diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaServiceLoaderTest.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaServiceLoaderTest.java index 718c22a4..6ccd8844 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaServiceLoaderTest.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/JenaServiceLoaderTest.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public class JenaServiceLoaderTest { @Test - public void testServiceLoaderLookup() { + void testServiceLoaderLookup() { final ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class); for (final RDF impl : loader) { if (impl instanceof JenaRDF) { diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java index ed5f6079..f64fda38 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestJenaGraphToCommonsRDFGraph.java @@ -59,7 +59,7 @@ public class TestJenaGraphToCommonsRDFGraph { } @Test - public void testJenaToCommonsRDF() throws Exception { + void testJenaToCommonsRDF() throws Exception { final org.apache.jena.graph.Graph jGraph = GraphFactory.createGraphMem(); RDFDataMgr.read(jGraph, turtleFile.toUri().toString()); diff --git a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestRDFParserBuilder.java b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestRDFParserBuilder.java index 587cd3fe..52134c07 100644 --- a/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestRDFParserBuilder.java +++ b/commons-rdf-jena/src/test/java/org/apache/commons/rdf/jena/TestRDFParserBuilder.java @@ -53,7 +53,7 @@ public class TestRDFParserBuilder { } @Test - public void testParseTurtle() throws Exception { + void testParseTurtle() throws Exception { try (final Graph g = new JenaRDF().createGraph()) { final Future<ParseResult> gFuture = new JenaRDFParser().contentType(RDFSyntax.TURTLE).source(turtleFile) .target(g).parse(); diff --git a/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdComparisonTest.java b/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdComparisonTest.java index cb8bbd3b..998b08ad 100644 --- a/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdComparisonTest.java +++ b/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdComparisonTest.java @@ -35,7 +35,7 @@ public class JsonLdComparisonTest { JsonLdRDF rdf = new JsonLdRDF(); @Test - public void testDatasetContains() throws Exception { + void testDatasetContains() throws Exception { try (final JsonLdDataset dataset = rdf.createDataset()) { final JsonLdIRI s = rdf.createIRI("http://example.com/s"); final JsonLdIRI p = rdf.createIRI("http://example.com/p"); @@ -52,7 +52,7 @@ public class JsonLdComparisonTest { } @Test - public void testDatasetRemove() throws Exception { + void testDatasetRemove() throws Exception { try (final JsonLdDataset dataset = rdf.createDataset()) { final JsonLdIRI s = rdf.createIRI("http://example.com/s"); final JsonLdIRI p = rdf.createIRI("http://example.com/p"); @@ -68,7 +68,7 @@ public class JsonLdComparisonTest { } @Test - public void testDatasetStream() throws Exception { + void testDatasetStream() throws Exception { try (final JsonLdDataset dataset = rdf.createDataset()) { final JsonLdIRI s = rdf.createIRI("http://example.com/s"); final JsonLdIRI p = rdf.createIRI("http://example.com/p"); @@ -82,7 +82,7 @@ public class JsonLdComparisonTest { } @Test - public void testGrahContains() throws Exception { + void testGrahContains() throws Exception { try (final JsonLdGraph graph = rdf.createGraph()) { final JsonLdIRI s = rdf.createIRI("http://example.com/s"); final JsonLdIRI p = rdf.createIRI("http://example.com/p"); @@ -98,7 +98,7 @@ public class JsonLdComparisonTest { } @Test - public void testLiteralEqual() throws Exception { + void testLiteralEqual() throws Exception { final JsonLdLiteral lit1 = rdf.createLiteral("Hello"); final JsonLdLiteral lit2 = rdf.createLiteral("Hello"); final JsonLdLiteral lit3 = rdf.createLiteral("Hello", Types.XSD_STRING); @@ -107,35 +107,35 @@ public class JsonLdComparisonTest { } @Test - public void testLiteralEqualLang() throws Exception { + void testLiteralEqualLang() throws Exception { final JsonLdLiteral lit1 = rdf.createLiteral("Allo Allo", "fr"); final JsonLdLiteral lit2 = rdf.createLiteral("Allo Allo", "fr"); assertEquals(lit1, lit2); } @Test - public void testLiteralEqualType() throws Exception { + void testLiteralEqualType() throws Exception { final JsonLdLiteral lit1 = rdf.createLiteral("1", Types.XSD_INTEGER); final JsonLdLiteral lit2 = rdf.createLiteral("1", Types.XSD_INTEGER); assertEquals(lit1, lit2); } @Test - public void testLiteralNotEqual() throws Exception { + void testLiteralNotEqual() throws Exception { final JsonLdLiteral lit1 = rdf.createLiteral("Hello"); final JsonLdLiteral lit2 = rdf.createLiteral("Hello there"); assertNotEquals(lit1, lit2); } @Test - public void testLiteralNotEqualLang() throws Exception { + void testLiteralNotEqualLang() throws Exception { final JsonLdLiteral lit1 = rdf.createLiteral("Hello", "en"); final JsonLdLiteral lit2 = rdf.createLiteral("Hello", "en-us"); assertNotEquals(lit1, lit2); } @Test - public void testLiteralNotEqualType() throws Exception { + void testLiteralNotEqualType() throws Exception { final JsonLdLiteral lit1 = rdf.createLiteral("1", Types.XSD_INTEGER); final JsonLdLiteral lit2 = rdf.createLiteral("2", Types.XSD_INTEGER); final JsonLdLiteral lit3 = rdf.createLiteral("1", Types.XSD_STRING); diff --git a/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java b/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java index f236a923..f81b1e6b 100644 --- a/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java +++ b/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdParserBuilderTest.java @@ -70,7 +70,7 @@ public class JsonLdParserBuilderTest { } @Test - public void testParseByPath() throws Exception { + void testParseByPath() throws Exception { final Path path = Files.createTempFile("test", ".jsonld"); path.toFile().deleteOnExit(); try (InputStream is = getClass().getResourceAsStream(TEST_JSONLD)) { @@ -84,7 +84,7 @@ public class JsonLdParserBuilderTest { } @Test - public void testParseByStream() throws Exception { + void testParseByStream() throws Exception { try (final Graph g = factory.createGraph()) { try (InputStream is = getClass().getResourceAsStream(TEST_JSONLD)) { assertNotNull(is, "Test resource not found: " + TEST_JSONLD); @@ -96,7 +96,7 @@ public class JsonLdParserBuilderTest { } @Test - public void testParseByUrl() throws Exception { + void testParseByUrl() throws Exception { final URL url = getClass().getResource(TEST_JSONLD); assertNotNull(url, "Test resource not found: " + TEST_JSONLD); final IRI iri = factory.createIRI(url.toString()); diff --git a/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java b/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java index 608a83e1..79fcab1d 100644 --- a/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java +++ b/commons-rdf-jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdServiceLoaderTest.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public class JsonLdServiceLoaderTest { @Test - public void testServiceLoaderLookup() { + void testServiceLoaderLookup() { final ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class); for (final RDF impl : loader) { if (impl instanceof JsonLdRDF) { diff --git a/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JMethodOverloadsTest.java b/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JMethodOverloadsTest.java index 129c4601..e962a4b9 100644 --- a/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JMethodOverloadsTest.java +++ b/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JMethodOverloadsTest.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; public class RDF4JMethodOverloadsTest { @Test - public void testAsRDFTermOverloads() { + void testAsRDFTermOverloads() { final RDF4J rdf4J = new RDF4J(); final ValueFactory valueFactory = SimpleValueFactory.getInstance(); diff --git a/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java b/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java index 386fb781..5b4d52f6 100644 --- a/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java +++ b/commons-rdf-rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/RDF4JServiceLoaderTest.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public class RDF4JServiceLoaderTest { @Test - public void testServiceLoaderLookup() { + void testServiceLoaderLookup() { final ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class); for (final RDF impl : loader) { if (impl instanceof RDF4J) { diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java index 376b9cf6..9a4cc6ea 100644 --- a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java +++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleDatasetTest.java @@ -36,7 +36,7 @@ public class SimpleDatasetTest extends AbstractDatasetTest { } @Test - public void testDatasetToString() { + void testDatasetToString() { assumeTrue(aliceName != null && companyName != null); //System.out.println(dataset); assertTrue( diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java index 0814d831..3243e234 100644 --- a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java +++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleGraphTest.java @@ -35,7 +35,7 @@ public class SimpleGraphTest extends AbstractGraphTest { } @Test - public void testGraphToString() { + void testGraphToString() { assumeTrue(aliceName != null && companyName != null); // System.out.println(graph); assertTrue( diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java index be9a887d..f33121a1 100644 --- a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java +++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleRDFTermFactoryTest.java @@ -33,56 +33,56 @@ import org.junit.jupiter.api.Test; public class SimpleRDFTermFactoryTest { @Test - public void testCreateBlankNode() { + void testCreateBlankNode() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final BlankNode actual = factory.createBlankNode(); assertInstanceOf(BlankNodeImpl.class, actual); } @Test - public void testCreateBlankNodeWithName() { + void testCreateBlankNodeWithName() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final BlankNode actual = factory.createBlankNode("name"); assertInstanceOf(BlankNodeImpl.class, actual); } @Test - public void testCreateGraph() { + void testCreateGraph() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final Graph actual = factory.createGraph(); assertInstanceOf(GraphImpl.class, actual); } @Test - public void testCreateIRIWithIRI() { + void testCreateIRIWithIRI() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final IRI actual = factory.createIRI(Types.RDF_LANGSTRING.getIRIString()); assertInstanceOf(Types.class, actual); } @Test - public void testCreateLiteralWithLiteral() { + void testCreateLiteralWithLiteral() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final Literal actual = factory.createLiteral("literal"); assertInstanceOf(LiteralImpl.class, actual); } @Test - public void testCreateLiteralWithLiteralAndIRI() { + void testCreateLiteralWithLiteralAndIRI() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final Literal actual = factory.createLiteral("literal", Types.RDF_PLAINLITERAL); assertInstanceOf(LiteralImpl.class, actual); } @Test - public void testCreateLiteralWithLiteralAndLanguage() { + void testCreateLiteralWithLiteralAndLanguage() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final Literal actual = factory.createLiteral("literal", "language"); assertInstanceOf(LiteralImpl.class, actual); } @Test - public void testCreateTriple() { + void testCreateTriple() { final SimpleRDFTermFactory factory = new SimpleRDFTermFactory(); final Triple actual = factory.createTriple(Types.RDF_PLAINLITERAL, Types.RDF_LANGSTRING, factory.createLiteral("literal")); assertInstanceOf(TripleImpl.class, actual); diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java index 6610c0c7..05498457 100644 --- a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java +++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/SimpleServiceLoaderTest.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.Test; public class SimpleServiceLoaderTest { @Test - public void testServiceLoaderLookup() { + void testServiceLoaderLookup() { final ServiceLoader<RDF> loader = ServiceLoader.load(RDF.class); for (final RDF impl : loader) { if (impl instanceof SimpleRDF) { diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java index d0e54225..90479066 100644 --- a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java +++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/TestWritingGraph.java @@ -91,7 +91,7 @@ public class TestWritingGraph { } @Test - public void testCountQuery() { + void testCountQuery() { final IRI subject = factory.createIRI("subj"); final IRI predicate = factory.createIRI("pred"); final long count = graph.stream(subject, predicate, null).unordered().parallel().count(); @@ -100,12 +100,12 @@ public class TestWritingGraph { } @Test - public void testCreateGraphTiming() throws Exception { + void testCreateGraphTiming() throws Exception { createGraph(); } @Test - public void testWriteGraphFromStream() throws Exception { + void testWriteGraphFromStream() throws Exception { final Path graphFile = Files.createTempFile("graph", ".nt"); if (KEEP_FILES) { System.out.println("From stream: " + graphFile); @@ -118,7 +118,7 @@ public class TestWritingGraph { } @Test - public void testWriteGraphFromStreamFiltered() throws Exception { + void testWriteGraphFromStreamFiltered() throws Exception { final Path graphFile = Files.createTempFile("graph", ".nt"); if (KEEP_FILES) { System.out.println("Filtered stream: " + graphFile); @@ -134,7 +134,7 @@ public class TestWritingGraph { } @Test - public void testWriteGraphFromStreamFilteredNoMatches() throws Exception { + void testWriteGraphFromStreamFilteredNoMatches() throws Exception { final Path graphFile = Files.createTempFile("graph-empty-", ".nt"); if (KEEP_FILES) { System.out.println("Filtered stream: " + graphFile); diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java index 13c8a511..2f8900eb 100644 --- a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java +++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/AbstractRDFParserTest.java @@ -116,14 +116,14 @@ public class AbstractRDFParserTest { } @Test - public void testGuessRDFSyntax() throws Exception { + void testGuessRDFSyntax() throws Exception { assertEquals(RDFSyntax.NTRIPLES, AbstractRDFParser.guessRDFSyntax(testNt).get()); assertEquals(RDFSyntax.TURTLE, AbstractRDFParser.guessRDFSyntax(testTtl).get()); assertFalse(AbstractRDFParser.guessRDFSyntax(testXml).isPresent()); } @Test - public void testParseBaseAndContentTypeNoSource() throws Exception { + void testParseBaseAndContentTypeNoSource() throws Exception { Throwable exception = assertThrows(IllegalStateException.class, () -> { // Can set the other options, even without source() final IRI base = dummyParser.createRDFTermFactory().createIRI("http://www.example.org/test.rdf"); @@ -135,7 +135,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseFile() throws Exception { + void testParseFile() throws Exception { try (final Graph g = factory.createGraph()) { final RDFParser parser = dummyParser.source(testNt).target(g); parser.parse().get(5, TimeUnit.SECONDS); @@ -154,7 +154,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseFileContentType() throws Exception { + void testParseFileContentType() throws Exception { try (final Graph g = factory.createGraph()) { final RDFParser parser = dummyParser.source(testNt).contentType(RDFSyntax.NTRIPLES).target(g); parser.parse().get(5, TimeUnit.SECONDS); @@ -171,7 +171,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseFileMissing() throws Exception { + void testParseFileMissing() throws Exception { assertThrows(IOException.class, () -> { Files.delete(testNt); // This should not fail yet @@ -181,7 +181,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseFileSymlink() throws Exception { + void testParseFileSymlink() throws Exception { // This test will typically not work in Windows // which requires system privileges to create symlinks assumeTrue(symlink != null); @@ -195,7 +195,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseInputStreamFailsIfBaseMissing() throws Exception { + void testParseInputStreamFailsIfBaseMissing() throws Exception { Throwable exception = assertThrows(IllegalStateException.class, () -> { final InputStream inputStream = new ByteArrayInputStream(new byte[0]); // Should not fail at this point @@ -206,7 +206,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseInputStreamWithBase() throws Exception { + void testParseInputStreamWithBase() throws Exception { final InputStream inputStream = new ByteArrayInputStream(new byte[0]); final IRI base = dummyParser.createRDFTermFactory().createIRI("http://www.example.org/test.rdf"); try (final Graph g = factory.createGraph()) { @@ -223,7 +223,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseInputStreamWithNQuads() throws Exception { + void testParseInputStreamWithNQuads() throws Exception { final InputStream inputStream = new ByteArrayInputStream(new byte[0]); try (final Graph g = factory.createGraph()) { final RDFParser parser = dummyParser.source(inputStream).contentType(RDFSyntax.NQUADS).target(g); @@ -239,7 +239,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseIRI() throws Exception { + void testParseIRI() throws Exception { final IRI iri = dummyParser.createRDFTermFactory().createIRI("http://www.example.net/test.ttl"); try (final Graph g = factory.createGraph()) { final RDFParser parser = dummyParser.source(iri).target(g); @@ -257,7 +257,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseIRIBaseContentType() throws Exception { + void testParseIRIBaseContentType() throws Exception { final IRI iri = dummyParser.createRDFTermFactory().createIRI("http://www.example.net/test.ttl"); try (final Graph g = factory.createGraph()) { final RDFParser parser = dummyParser.source(iri).base(iri).contentType(RDFSyntax.TURTLE).target(g); @@ -271,7 +271,7 @@ public class AbstractRDFParserTest { } @Test - public void testParseNoSource() throws Exception { + void testParseNoSource() throws Exception { assertThrows(IllegalStateException.class, dummyParser::parse); } diff --git a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/RDFParseExceptionTest.java b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/RDFParseExceptionTest.java index 2d38ea31..baab29ff 100644 --- a/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/RDFParseExceptionTest.java +++ b/commons-rdf-simple/src/test/java/org/apache/commons/rdf/simple/experimental/RDFParseExceptionTest.java @@ -34,7 +34,7 @@ public class RDFParseExceptionTest { RDFParser rdfParser = new DummyRDFParserBuilder(); @Test - public void testGetCauseAndMessage() { + void testGetCauseAndMessage() { final IOException e = new IOException(); e.fillInStackTrace(); assertEquals(null, new RDFParseException(rdfParser).getCause()); @@ -44,7 +44,7 @@ public class RDFParseExceptionTest { } @Test - public void testGetCauseNoMessage() { + void testGetCauseNoMessage() { final IOException e = new IOException(); e.fillInStackTrace(); assertEquals(null, new RDFParseException(rdfParser).getCause()); @@ -53,14 +53,14 @@ public class RDFParseExceptionTest { } @Test - public void testGetMessage() { + void testGetMessage() { assertEquals(null, new RDFParseException(rdfParser).getMessage()); assertEquals(null, new RDFParseException(rdfParser, (String) null).getMessage()); assertEquals("a", new RDFParseException(rdfParser, "a").getMessage()); } @Test - public void testGetRDFParser() { + void testGetRDFParser() { assertEquals(rdfParser, new RDFParseException(rdfParser).getRDFParserBuilder()); } }