Skip to content

Commit

Permalink
GH-4544 Openrewrite migration to junit5. Junit4 is still used in a fe…
Browse files Browse the repository at this point in the history
…w places, one for lucene or guavatestlibs that don't have an junit4 equivalent

Signed-off-by: Jerven Bolleman <[email protected]>
  • Loading branch information
JervenBolleman committed Nov 26, 2023
1 parent bb7ac22 commit 36cb4ef
Show file tree
Hide file tree
Showing 59 changed files with 617 additions and 589 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

@ClusterScope(numDataNodes = 1)
public class ElasticsearchSailGeoSPARQLTest extends ESIntegTestCase {

AbstractLuceneSailGeoSPARQLTest delegateTest;

@Before
@BeforeEach
@Override
public void setUp() throws Exception {
super.setUp();
Expand Down Expand Up @@ -64,7 +64,7 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
return List.of(ReindexPlugin.class);
}

@After
@AfterEach
@Override
public void tearDown() throws Exception {
try {
Expand All @@ -75,30 +75,32 @@ public void tearDown() throws Exception {
}

@Test
public void testTriplesStored() {
void testTriplesStored() {
delegateTest.testTriplesStored();
}

@Test
public void testDistanceQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
void testDistanceQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testDistanceQuery();
}

@Test
public void testComplexDistanceQuery()
void testComplexDistanceQuery()
throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testComplexDistanceQuery();
}

// JTS is required
@Test
@Ignore // JTS is required
public void testIntersectionQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
@Disabled
void testIntersectionQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testIntersectionQuery();
}

// JTS is required
@Test
@Ignore // JTS is required
public void testComplexIntersectionQuery()
@Disabled
void testComplexIntersectionQuery()
throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testComplexIntersectionQuery();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

@ClusterScope(numDataNodes = 1)
public class ElasticsearchSailIndexedPropertiesTest extends ESIntegTestCase {

AbstractLuceneSailIndexedPropertiesTest delegateTest;

@Before
@BeforeEach
@Override
public void setUp() throws Exception {
super.setUp();
Expand Down Expand Up @@ -63,7 +63,7 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
return List.of(ReindexPlugin.class);
}

@After
@AfterEach
@Override
public void tearDown() throws Exception {
try {
Expand All @@ -74,12 +74,12 @@ public void tearDown() throws Exception {
}

@Test
public void testTriplesStored() {
void testTriplesStored() {
delegateTest.testTriplesStored();
}

@Test
public void testRegularQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
void testRegularQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testRegularQuery();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

@ClusterScope(numDataNodes = 1)
public class ElasticsearchSailTest extends ESIntegTestCase {

AbstractLuceneSailTest delegateTest;

@Before
@BeforeEach
@Override
public void setUp() throws Exception {
super.setUp();
Expand Down Expand Up @@ -63,7 +63,7 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
return List.of(ReindexPlugin.class);
}

@After
@AfterEach
@Override
public void tearDown() throws Exception {
try {
Expand All @@ -74,96 +74,96 @@ public void tearDown() throws Exception {
}

@Test
public void testTriplesStored() {
void testTriplesStored() {
delegateTest.testTriplesStored();
}

@Test
public void testRegularQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
void testRegularQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testRegularQuery();
}

@Test
public void testComplexQueryOne() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
void testComplexQueryOne() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testComplexQueryOne();
}

@Test
public void testComplexQueryTwo() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
void testComplexQueryTwo() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testComplexQueryTwo();
}

@Test
public void testMultipleLuceneQueries()
void testMultipleLuceneQueries()
throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testMultipleLuceneQueries();
}

@Test
public void testPredicateLuceneQueries()
void testPredicateLuceneQueries()
throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testPredicateLuceneQueries();
}

@Test
public void testSnippetQueries() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
void testSnippetQueries() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testSnippetQueries();
}

@Test
public void testSnippetLimitedToPredicate()
void testSnippetLimitedToPredicate()
throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testSnippetLimitedToPredicate();
}

@Test
public void testGraphQuery() throws QueryEvaluationException, MalformedQueryException, RepositoryException {
void testGraphQuery() throws QueryEvaluationException, MalformedQueryException, RepositoryException {
delegateTest.testGraphQuery();
}

@Test
public void testQueryWithSpecifiedSubject()
void testQueryWithSpecifiedSubject()
throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testQueryWithSpecifiedSubject();
}

@Test
public void testUnionQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
void testUnionQuery() throws RepositoryException, MalformedQueryException, QueryEvaluationException {
delegateTest.testUnionQuery();
}

@Test
public void testContextHandling() {
void testContextHandling() {
delegateTest.testContextHandling();
}

@Test
public void testConcurrentReadingAndWriting() {
void testConcurrentReadingAndWriting() {
delegateTest.testConcurrentReadingAndWriting();
}

@Test
public void testNullContextHandling() {
void testNullContextHandling() {
delegateTest.testNullContextHandling();
}

@Test
public void testFuzzyQuery() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
void testFuzzyQuery() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testFuzzyQuery();
}

@Test
public void testReindexing() {
void testReindexing() {
delegateTest.testReindexing();
}

@Test
public void testPropertyVar() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
void testPropertyVar() throws MalformedQueryException, RepositoryException, QueryEvaluationException {
delegateTest.testPropertyVar();
}

@Test
public void testMultithreadedAdd() throws InterruptedException {
void testMultithreadedAdd() throws InterruptedException {
delegateTest.testMultithreadedAdd();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import org.eclipse.rdf4j.repository.http.config.HTTPRepositoryConfig;
import org.eclipse.rdf4j.repository.http.config.HTTPRepositoryFactory;
import org.eclipse.rdf4j.testsuite.repository.OptimisticIsolationTest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;

/**
* @author jeen
Expand All @@ -24,7 +24,7 @@ public class HTTPRepositoryOptimisticIsolationTest extends OptimisticIsolationTe

private static HTTPMemServer server;

@BeforeClass
@BeforeAll
public static void setUpClass() throws Exception {
System.setProperty("org.eclipse.rdf4j.repository.debug", "true");

Expand All @@ -46,7 +46,7 @@ public RepositoryImplConfig getConfig() {
});
}

@AfterClass
@AfterAll
public static void tearDown() throws Exception {
setRepositoryFactory(null);
server.stop();
Expand Down
Loading

0 comments on commit 36cb4ef

Please sign in to comment.