You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2023/05/30 08:55:37 UTC
[camel] 01/03: CAMEL-19402: test-infra - Move before/after all callbacks in TestService
This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a commit to branch CAMEL-19402/reduce-boilerplate-code
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 69951c370f1d0bdda94bd31bec599a9a2ec62a71
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Tue May 30 10:16:37 2023 +0200
CAMEL-19402: test-infra - Move before/after all callbacks in TestService
---
.../test/infra/arangodb/services/ArangoDBService.java | 16 +---------------
.../test/infra/artemis/services/ArtemisService.java | 15 +--------------
.../camel/test/infra/aws/common/services/AWSService.java | 16 +---------------
.../test/infra/azure/common/services/AzureService.java | 16 +---------------
.../test/infra/cassandra/services/CassandraService.java | 16 +---------------
.../infra/chatscript/services/ChatScriptService.java | 15 +--------------
.../camel/test/infra/common/services/TestService.java | 16 +++++++++++++++-
.../camel/test/infra/consul/services/ConsulService.java | 16 +---------------
.../test/infra/couchbase/services/CouchbaseService.java | 16 +---------------
.../test/infra/couchdb/services/CouchDbService.java | 16 +---------------
.../elasticsearch/services/ElasticSearchService.java | 16 +---------------
.../camel/test/infra/etcd3/services/Etcd3Service.java | 16 +---------------
.../camel/test/infra/fhir/services/FhirService.java | 16 +---------------
.../apache/camel/test/infra/ftp/services/FtpService.java | 4 +---
.../google/pubsub/services/GooglePubSubService.java | 16 +---------------
.../hashicorp/vault/services/HashicorpVaultService.java | 16 +---------------
.../camel/test/infra/hdfs/v2/services/HDFSService.java | 16 +---------------
.../camel/test/infra/ignite/services/IgniteService.java | 15 +--------------
.../infra/infinispan/services/InfinispanService.java | 16 +---------------
.../camel/test/infra/jdbc/services/JDBCService.java | 16 +---------------
.../camel/test/infra/jetty/services/JettyService.java | 15 +--------------
.../camel/test/infra/kafka/services/KafkaService.java | 13 +++++--------
.../test/infra/messaging/services/MessagingService.java | 16 +---------------
.../lra/services/MicroprofileLRAService.java | 16 +---------------
.../camel/test/infra/minio/services/MinioService.java | 16 +---------------
.../test/infra/mongodb/services/MongoDBService.java | 16 +---------------
.../test/infra/mosquitto/services/MosquittoService.java | 16 +---------------
.../camel/test/infra/nats/services/NatsService.java | 16 +---------------
.../test/infra/openldap/services/OpenldapService.java | 16 +---------------
.../test/infra/postgres/services/PostgresService.java | 16 +---------------
.../camel/test/infra/pulsar/services/PulsarService.java | 16 +---------------
.../test/infra/rabbitmq/services/RabbitMQService.java | 16 +---------------
.../camel/test/infra/redis/services/RedisService.java | 4 +---
.../camel/test/infra/solr/services/SolrService.java | 16 +---------------
.../camel/test/infra/xmpp/services/XmppService.java | 16 +---------------
.../test/infra/zookeeper/services/ZooKeeperService.java | 16 +---------------
36 files changed, 54 insertions(+), 491 deletions(-)
diff --git a/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBService.java b/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBService.java
index 367cd2acc55..06f9fcfea3e 100644
--- a/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBService.java
+++ b/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBService.java
@@ -17,15 +17,11 @@
package org.apache.camel.test.infra.arangodb.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for ArangoDB
*/
-public interface ArangoDBService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface ArangoDBService extends TestService {
int getPort();
@@ -34,14 +30,4 @@ public interface ArangoDBService extends BeforeAllCallback, AfterAllCallback, Te
default String getServiceAddress() {
return String.format("%s:%d", getHost(), getPort());
}
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisService.java b/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisService.java
index 5a20c1ddad3..9b14bb0ef84 100644
--- a/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisService.java
+++ b/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisService.java
@@ -20,14 +20,11 @@ import org.apache.activemq.artemis.core.server.QueueQueryResult;
import org.apache.camel.test.infra.artemis.common.ArtemisProperties;
import org.apache.camel.test.infra.common.services.TestService;
import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.AfterEachCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
-public interface ArtemisService
- extends BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback, TestService {
+public interface ArtemisService extends BeforeEachCallback, AfterEachCallback, TestService {
String serviceAddress();
@@ -45,16 +42,6 @@ public interface ArtemisService
System.setProperty(ArtemisProperties.ARTEMIS_PASSWORD, userName());
}
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
-
@Override
default void afterEach(ExtensionContext extensionContext) throws Exception {
TestServiceUtil.tryShutdown(this, extensionContext);
diff --git a/test-infra/camel-test-infra-aws-common/src/test/java/org/apache/camel/test/infra/aws/common/services/AWSService.java b/test-infra/camel-test-infra-aws-common/src/test/java/org/apache/camel/test/infra/aws/common/services/AWSService.java
index 0db734bf4e1..f2ee9277877 100644
--- a/test-infra/camel-test-infra-aws-common/src/test/java/org/apache/camel/test/infra/aws/common/services/AWSService.java
+++ b/test-infra/camel-test-infra-aws-common/src/test/java/org/apache/camel/test/infra/aws/common/services/AWSService.java
@@ -20,22 +20,8 @@ package org.apache.camel.test.infra.aws.common.services;
import java.util.Properties;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface AWSService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface AWSService extends TestService {
Properties getConnectionProperties();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-azure-common/src/test/java/org/apache/camel/test/infra/azure/common/services/AzureService.java b/test-infra/camel-test-infra-azure-common/src/test/java/org/apache/camel/test/infra/azure/common/services/AzureService.java
index 9a5da9c0d68..39c46afa60d 100644
--- a/test-infra/camel-test-infra-azure-common/src/test/java/org/apache/camel/test/infra/azure/common/services/AzureService.java
+++ b/test-infra/camel-test-infra-azure-common/src/test/java/org/apache/camel/test/infra/azure/common/services/AzureService.java
@@ -19,12 +19,8 @@ package org.apache.camel.test.infra.azure.common.services;
import org.apache.camel.test.infra.azure.common.AzureCredentialsHolder;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface AzureService extends TestService, BeforeAllCallback, AfterAllCallback {
+public interface AzureService extends TestService {
/**
* Gets the credentials for the test service
@@ -32,14 +28,4 @@ public interface AzureService extends TestService, BeforeAllCallback, AfterAllCa
* @return
*/
AzureCredentialsHolder azureCredentials();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraService.java b/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraService.java
index 2ef228f47dc..a915390133e 100644
--- a/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraService.java
+++ b/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraService.java
@@ -18,15 +18,11 @@
package org.apache.camel.test.infra.cassandra.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Represents an endpoint to a Cassandra instance
*/
-public interface CassandraService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface CassandraService extends TestService {
int getCQL3Port();
@@ -35,14 +31,4 @@ public interface CassandraService extends BeforeAllCallback, AfterAllCallback, T
}
String getCassandraHost();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-chatscript/src/test/java/org/apache/camel/test/infra/chatscript/services/ChatScriptService.java b/test-infra/camel-test-infra-chatscript/src/test/java/org/apache/camel/test/infra/chatscript/services/ChatScriptService.java
index e85214a7e5b..860e87b761e 100644
--- a/test-infra/camel-test-infra-chatscript/src/test/java/org/apache/camel/test/infra/chatscript/services/ChatScriptService.java
+++ b/test-infra/camel-test-infra-chatscript/src/test/java/org/apache/camel/test/infra/chatscript/services/ChatScriptService.java
@@ -18,30 +18,17 @@ package org.apache.camel.test.infra.chatscript.services;
import org.apache.camel.test.infra.common.services.TestService;
import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.AfterEachCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for ChatScript
*/
-public interface ChatScriptService
- extends BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback, TestService {
+public interface ChatScriptService extends BeforeEachCallback, AfterEachCallback, TestService {
String serviceAddress();
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
-
@Override
default void afterEach(ExtensionContext extensionContext) throws Exception {
TestServiceUtil.tryShutdown(this, extensionContext);
diff --git a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java
index 737cbef5d29..552489b3deb 100644
--- a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java
+++ b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestService.java
@@ -17,7 +17,11 @@
package org.apache.camel.test.infra.common.services;
-public interface TestService extends AutoCloseable {
+import org.junit.jupiter.api.extension.AfterAllCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+
+public interface TestService extends AutoCloseable, BeforeAllCallback, AfterAllCallback {
/**
* Register service properties (such as using System.setProperties) so that they can be resolved at distance (ie.:
@@ -40,4 +44,14 @@ public interface TestService extends AutoCloseable {
default void close() {
shutdown();
}
+
+ @Override
+ default void beforeAll(ExtensionContext extensionContext) throws Exception {
+ TestServiceUtil.tryInitialize(this, extensionContext);
+ }
+
+ @Override
+ default void afterAll(ExtensionContext extensionContext) throws Exception {
+ TestServiceUtil.tryShutdown(this, extensionContext);
+ }
}
diff --git a/test-infra/camel-test-infra-consul/src/test/java/org/apache/camel/test/infra/consul/services/ConsulService.java b/test-infra/camel-test-infra-consul/src/test/java/org/apache/camel/test/infra/consul/services/ConsulService.java
index 937acd1b7bc..ee646ce58eb 100644
--- a/test-infra/camel-test-infra-consul/src/test/java/org/apache/camel/test/infra/consul/services/ConsulService.java
+++ b/test-infra/camel-test-infra-consul/src/test/java/org/apache/camel/test/infra/consul/services/ConsulService.java
@@ -17,29 +17,15 @@
package org.apache.camel.test.infra.consul.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Consul
*/
-public interface ConsulService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface ConsulService extends TestService {
String getConsulUrl();
String host();
int port();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-couchbase/src/test/java/org/apache/camel/test/infra/couchbase/services/CouchbaseService.java b/test-infra/camel-test-infra-couchbase/src/test/java/org/apache/camel/test/infra/couchbase/services/CouchbaseService.java
index 43514c1d82f..37f27710fb5 100644
--- a/test-infra/camel-test-infra-couchbase/src/test/java/org/apache/camel/test/infra/couchbase/services/CouchbaseService.java
+++ b/test-infra/camel-test-infra-couchbase/src/test/java/org/apache/camel/test/infra/couchbase/services/CouchbaseService.java
@@ -18,12 +18,8 @@
package org.apache.camel.test.infra.couchbase.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface CouchbaseService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface CouchbaseService extends TestService {
String getConnectionString();
@@ -34,14 +30,4 @@ public interface CouchbaseService extends BeforeAllCallback, AfterAllCallback, T
String getHostname();
int getPort();
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-couchdb/src/test/java/org/apache/camel/test/infra/couchdb/services/CouchDbService.java b/test-infra/camel-test-infra-couchdb/src/test/java/org/apache/camel/test/infra/couchdb/services/CouchDbService.java
index 95f4a0edcb2..1aea202244f 100644
--- a/test-infra/camel-test-infra-couchdb/src/test/java/org/apache/camel/test/infra/couchdb/services/CouchDbService.java
+++ b/test-infra/camel-test-infra-couchdb/src/test/java/org/apache/camel/test/infra/couchdb/services/CouchDbService.java
@@ -17,15 +17,11 @@
package org.apache.camel.test.infra.couchdb.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for CouchDb
*/
-public interface CouchDbService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface CouchDbService extends TestService {
String host();
@@ -34,14 +30,4 @@ public interface CouchDbService extends BeforeAllCallback, AfterAllCallback, Tes
default String getServiceAddress() {
return String.format("%s:%d", host(), port());
}
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-elasticsearch/src/test/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchService.java b/test-infra/camel-test-infra-elasticsearch/src/test/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchService.java
index 5fbc61259b8..05dff9e4521 100644
--- a/test-infra/camel-test-infra-elasticsearch/src/test/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchService.java
+++ b/test-infra/camel-test-infra-elasticsearch/src/test/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchService.java
@@ -18,12 +18,8 @@
package org.apache.camel.test.infra.elasticsearch.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface ElasticSearchService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface ElasticSearchService extends TestService {
int getPort();
@@ -32,14 +28,4 @@ public interface ElasticSearchService extends BeforeAllCallback, AfterAllCallbac
default String getHttpHostAddress() {
return String.format("%s:%d", getElasticSearchHost(), getPort());
}
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-etcd3/src/test/java/org/apache/camel/test/infra/etcd3/services/Etcd3Service.java b/test-infra/camel-test-infra-etcd3/src/test/java/org/apache/camel/test/infra/etcd3/services/Etcd3Service.java
index bb0f0f55783..0c79c77653b 100644
--- a/test-infra/camel-test-infra-etcd3/src/test/java/org/apache/camel/test/infra/etcd3/services/Etcd3Service.java
+++ b/test-infra/camel-test-infra-etcd3/src/test/java/org/apache/camel/test/infra/etcd3/services/Etcd3Service.java
@@ -17,25 +17,11 @@
package org.apache.camel.test.infra.etcd3.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for EtcD
*/
-public interface Etcd3Service extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface Etcd3Service extends TestService {
String getServiceAddress();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-fhir/src/test/java/org/apache/camel/test/infra/fhir/services/FhirService.java b/test-infra/camel-test-infra-fhir/src/test/java/org/apache/camel/test/infra/fhir/services/FhirService.java
index e9eda5cfec8..75bf932d9dc 100644
--- a/test-infra/camel-test-infra-fhir/src/test/java/org/apache/camel/test/infra/fhir/services/FhirService.java
+++ b/test-infra/camel-test-infra-fhir/src/test/java/org/apache/camel/test/infra/fhir/services/FhirService.java
@@ -17,29 +17,15 @@
package org.apache.camel.test.infra.fhir.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for FHIR
*/
-public interface FhirService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface FhirService extends TestService {
String getServiceBaseURL();
String getHost();
Integer getPort();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-ftp/src/test/java/org/apache/camel/test/infra/ftp/services/FtpService.java b/test-infra/camel-test-infra-ftp/src/test/java/org/apache/camel/test/infra/ftp/services/FtpService.java
index 2ef6dcbd833..e9aa1cc640c 100644
--- a/test-infra/camel-test-infra-ftp/src/test/java/org/apache/camel/test/infra/ftp/services/FtpService.java
+++ b/test-infra/camel-test-infra-ftp/src/test/java/org/apache/camel/test/infra/ftp/services/FtpService.java
@@ -19,15 +19,13 @@ package org.apache.camel.test.infra.ftp.services;
import java.nio.file.Path;
import org.apache.camel.test.infra.common.services.TestService;
-import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.AfterEachCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
/**
* Test infra service for Ftp
*/
-public interface FtpService extends TestService, BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback {
+public interface FtpService extends TestService, BeforeEachCallback, AfterEachCallback {
int getPort();
Path getFtpRootDir();
diff --git a/test-infra/camel-test-infra-google-pubsub/src/test/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubService.java b/test-infra/camel-test-infra-google-pubsub/src/test/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubService.java
index 546ede0b4ed..a25a8391a96 100644
--- a/test-infra/camel-test-infra-google-pubsub/src/test/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubService.java
+++ b/test-infra/camel-test-infra-google-pubsub/src/test/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubService.java
@@ -17,25 +17,11 @@
package org.apache.camel.test.infra.google.pubsub.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for GooglePubSub
*/
-public interface GooglePubSubService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface GooglePubSubService extends TestService {
String getServiceAddress();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-hashicorp-vault/src/test/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultService.java b/test-infra/camel-test-infra-hashicorp-vault/src/test/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultService.java
index 221c4cdece2..ce2fc4ba883 100644
--- a/test-infra/camel-test-infra-hashicorp-vault/src/test/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultService.java
+++ b/test-infra/camel-test-infra-hashicorp-vault/src/test/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultService.java
@@ -17,29 +17,15 @@
package org.apache.camel.test.infra.hashicorp.vault.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Infinispan
*/
-public interface HashicorpVaultService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface HashicorpVaultService extends TestService {
String token();
int port();
String host();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-hdfs/src/test/java/org/apache/camel/test/infra/hdfs/v2/services/HDFSService.java b/test-infra/camel-test-infra-hdfs/src/test/java/org/apache/camel/test/infra/hdfs/v2/services/HDFSService.java
index 58c0ab07fc6..ffd19d72c99 100644
--- a/test-infra/camel-test-infra-hdfs/src/test/java/org/apache/camel/test/infra/hdfs/v2/services/HDFSService.java
+++ b/test-infra/camel-test-infra-hdfs/src/test/java/org/apache/camel/test/infra/hdfs/v2/services/HDFSService.java
@@ -18,12 +18,8 @@
package org.apache.camel.test.infra.hdfs.v2.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface HDFSService extends TestService, BeforeAllCallback, AfterAllCallback {
+public interface HDFSService extends TestService {
/**
* Gets the hostname of the HDFS server
@@ -38,14 +34,4 @@ public interface HDFSService extends TestService, BeforeAllCallback, AfterAllCal
* @return
*/
int getPort();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-ignite/src/test/java/org/apache/camel/test/infra/ignite/services/IgniteService.java b/test-infra/camel-test-infra-ignite/src/test/java/org/apache/camel/test/infra/ignite/services/IgniteService.java
index 4fe19da0e9e..3a8a7794b8c 100644
--- a/test-infra/camel-test-infra-ignite/src/test/java/org/apache/camel/test/infra/ignite/services/IgniteService.java
+++ b/test-infra/camel-test-infra-ignite/src/test/java/org/apache/camel/test/infra/ignite/services/IgniteService.java
@@ -17,25 +17,12 @@
package org.apache.camel.test.infra.ignite.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
import org.apache.ignite.configuration.IgniteConfiguration;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Ignite
*/
-public interface IgniteService extends BeforeAllCallback, AfterAllCallback, TestService {
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
+public interface IgniteService extends TestService {
IgniteConfiguration createConfiguration();
}
diff --git a/test-infra/camel-test-infra-infinispan/src/test/java/org/apache/camel/test/infra/infinispan/services/InfinispanService.java b/test-infra/camel-test-infra-infinispan/src/test/java/org/apache/camel/test/infra/infinispan/services/InfinispanService.java
index c15b767beca..4816253a410 100644
--- a/test-infra/camel-test-infra-infinispan/src/test/java/org/apache/camel/test/infra/infinispan/services/InfinispanService.java
+++ b/test-infra/camel-test-infra-infinispan/src/test/java/org/apache/camel/test/infra/infinispan/services/InfinispanService.java
@@ -17,15 +17,11 @@
package org.apache.camel.test.infra.infinispan.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Infinispan
*/
-public interface InfinispanService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface InfinispanService extends TestService {
String username();
@@ -36,14 +32,4 @@ public interface InfinispanService extends BeforeAllCallback, AfterAllCallback,
String host();
String getServiceAddress();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-jdbc/src/test/java/org/apache/camel/test/infra/jdbc/services/JDBCService.java b/test-infra/camel-test-infra-jdbc/src/test/java/org/apache/camel/test/infra/jdbc/services/JDBCService.java
index ad7a2d8154f..6ebff572305 100644
--- a/test-infra/camel-test-infra-jdbc/src/test/java/org/apache/camel/test/infra/jdbc/services/JDBCService.java
+++ b/test-infra/camel-test-infra-jdbc/src/test/java/org/apache/camel/test/infra/jdbc/services/JDBCService.java
@@ -18,22 +18,8 @@
package org.apache.camel.test.infra.jdbc.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface JDBCService extends TestService, BeforeAllCallback, AfterAllCallback {
+public interface JDBCService extends TestService {
String jdbcUrl();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyService.java b/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyService.java
index c10a679e48c..4c3e4a82325 100644
--- a/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyService.java
+++ b/test-infra/camel-test-infra-jetty/src/test/java/org/apache/camel/test/infra/jetty/services/JettyService.java
@@ -17,24 +17,11 @@
package org.apache.camel.test.infra.jetty.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Jetty
*/
-public interface JettyService extends BeforeAllCallback, AfterAllCallback, TestService {
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
+public interface JettyService extends TestService {
/**
* Gets the port used to run the service
diff --git a/test-infra/camel-test-infra-kafka/src/test/java/org/apache/camel/test/infra/kafka/services/KafkaService.java b/test-infra/camel-test-infra-kafka/src/test/java/org/apache/camel/test/infra/kafka/services/KafkaService.java
index 57baa6311c8..38bc88bc533 100644
--- a/test-infra/camel-test-infra-kafka/src/test/java/org/apache/camel/test/infra/kafka/services/KafkaService.java
+++ b/test-infra/camel-test-infra-kafka/src/test/java/org/apache/camel/test/infra/kafka/services/KafkaService.java
@@ -18,9 +18,7 @@
package org.apache.camel.test.infra.kafka.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.AfterTestExecutionCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.slf4j.Logger;
@@ -29,8 +27,7 @@ import org.slf4j.LoggerFactory;
/**
* Provides an interface for any type of Kafka service: remote instances, local container, etc
*/
-public interface KafkaService
- extends TestService, BeforeAllCallback, BeforeTestExecutionCallback, AfterAllCallback, AfterTestExecutionCallback {
+public interface KafkaService extends TestService, BeforeTestExecutionCallback, AfterTestExecutionCallback {
/**
* Gets the addresses of the bootstrap servers in the format host1:port,host2:port,etc
@@ -40,7 +37,7 @@ public interface KafkaService
String getBootstrapServers();
@Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
+ default void beforeAll(ExtensionContext extensionContext) {
try {
initialize();
} catch (Exception e) {
@@ -55,17 +52,17 @@ public interface KafkaService
}
@Override
- default void beforeTestExecution(ExtensionContext extensionContext) throws Exception {
+ default void beforeTestExecution(ExtensionContext extensionContext) {
//no op
}
@Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
+ default void afterAll(ExtensionContext extensionContext) {
shutdown();
}
@Override
- default void afterTestExecution(ExtensionContext context) throws Exception {
+ default void afterTestExecution(ExtensionContext context) {
//no op
}
}
diff --git a/test-infra/camel-test-infra-messaging-common/src/test/java/org/apache/camel/test/infra/messaging/services/MessagingService.java b/test-infra/camel-test-infra-messaging-common/src/test/java/org/apache/camel/test/infra/messaging/services/MessagingService.java
index 1480e8dbf5f..27d4c7d4d58 100644
--- a/test-infra/camel-test-infra-messaging-common/src/test/java/org/apache/camel/test/infra/messaging/services/MessagingService.java
+++ b/test-infra/camel-test-infra-messaging-common/src/test/java/org/apache/camel/test/infra/messaging/services/MessagingService.java
@@ -18,12 +18,8 @@
package org.apache.camel.test.infra.messaging.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface MessagingService extends TestService, BeforeAllCallback, AfterAllCallback {
+public interface MessagingService extends TestService {
/**
* Gets the default endpoint for the messaging service (ie.: amqp://host:port, or tcp://host:port, etc)
@@ -31,14 +27,4 @@ public interface MessagingService extends TestService, BeforeAllCallback, AfterA
* @return the endpoint URL as a string in the specific format used by the service
*/
String defaultEndpoint();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-microprofile-lra/src/test/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRAService.java b/test-infra/camel-test-infra-microprofile-lra/src/test/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRAService.java
index 785b51cac07..b91322c50c9 100644
--- a/test-infra/camel-test-infra-microprofile-lra/src/test/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRAService.java
+++ b/test-infra/camel-test-infra-microprofile-lra/src/test/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRAService.java
@@ -17,15 +17,11 @@
package org.apache.camel.test.infra.microprofile.lra.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Microprofile LRA
*/
-public interface MicroprofileLRAService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface MicroprofileLRAService extends TestService {
String host();
@@ -36,14 +32,4 @@ public interface MicroprofileLRAService extends BeforeAllCallback, AfterAllCallb
default String getServiceAddress() {
return String.format("http://%s:%d", host(), port());
}
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-minio/src/test/java/org/apache/camel/test/infra/minio/services/MinioService.java b/test-infra/camel-test-infra-minio/src/test/java/org/apache/camel/test/infra/minio/services/MinioService.java
index c69eb9dd29f..a47fd0b28da 100644
--- a/test-infra/camel-test-infra-minio/src/test/java/org/apache/camel/test/infra/minio/services/MinioService.java
+++ b/test-infra/camel-test-infra-minio/src/test/java/org/apache/camel/test/infra/minio/services/MinioService.java
@@ -17,15 +17,11 @@
package org.apache.camel.test.infra.minio.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Minio
*/
-public interface MinioService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface MinioService extends TestService {
String secretKey();
@@ -34,14 +30,4 @@ public interface MinioService extends BeforeAllCallback, AfterAllCallback, TestS
int port();
String host();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBService.java b/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBService.java
index f3a0addbad7..9ce4cd56211 100644
--- a/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBService.java
+++ b/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBService.java
@@ -18,12 +18,8 @@
package org.apache.camel.test.infra.mongodb.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface MongoDBService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface MongoDBService extends TestService {
/**
* The replica set URL in the format mongodb://host:port
@@ -38,14 +34,4 @@ public interface MongoDBService extends BeforeAllCallback, AfterAllCallback, Tes
* @return the connection address
*/
String getConnectionAddress();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-mosquitto/src/test/java/org/apache/camel/test/infra/mosquitto/services/MosquittoService.java b/test-infra/camel-test-infra-mosquitto/src/test/java/org/apache/camel/test/infra/mosquitto/services/MosquittoService.java
index dbef19867ed..ba9aeda6724 100644
--- a/test-infra/camel-test-infra-mosquitto/src/test/java/org/apache/camel/test/infra/mosquitto/services/MosquittoService.java
+++ b/test-infra/camel-test-infra-mosquitto/src/test/java/org/apache/camel/test/infra/mosquitto/services/MosquittoService.java
@@ -17,25 +17,11 @@
package org.apache.camel.test.infra.mosquitto.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Mosquitto
*/
-public interface MosquittoService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface MosquittoService extends TestService {
Integer getPort();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-nats/src/test/java/org/apache/camel/test/infra/nats/services/NatsService.java b/test-infra/camel-test-infra-nats/src/test/java/org/apache/camel/test/infra/nats/services/NatsService.java
index fe0653097fc..8126d31ee09 100644
--- a/test-infra/camel-test-infra-nats/src/test/java/org/apache/camel/test/infra/nats/services/NatsService.java
+++ b/test-infra/camel-test-infra-nats/src/test/java/org/apache/camel/test/infra/nats/services/NatsService.java
@@ -17,25 +17,11 @@
package org.apache.camel.test.infra.nats.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Nats
*/
-public interface NatsService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface NatsService extends TestService {
String getServiceAddress();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-openldap/src/test/java/org/apache/camel/test/infra/openldap/services/OpenldapService.java b/test-infra/camel-test-infra-openldap/src/test/java/org/apache/camel/test/infra/openldap/services/OpenldapService.java
index e329efc7264..26eedc7ce45 100644
--- a/test-infra/camel-test-infra-openldap/src/test/java/org/apache/camel/test/infra/openldap/services/OpenldapService.java
+++ b/test-infra/camel-test-infra-openldap/src/test/java/org/apache/camel/test/infra/openldap/services/OpenldapService.java
@@ -17,29 +17,15 @@
package org.apache.camel.test.infra.openldap.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Openldap
*/
-public interface OpenldapService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface OpenldapService extends TestService {
Integer getPort();
Integer getSslPort();
String getHost();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-postgres/src/test/java/org/apache/camel/test/infra/postgres/services/PostgresService.java b/test-infra/camel-test-infra-postgres/src/test/java/org/apache/camel/test/infra/postgres/services/PostgresService.java
index 3379bfeca1c..a02cfb1323a 100644
--- a/test-infra/camel-test-infra-postgres/src/test/java/org/apache/camel/test/infra/postgres/services/PostgresService.java
+++ b/test-infra/camel-test-infra-postgres/src/test/java/org/apache/camel/test/infra/postgres/services/PostgresService.java
@@ -17,15 +17,11 @@
package org.apache.camel.test.infra.postgres.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Postgres
*/
-public interface PostgresService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface PostgresService extends TestService {
String host();
@@ -36,14 +32,4 @@ public interface PostgresService extends BeforeAllCallback, AfterAllCallback, Te
String password();
String getServiceAddress();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-pulsar/src/test/java/org/apache/camel/test/infra/pulsar/services/PulsarService.java b/test-infra/camel-test-infra-pulsar/src/test/java/org/apache/camel/test/infra/pulsar/services/PulsarService.java
index 75f15cbf7a4..694bc9419f3 100644
--- a/test-infra/camel-test-infra-pulsar/src/test/java/org/apache/camel/test/infra/pulsar/services/PulsarService.java
+++ b/test-infra/camel-test-infra-pulsar/src/test/java/org/apache/camel/test/infra/pulsar/services/PulsarService.java
@@ -17,27 +17,13 @@
package org.apache.camel.test.infra.pulsar.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Pulsar
*/
-public interface PulsarService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface PulsarService extends TestService {
String getPulsarAdminUrl();
String getPulsarBrokerUrl();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-rabbitmq/src/test/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQService.java b/test-infra/camel-test-infra-rabbitmq/src/test/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQService.java
index e4ebdf93185..ac3c04f4a85 100644
--- a/test-infra/camel-test-infra-rabbitmq/src/test/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQService.java
+++ b/test-infra/camel-test-infra-rabbitmq/src/test/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQService.java
@@ -18,12 +18,8 @@
package org.apache.camel.test.infra.rabbitmq.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
-public interface RabbitMQService extends TestService, BeforeAllCallback, AfterAllCallback {
+public interface RabbitMQService extends TestService {
/**
* The connection properties for the service
@@ -58,14 +54,4 @@ public interface RabbitMQService extends TestService, BeforeAllCallback, AfterAl
* Shuts down the service after the test has completed
*/
void shutdown();
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-redis/src/test/java/org/apache/camel/test/infra/redis/services/RedisService.java b/test-infra/camel-test-infra-redis/src/test/java/org/apache/camel/test/infra/redis/services/RedisService.java
index e0ef1777381..231221a761f 100644
--- a/test-infra/camel-test-infra-redis/src/test/java/org/apache/camel/test/infra/redis/services/RedisService.java
+++ b/test-infra/camel-test-infra-redis/src/test/java/org/apache/camel/test/infra/redis/services/RedisService.java
@@ -18,14 +18,12 @@ package org.apache.camel.test.infra.redis.services;
import org.apache.camel.test.infra.common.services.TestService;
import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Redis
*/
-public interface RedisService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface RedisService extends TestService {
String host();
diff --git a/test-infra/camel-test-infra-solr/src/test/java/org/apache/camel/test/infra/solr/services/SolrService.java b/test-infra/camel-test-infra-solr/src/test/java/org/apache/camel/test/infra/solr/services/SolrService.java
index de0fc56cacf..44409e9f4de 100644
--- a/test-infra/camel-test-infra-solr/src/test/java/org/apache/camel/test/infra/solr/services/SolrService.java
+++ b/test-infra/camel-test-infra-solr/src/test/java/org/apache/camel/test/infra/solr/services/SolrService.java
@@ -17,27 +17,13 @@
package org.apache.camel.test.infra.solr.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Solr
*/
-public interface SolrService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface SolrService extends TestService {
String getSolrBaseUrl();
boolean isCloudMode();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-xmpp/src/test/java/org/apache/camel/test/infra/xmpp/services/XmppService.java b/test-infra/camel-test-infra-xmpp/src/test/java/org/apache/camel/test/infra/xmpp/services/XmppService.java
index d3539999b2b..51c3ef22fc4 100644
--- a/test-infra/camel-test-infra-xmpp/src/test/java/org/apache/camel/test/infra/xmpp/services/XmppService.java
+++ b/test-infra/camel-test-infra-xmpp/src/test/java/org/apache/camel/test/infra/xmpp/services/XmppService.java
@@ -17,28 +17,14 @@
package org.apache.camel.test.infra.xmpp.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for Xmpp
*/
-public interface XmppService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface XmppService extends TestService {
String host();
int port();
String getUrl();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}
diff --git a/test-infra/camel-test-infra-zookeeper/src/test/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperService.java b/test-infra/camel-test-infra-zookeeper/src/test/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperService.java
index b38890ad6c1..6d5466bc524 100644
--- a/test-infra/camel-test-infra-zookeeper/src/test/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperService.java
+++ b/test-infra/camel-test-infra-zookeeper/src/test/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperService.java
@@ -17,24 +17,10 @@
package org.apache.camel.test.infra.zookeeper.services;
import org.apache.camel.test.infra.common.services.TestService;
-import org.apache.camel.test.infra.common.services.TestServiceUtil;
-import org.junit.jupiter.api.extension.AfterAllCallback;
-import org.junit.jupiter.api.extension.BeforeAllCallback;
-import org.junit.jupiter.api.extension.ExtensionContext;
/**
* Test infra service for ZooKeeper
*/
-public interface ZooKeeperService extends BeforeAllCallback, AfterAllCallback, TestService {
+public interface ZooKeeperService extends TestService {
String getConnectionString();
-
- @Override
- default void beforeAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryInitialize(this, extensionContext);
- }
-
- @Override
- default void afterAll(ExtensionContext extensionContext) throws Exception {
- TestServiceUtil.tryShutdown(this, extensionContext);
- }
}