diff --git a/components/camel-mongodb/pom.xml b/components/camel-mongodb/pom.xml index e250c53bc1e4d..1d8de1ae8251d 100644 --- a/components/camel-mongodb/pom.xml +++ b/components/camel-mongodb/pom.xml @@ -66,12 +66,6 @@ - - org.apache.camel - camel-test-infra-core - ${project.version} - test - org.apache.camel camel-test-infra-core diff --git a/components/camel-solr/pom.xml b/components/camel-solr/pom.xml index 0ada6d793b757..699a861a980e9 100644 --- a/components/camel-solr/pom.xml +++ b/components/camel-solr/pom.xml @@ -31,6 +31,7 @@ Camel Solr Support + true diff --git a/components/camel-tahu/pom.xml b/components/camel-tahu/pom.xml index ff4005a4f8e1d..55c4d92eda75a 100644 --- a/components/camel-tahu/pom.xml +++ b/components/camel-tahu/pom.xml @@ -172,12 +172,6 @@ - - org.apache.camel - camel-test-infra-core - ${project.version} - test - org.apache.camel camel-test-infra-core diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/AvailablePort.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/AvailablePort.java new file mode 100644 index 0000000000000..204eca619c019 --- /dev/null +++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/AvailablePort.java @@ -0,0 +1,36 @@ +package org.apache.camel.test; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AvailablePort { + private static final Logger LOG = LoggerFactory.getLogger(AvailablePort.class); + + /** + * Probe a port to see if it is free + * + * @param port an integer port number to be tested. If port is 0, then the next available port is + * returned. + * @throws IllegalStateException if the port is not free or, in case of port 0, if there are no ports available at + * all. + * @return the port number itself if the port is free or, in case of port 0, the first + * available port number. + */ + public static int probePort(InetAddress address, int port) { + + try (ServerSocket ss = new ServerSocket()) { + ss.setReuseAddress(true); + ss.bind(new InetSocketAddress(address, port), 1); + int probedPort = ss.getLocalPort(); + LOG.info("Available port is -> {}", probedPort); + return probedPort; + } catch (IOException e) { + throw new IllegalStateException("Cannot find free port", e); + } + } +} diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/AvailablePortFinder.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/AvailablePortFinder.java index 08d266309fc49..459a1155e2c7f 100644 --- a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/AvailablePortFinder.java +++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/AvailablePortFinder.java @@ -16,10 +16,6 @@ */ package org.apache.camel.test; -import java.io.IOException; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.ServerSocket; import java.util.Map; import java.util.Random; import java.util.concurrent.ConcurrentHashMap; @@ -201,29 +197,7 @@ public static int getSpecificPort(int portNumber, T failurePayload, Function * available port number. */ public static int probePort(int port) { - return probePort(null, port); - } - - /** - * Probe a port to see if it is free - * - * @param port an integer port number to be tested. If port is 0, then the next available port is - * returned. - * @throws IllegalStateException if the port is not free or, in case of port 0, if there are no ports available at - * all. - * @return the port number itself if the port is free or, in case of port 0, the first - * available port number. - */ - public static int probePort(InetAddress address, int port) { - try (ServerSocket ss = new ServerSocket()) { - ss.setReuseAddress(true); - ss.bind(new InetSocketAddress(address, port), 1); - int probedPort = ss.getLocalPort(); - LOG.info("Available port is -> {}", probedPort); - return probedPort; - } catch (IOException e) { - throw new IllegalStateException("Cannot find free port", e); - } + return AvailablePort.probePort(null, port); } } diff --git a/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraLocalContainerService.java b/core/camel-api/src/generated/java/org/apache/camel/spi/annotations/InfraService.java similarity index 63% rename from test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraLocalContainerService.java rename to core/camel-api/src/generated/java/org/apache/camel/spi/annotations/InfraService.java index 97a79fb1d1625..b7f513b747c4b 100644 --- a/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraLocalContainerService.java +++ b/core/camel-api/src/generated/java/org/apache/camel/spi/annotations/InfraService.java @@ -14,8 +14,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.camel.test.infra.cassandra.services; +package org.apache.camel.spi.annotations; -public class CassandraLocalContainerService extends CassandraLocalContainerInfraService - implements CassandraService { +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Target({ ElementType.TYPE }) +public @interface InfraService { + + Class service(); + + String[] serviceAlias(); + + String[] serviceImplementationAlias() default {}; } diff --git a/dsl/camel-jbang/camel-jbang-core/pom.xml b/dsl/camel-jbang/camel-jbang-core/pom.xml index 8c29c6775c95a..0e99562231de2 100644 --- a/dsl/camel-jbang/camel-jbang-core/pom.xml +++ b/dsl/camel-jbang/camel-jbang-core/pom.xml @@ -146,6 +146,21 @@ ${jansi-version} + + + org.apache.camel + camel-test-infra-all + ${project.version} + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + + org.codehaus.plexus plexus-xml diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java index 9d470e9e0e7e0..05494fdcb0c30 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/CamelJBangMain.java @@ -37,6 +37,9 @@ import org.apache.camel.dsl.jbang.core.commands.config.ConfigSet; import org.apache.camel.dsl.jbang.core.commands.config.ConfigUnset; import org.apache.camel.dsl.jbang.core.commands.exceptionhandler.MissingPluginParameterExceptionHandler; +import org.apache.camel.dsl.jbang.core.commands.infra.InfraCommand; +import org.apache.camel.dsl.jbang.core.commands.infra.InfraList; +import org.apache.camel.dsl.jbang.core.commands.infra.InfraRun; import org.apache.camel.dsl.jbang.core.commands.plugin.PluginAdd; import org.apache.camel.dsl.jbang.core.commands.plugin.PluginCommand; import org.apache.camel.dsl.jbang.core.commands.plugin.PluginDelete; @@ -161,6 +164,9 @@ public static void run(CamelJBangMain main, String... args) { .addSubcommand("get", new CommandLine(new VersionGet(main))) .addSubcommand("set", new CommandLine(new VersionSet(main))) .addSubcommand("list", new CommandLine(new VersionList(main)))) + .addSubcommand("infra", new CommandLine(new InfraCommand(main)) + .addSubcommand("list", new CommandLine(new InfraList(main))) + .addSubcommand("run", new CommandLine(new InfraRun(main)))) .setParameterExceptionHandler(new MissingPluginParameterExceptionHandler()); PluginHelper.addPlugins(commandLine, main, args); diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraCommand.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraCommand.java new file mode 100644 index 0000000000000..b764c1ca5b082 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraCommand.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.dsl.jbang.core.commands.infra; + +import java.util.List; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.apache.camel.dsl.jbang.core.commands.CamelCommand; +import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain; +import picocli.CommandLine; + +@CommandLine.Command(name = "infra", + description = "List and Run external services for testing and prototyping") +public class InfraCommand extends CamelCommand { + + static final ObjectMapper JSON_MAPPER = new ObjectMapper(); + static final ObjectMapper YAML_MAPPER = new ObjectMapper(new YAMLFactory()); + + { + YAML_MAPPER.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); + YAML_MAPPER.registerModule(new JavaTimeModule()); + YAML_MAPPER.registerModule(new Jdk8Module()); + } + + public InfraCommand(CamelJBangMain main) { + super(main); + } + + @Override + public Integer doCall() throws Exception { + // defaults to list + new CommandLine(new InfraList(getMain())).execute(); + return 0; + } + + record TestInfraService(String service, String implementation, List alias, List aliasImplementation) { + } +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraList.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraList.java new file mode 100644 index 0000000000000..09fb0dbe83450 --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraList.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.dsl.jbang.core.commands.infra; + +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.fasterxml.jackson.core.type.TypeReference; +import org.apache.camel.dsl.jbang.core.commands.CamelCommand; +import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain; +import picocli.CommandLine; + +@CommandLine.Command(name = "list", description = "Displays available external services", sortOptions = false, + showDefaultValues = true) +public class InfraList extends CamelCommand { + + public InfraList(CamelJBangMain main) { + super(main); + } + + @Override + public Integer doCall() throws Exception { + Map> services = new HashMap<>(); + + List metadata; + + try (InputStream is + = this.getClass().getClassLoader().getResourceAsStream("META-INF/test-infra-metadata.json")) { + String json = new String(is.readAllBytes(), StandardCharsets.UTF_8); + + metadata = InfraCommand.JSON_MAPPER.readValue(json, new TypeReference>() { + }); + } + + for (InfraCommand.TestInfraService service : metadata) { + for (String alias : service.alias()) { + if (!services.containsKey(alias)) { + services.put(alias, new HashSet<>()); + } + + if (service.aliasImplementation() != null) { + for (String aliasImplementation : service.aliasImplementation()) { + services.get(alias).add(aliasImplementation); + } + } + } + } + + printer().print(InfraCommand.YAML_MAPPER.writeValueAsString(services)); + return 0; + } + +} diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java new file mode 100644 index 0000000000000..3cbdfbcc8145a --- /dev/null +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/infra/InfraRun.java @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.dsl.jbang.core.commands.infra; + +import java.io.InputStream; +import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Scanner; + +import com.fasterxml.jackson.core.type.TypeReference; +import org.apache.camel.dsl.jbang.core.commands.CamelCommand; +import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain; +import org.apache.camel.test.infra.common.services.InfrastructureService; +import picocli.CommandLine; + +@CommandLine.Command(name = "run", + description = "Run an external service") +public class InfraRun extends CamelCommand { + + @CommandLine.Parameters(description = "Service name", arity = "1") + private List serviceName; + + public InfraRun(CamelJBangMain main) { + super(main); + } + + @Override + public Integer doCall() throws Exception { + if (serviceName == null || serviceName.isEmpty()) { + return 0; + } + + String service = serviceName.get(0); + String serviceImplementation = serviceName.size() > 1 ? serviceName.get(1) : null; + + run(service, serviceImplementation); + + return 0; + } + + private void run(String testService, String testServiceImplementation) throws Exception { + List metadata; + + try (InputStream is + = this.getClass().getClassLoader().getResourceAsStream("META-INF/test-infra-metadata.json")) { + String json = new String(is.readAllBytes(), StandardCharsets.UTF_8); + + metadata = InfraCommand.JSON_MAPPER.readValue(json, new TypeReference>() { + }); + } + + List services = metadata; + + InfraCommand.TestInfraService testInfraService = services + .stream() + .filter(service -> { + if (testServiceImplementation != null && !testServiceImplementation.isEmpty() + && service.aliasImplementation() != null) { + return service.alias().contains(testService) + && service.aliasImplementation().contains(testServiceImplementation); + } else if (testServiceImplementation == null) { + return service.alias().contains(testService) + && (service.aliasImplementation() == null || service.aliasImplementation().isEmpty()); + } + + return false; + }) + .findFirst() + .orElseThrow(() -> { + String message = ", use the list command for the available services"; + if (testServiceImplementation != null) { + return new IllegalArgumentException( + "service " + testService + " with implementation " + testServiceImplementation + " not found" + + message); + } + + return new IllegalArgumentException("service " + testService + " not found" + message); + }); + + String serviceInterface = testInfraService.service(); + String serviceImpl = testInfraService.implementation(); + + printer().println("Starting service " + testService); + + InfrastructureService actualService = (InfrastructureService) Class.forName(serviceImpl) + .getDeclaredConstructor(null) + .newInstance(null); + + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + if (actualService != null) { + try { + actualService.shutdown(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + })); + + actualService.initialize(); + + Method[] serviceMethods = Class.forName(serviceInterface).getDeclaredMethods(); + HashMap properties = new HashMap(); + for (Method method : serviceMethods) { + if (method.getParameterCount() == 0 && !method.getName().contains("registerProperties")) { + properties.put(method.getName(), method.invoke(actualService)); + } + } + + printer().println(InfraCommand.YAML_MAPPER.writeValueAsString(properties)); + + printer().println("To stop the execution press q"); + Scanner sc = new Scanner(System.in).useDelimiter("\n"); + + if (sc.nextLine().equals("q")) { + actualService.shutdown(); + sc.close(); + } + } +} diff --git a/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java b/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java index 3639949964a2f..e0b791decb95e 100755 --- a/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java +++ b/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java @@ -19,9 +19,9 @@ //JAVA 17+ //REPOS central=https://repo1.maven.org/maven2,apache-snapshot=https://repository.apache.org/content/groups/snapshots/ -//DEPS org.apache.camel:camel-bom:${camel.jbang.version:4.9.0}@pom -//DEPS org.apache.camel:camel-jbang-core:${camel.jbang.version:4.9.0} -//DEPS org.apache.camel.kamelets:camel-kamelets:${camel-kamelets.version:4.9.0} +//DEPS org.apache.camel:camel-bom:${camel.jbang.version:4.10.0-SNAPSHOT}@pom +//DEPS org.apache.camel:camel-jbang-core:${camel.jbang.version:4.10.0-SNAPSHOT} +//DEPS org.apache.camel.kamelets:camel-kamelets:${camel-kamelets.version:4.10.0-SNAPSHOT} package main; diff --git a/pom.xml b/pom.xml index 83683b71d71e7..7a87c2f02b81e 100644 --- a/pom.xml +++ b/pom.xml @@ -346,6 +346,7 @@ **/FileSplitXPathCharsetTest-input.xml **/.camel-jbang-run/** **/camel-jbang-run.properties + **/javax.annotations.processing.Processor diff --git a/test-infra/camel-test-infra-all/pom.xml b/test-infra/camel-test-infra-all/pom.xml new file mode 100644 index 0000000000000..ebec2a223b190 --- /dev/null +++ b/test-infra/camel-test-infra-all/pom.xml @@ -0,0 +1,542 @@ + + + + 4.0.0 + + org.apache.camel + test-infra + 4.10.0-SNAPSHOT + + + camel-test-infra-all + + + + org.apache.camel + camel-test-infra-kafka + ${project.version} + + + org.apache.camel + camel-test-infra-aws-v2 + ${project.version} + + + org.apache.camel + camel-test-infra-cassandra + ${project.version} + + + org.apache.camel + camel-test-infra-elasticsearch + ${project.version} + + + org.apache.camel + camel-test-infra-couchbase + ${project.version} + + + org.apache.camel + camel-test-infra-mongodb + ${project.version} + + + org.apache.camel + camel-test-infra-rabbitmq + ${project.version} + + + org.apache.camel + camel-test-infra-azure-storage-blob + ${project.version} + + + org.apache.camel + camel-test-infra-azure-storage-datalake + ${project.version} + + + org.apache.camel + camel-test-infra-azure-storage-queue + ${project.version} + + + org.apache.camel + camel-test-infra-artemis + ${project.version} + + + org.apache.camel + camel-test-infra-dispatch-router + ${project.version} + + + org.apache.camel + camel-test-infra-arangodb + ${project.version} + + + org.apache.camel + camel-test-infra-google-pubsub + ${project.version} + + + org.apache.camel + camel-test-infra-infinispan + ${project.version} + + + org.apache.camel + camel-test-infra-microprofile-lra + ${project.version} + + + org.apache.camel + camel-test-infra-minio + ${project.version} + + + org.apache.camel + camel-test-infra-nats + ${project.version} + + + org.apache.camel + camel-test-infra-pulsar + ${project.version} + + + org.apache.camel + camel-test-infra-redis + ${project.version} + + + org.apache.camel + camel-test-infra-rocketmq + ${project.version} + + + org.apache.camel + camel-test-infra-solr + ${project.version} + + + org.apache.camel + camel-test-infra-xmpp + ${project.version} + + + org.apache.camel + camel-test-infra-zookeeper + ${project.version} + + + org.apache.camel + camel-test-infra-postgres + ${project.version} + + + org.apache.camel + camel-test-infra-couchdb + ${project.version} + + + org.apache.camel + camel-test-infra-ftp + ${project.version} + + + org.apache.camel + camel-test-infra-fhir + ${project.version} + + + org.apache.camel + camel-test-infra-mosquitto + ${project.version} + + + org.apache.camel + camel-test-infra-chatscript + ${project.version} + + + org.apache.camel + camel-test-infra-openldap + ${project.version} + + + org.apache.camel + camel-test-infra-ignite + ${project.version} + + + org.apache.camel + camel-test-infra-hashicorp-vault + ${project.version} + + + org.apache.camel + camel-test-infra-jetty + ${project.version} + + + org.apache.camel + camel-test-infra-etcd3 + ${project.version} + + + org.apache.camel + camel-test-infra-opensearch + ${project.version} + + + org.apache.camel + camel-test-infra-smb + ${project.version} + + + org.apache.camel + camel-test-infra-qdrant + ${project.version} + + + org.apache.camel + camel-test-infra-ollama + ${project.version} + + + org.apache.camel + camel-test-infra-milvus + ${project.version} + + + org.apache.camel + camel-test-infra-hazelcast + ${project.version} + + + org.apache.camel + camel-test-infra-hivemq + ${project.version} + + + org.apache.camel + camel-test-infra-torchserve + ${project.version} + + + org.apache.camel + camel-test-infra-tensorflow-serving + ${project.version} + + + + + + + io.smallrye + jandex-maven-plugin + ${jandex-version} + + + make-index + + jandex + + + + + + org.apache.camel + camel-test-infra-arangodb + + + + + org.apache.camel + camel-test-infra-kafka + + + + + org.apache.camel + camel-test-infra-aws-v2 + + + + + org.apache.camel + camel-test-infra-cassandra + + + + + org.apache.camel + camel-test-infra-elasticsearch + + + + + org.apache.camel + camel-test-infra-couchbase + + + + + org.apache.camel + camel-test-infra-mongodb + + + + + org.apache.camel + camel-test-infra-rabbitmq + + + + + org.apache.camel + camel-test-infra-azure-storage-blob + + + + + org.apache.camel + camel-test-infra-azure-storage-datalake + + + + + org.apache.camel + camel-test-infra-azure-storage-queue + + + + + org.apache.camel + camel-test-infra-artemis + + + + + org.apache.camel + camel-test-infra-google-pubsub + + + + + org.apache.camel + camel-test-infra-infinispan + + + + + org.apache.camel + camel-test-infra-microprofile-lra + + + + + org.apache.camel + camel-test-infra-minio + + + + + org.apache.camel + camel-test-infra-nats + + + + + org.apache.camel + camel-test-infra-pulsar + + + + + org.apache.camel + camel-test-infra-redis + + + + + org.apache.camel + camel-test-infra-rocketmq + + + + + org.apache.camel + camel-test-infra-solr + + + + + org.apache.camel + camel-test-infra-xmpp + + + + + org.apache.camel + camel-test-infra-zookeeper + + + + + org.apache.camel + camel-test-infra-postgres + + + + + org.apache.camel + camel-test-infra-couchdb + + + + + org.apache.camel + camel-test-infra-ftp + + + + + org.apache.camel + camel-test-infra-fhir + + + + + org.apache.camel + camel-test-infra-mosquitto + + + + + org.apache.camel + camel-test-infra-chatscript + + + + + org.apache.camel + camel-test-infra-openldap + + + + + org.apache.camel + camel-test-infra-ignite + + + + + org.apache.camel + camel-test-infra-hashicorp-vault + + + + + org.apache.camel + camel-test-infra-etcd3 + + + + + org.apache.camel + camel-test-infra-opensearch + + + + + org.apache.camel + camel-test-infra-smb + + + + + org.apache.camel + camel-test-infra-qdrant + + + + + org.apache.camel + camel-test-infra-ollama + + + + + org.apache.camel + camel-test-infra-milvus + + + + + org.apache.camel + camel-test-infra-milvus + + + + + org.apache.camel + camel-test-infra-hazelcast + + + + + org.apache.camel + camel-test-infra-torchserve + + + + + org.apache.camel + camel-test-infra-hivemq + + + + + + + + + org.apache.camel + camel-package-maven-plugin + ${project.version} + + + test-infra-generate-metadata + + test-infra-generate-metadata + + + + + + + + \ No newline at end of file diff --git a/test-infra/camel-test-infra-arangodb/src/main/java/org/apache/camel/test/infra/arangodb/services/ArangoDBLocalContainerInfraService.java b/test-infra/camel-test-infra-arangodb/src/main/java/org/apache/camel/test/infra/arangodb/services/ArangoDBLocalContainerInfraService.java index c7f787a16029c..5ba269b5df527 100644 --- a/test-infra/camel-test-infra-arangodb/src/main/java/org/apache/camel/test/infra/arangodb/services/ArangoDBLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-arangodb/src/main/java/org/apache/camel/test/infra/arangodb/services/ArangoDBLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.arangodb.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.arangodb.common.ArangoDBProperties; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil; @@ -23,6 +24,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = ArangoDBInfraService.class, serviceAlias = "arangodb") public class ArangoDBLocalContainerInfraService implements ArangoDBInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(ArangoDBLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisAMQPInfraService.java b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisAMQPInfraService.java index a1e1827464e4e..fbdd20cc3f6bf 100644 --- a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisAMQPInfraService.java +++ b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisAMQPInfraService.java @@ -29,9 +29,11 @@ import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager; import org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManager; import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.artemis.common.ArtemisProperties; import org.apache.camel.test.infra.artemis.common.ArtemisRunException; +@InfraService(service = ArtemisInfraService.class, serviceAlias = "artemis", serviceImplementationAlias = "amqp") public class ArtemisAMQPInfraService extends AbstractArtemisEmbeddedService { private String brokerURL; diff --git a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisMQTTInfraService.java b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisMQTTInfraService.java index cf61668f32fd6..05a6aff632711 100644 --- a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisMQTTInfraService.java +++ b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisMQTTInfraService.java @@ -19,8 +19,10 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.artemis.common.ArtemisRunException; +@InfraService(service = ArtemisInfraService.class, serviceAlias = "artemis", serviceImplementationAlias = "mqtt") public class ArtemisMQTTInfraService extends AbstractArtemisEmbeddedService { private String brokerURL; diff --git a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisPersistentVMInfraService.java b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisPersistentVMInfraService.java index 8fdf1ceb31004..bc2b65721c027 100644 --- a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisPersistentVMInfraService.java +++ b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisPersistentVMInfraService.java @@ -21,8 +21,10 @@ import org.apache.activemq.artemis.core.server.JournalType; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.artemis.common.ArtemisRunException; +@InfraService(service = ArtemisInfraService.class, serviceAlias = "artemis", serviceImplementationAlias = "persistent") public class ArtemisPersistentVMInfraService extends AbstractArtemisEmbeddedService { private String brokerURL; diff --git a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisVMInfraService.java b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisVMInfraService.java index d28631ba4ffd4..e020aec6cd76e 100644 --- a/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisVMInfraService.java +++ b/test-infra/camel-test-infra-artemis/src/main/java/org/apache/camel/test/infra/artemis/services/ArtemisVMInfraService.java @@ -20,10 +20,12 @@ import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.core.settings.impl.AddressSettings; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.artemis.common.ArtemisRunException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = ArtemisInfraService.class, serviceAlias = "artemis") public class ArtemisVMInfraService extends AbstractArtemisEmbeddedService { private static final Logger LOG = LoggerFactory.getLogger(ArtemisVMInfraService.class); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSCloudWatchLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSCloudWatchLocalContainerInfraService.java index 0dd22aa32ccb6..6378345af9923 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSCloudWatchLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSCloudWatchLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "cloud-watch", "aws-cloud-watch" }) public class AWSCloudWatchLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSCloudWatchLocalContainerInfraService() { super(Service.CLOUD_WATCH); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSConfigLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSConfigLocalContainerInfraService.java index eb1aa1905028e..444d6a45b3e0a 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSConfigLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSConfigLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "aws-config" }) public class AWSConfigLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSConfigLocalContainerInfraService() { super(Service.CONFIG); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSDynamodbLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSDynamodbLocalContainerInfraService.java index 4f9296637177e..db80b28dc7a76 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSDynamodbLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSDynamodbLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "dynamodb", "aws-dynamo-db", "dynamo-db" }) public class AWSDynamodbLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSDynamodbLocalContainerInfraService() { diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEC2LocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEC2LocalContainerInfraService.java index 23c132f6db019..5a6bae4c8302e 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEC2LocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEC2LocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "ec2", "aws-ec2" }) public class AWSEC2LocalContainerInfraService extends AWSLocalContainerInfraService { public AWSEC2LocalContainerInfraService() { super(Service.EC2); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEventBridgeLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEventBridgeLocalContainerInfraService.java index d06e103c87d2e..9a294ec67e2f0 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEventBridgeLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSEventBridgeLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "event-bridge", "aws-event-bridge" }) public class AWSEventBridgeLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSEventBridgeLocalContainerInfraService() { diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSIAMLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSIAMLocalContainerInfraService.java index 18d7ac62a4b95..aa76aa0aeffcf 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSIAMLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSIAMLocalContainerInfraService.java @@ -16,6 +16,10 @@ */ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "aws-iam" }) public class AWSIAMLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSIAMLocalContainerInfraService() { super(Service.IAM); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKMSLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKMSLocalContainerInfraService.java index 490af2bf54786..492a2c50bc734 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKMSLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKMSLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "aws-kms" }) public class AWSKMSLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSKMSLocalContainerInfraService() { super(Service.KMS); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKinesisLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKinesisLocalContainerInfraService.java index 253d5c2c227a6..e46872181e5a4 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKinesisLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSKinesisLocalContainerInfraService.java @@ -17,10 +17,13 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import software.amazon.awssdk.core.SdkSystemSetting; +@InfraService(service = AWSInfraService.class, serviceAlias = { "kinesis", "aws-kinesis" }) public class AWSKinesisLocalContainerInfraService extends AWSLocalContainerInfraService { private static final Logger LOG = LoggerFactory.getLogger(AWSKinesisLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSLambdaLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSLambdaLocalContainerInfraService.java index d8518d7d87db0..69feb90e07bd5 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSLambdaLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSLambdaLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "lambda", "aws-lambda" }) public class AWSLambdaLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSLambdaLocalContainerInfraService() { super(Service.LAMBDA); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSS3LocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSS3LocalContainerInfraService.java index 4548812e7b331..c7aa0c262b9d7 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSS3LocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSS3LocalContainerInfraService.java @@ -17,9 +17,12 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = AWSInfraService.class, serviceAlias = { "s3", "aws-s3" }) public class AWSS3LocalContainerInfraService extends AWSLocalContainerInfraService { private static final Logger LOG = LoggerFactory.getLogger(AWSS3LocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSNSLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSNSLocalContainerInfraService.java index 1f6d55e53b26f..34bfc4014ea1b 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSNSLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSNSLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "aws-sns" }) public class AWSSNSLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSSNSLocalContainerInfraService() { diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSQSLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSQSLocalContainerInfraService.java index 9e8d725531f35..70d54ea923864 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSQSLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSQSLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "aws-sqs" }) public class AWSSQSLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSSQSLocalContainerInfraService() { diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSTSLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSTSLocalContainerInfraService.java index 82399f4244cf8..4ad73162ce940 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSTSLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSTSLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "aws-sts" }) public class AWSSTSLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSSTSLocalContainerInfraService() { super(Service.STS); diff --git a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSecretsManagerLocalContainerInfraService.java b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSecretsManagerLocalContainerInfraService.java index d2f319e7cea3e..a76fb015f74d7 100644 --- a/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSecretsManagerLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-aws-v2/src/main/java/org/apache/camel/test/infra/aws2/services/AWSSecretsManagerLocalContainerInfraService.java @@ -17,6 +17,10 @@ package org.apache.camel.test.infra.aws2.services; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.aws.common.services.AWSInfraService; + +@InfraService(service = AWSInfraService.class, serviceAlias = { "aws-secrets-manager" }) public class AWSSecretsManagerLocalContainerInfraService extends AWSLocalContainerInfraService { public AWSSecretsManagerLocalContainerInfraService() { diff --git a/test-infra/camel-test-infra-azure-storage-blob/src/main/java/org/apache/camel/test/infra/azure/storage/blob/services/AzureStorageBlobLocalContainerInfraService.java b/test-infra/camel-test-infra-azure-storage-blob/src/main/java/org/apache/camel/test/infra/azure/storage/blob/services/AzureStorageBlobLocalContainerInfraService.java index 39e8af092ecc3..8e0152f0471e1 100644 --- a/test-infra/camel-test-infra-azure-storage-blob/src/main/java/org/apache/camel/test/infra/azure/storage/blob/services/AzureStorageBlobLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-azure-storage-blob/src/main/java/org/apache/camel/test/infra/azure/storage/blob/services/AzureStorageBlobLocalContainerInfraService.java @@ -17,11 +17,15 @@ package org.apache.camel.test.infra.azure.storage.blob.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.azure.common.AzureConfigs; import org.apache.camel.test.infra.azure.common.AzureCredentialsHolder; +import org.apache.camel.test.infra.azure.common.services.AzureInfraService; import org.apache.camel.test.infra.azure.common.services.AzureServices; import org.apache.camel.test.infra.azure.common.services.AzureStorageInfraService; +@InfraService(service = AzureInfraService.class, serviceAlias = { "azure-storage-blob", "azure" }, + serviceImplementationAlias = "storage-blob") public class AzureStorageBlobLocalContainerInfraService extends AzureStorageInfraService { @Override diff --git a/test-infra/camel-test-infra-azure-storage-queue/src/main/java/org/apache/camel/test/infra/azure/storage/queue/services/AzureStorageQueueLocalContainerInfraService.java b/test-infra/camel-test-infra-azure-storage-queue/src/main/java/org/apache/camel/test/infra/azure/storage/queue/services/AzureStorageQueueLocalContainerInfraService.java index 6e005fe975019..61d7f3f48deb7 100644 --- a/test-infra/camel-test-infra-azure-storage-queue/src/main/java/org/apache/camel/test/infra/azure/storage/queue/services/AzureStorageQueueLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-azure-storage-queue/src/main/java/org/apache/camel/test/infra/azure/storage/queue/services/AzureStorageQueueLocalContainerInfraService.java @@ -17,11 +17,15 @@ package org.apache.camel.test.infra.azure.storage.queue.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.azure.common.AzureConfigs; import org.apache.camel.test.infra.azure.common.AzureCredentialsHolder; +import org.apache.camel.test.infra.azure.common.services.AzureInfraService; import org.apache.camel.test.infra.azure.common.services.AzureServices; import org.apache.camel.test.infra.azure.common.services.AzureStorageInfraService; +@InfraService(service = AzureInfraService.class, serviceAlias = { "azure-storage-queue", "azure" }, + serviceImplementationAlias = "storage-queue") public class AzureStorageQueueLocalContainerInfraService extends AzureStorageInfraService { @Override diff --git a/test-infra/camel-test-infra-cassandra/src/main/java/org/apache/camel/test/infra/cassandra/services/CassandraLocalContainerInfraService.java b/test-infra/camel-test-infra-cassandra/src/main/java/org/apache/camel/test/infra/cassandra/services/CassandraLocalContainerInfraService.java index 79dd472f5d829..0f881ef8b276d 100644 --- a/test-infra/camel-test-infra-cassandra/src/main/java/org/apache/camel/test/infra/cassandra/services/CassandraLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-cassandra/src/main/java/org/apache/camel/test/infra/cassandra/services/CassandraLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.cassandra.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.cassandra.common.CassandraProperties; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; @@ -27,6 +28,7 @@ /** * A service for a local instance of Apache Cassandra running with TestContainers */ +@InfraService(service = CassandraInfraService.class, serviceAlias = { "cassandra" }) public class CassandraLocalContainerInfraService implements CassandraInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(CassandraLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraServiceFactory.java b/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraServiceFactory.java index 2cdf79679e7f6..dfa67e3f84ca2 100644 --- a/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraServiceFactory.java +++ b/test-infra/camel-test-infra-cassandra/src/test/java/org/apache/camel/test/infra/cassandra/services/CassandraServiceFactory.java @@ -43,6 +43,10 @@ public static CassandraService createService() { .build(); } + public static class CassandraLocalContainerService extends CassandraLocalContainerInfraService + implements CassandraService { + } + public static class RemoteCassandraService extends RemoteCassandraInfraService implements CassandraService { } } diff --git a/test-infra/camel-test-infra-chatscript/src/main/java/org/apache/camel/test/infra/chatscript/services/ChatScriptLocalContainerInfraService.java b/test-infra/camel-test-infra-chatscript/src/main/java/org/apache/camel/test/infra/chatscript/services/ChatScriptLocalContainerInfraService.java index 7caf76f06aa86..02213f3bddb50 100644 --- a/test-infra/camel-test-infra-chatscript/src/main/java/org/apache/camel/test/infra/chatscript/services/ChatScriptLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-chatscript/src/main/java/org/apache/camel/test/infra/chatscript/services/ChatScriptLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.chatscript.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.chatscript.common.ChatScriptProperties; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; @@ -23,6 +24,7 @@ import org.slf4j.LoggerFactory; import org.testcontainers.containers.GenericContainer; +@InfraService(service = ChatScriptInfraService.class, serviceAlias = { "chatscript", "chat-script" }) public class ChatScriptLocalContainerInfraService implements ChatScriptInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(ChatScriptLocalContainerInfraService.class); private static final int SERVICE_PORT = 1024; diff --git a/test-infra/camel-test-infra-consul/src/main/java/org/apache/camel/test/infra/consul/services/ConsulLocalContainerInfraService.java b/test-infra/camel-test-infra-consul/src/main/java/org/apache/camel/test/infra/consul/services/ConsulLocalContainerInfraService.java index e8a5daa72efd3..adc85a2b3ef31 100644 --- a/test-infra/camel-test-infra-consul/src/main/java/org/apache/camel/test/infra/consul/services/ConsulLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-consul/src/main/java/org/apache/camel/test/infra/consul/services/ConsulLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.consul.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.consul.common.ConsulProperties; @@ -25,6 +26,7 @@ import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; +@InfraService(service = ConsulInfraService.class, serviceAlias = { "consul" }) public class ConsulLocalContainerInfraService implements ConsulInfraService, ContainerService { public static final String CONTAINER_NAME = "consul"; diff --git a/test-infra/camel-test-infra-couchbase/src/main/java/org/apache/camel/test/infra/couchbase/services/CouchbaseLocalContainerInfraService.java b/test-infra/camel-test-infra-couchbase/src/main/java/org/apache/camel/test/infra/couchbase/services/CouchbaseLocalContainerInfraService.java index 4df4d3fe6ee89..a892ce9ad2a60 100644 --- a/test-infra/camel-test-infra-couchbase/src/main/java/org/apache/camel/test/infra/couchbase/services/CouchbaseLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-couchbase/src/main/java/org/apache/camel/test/infra/couchbase/services/CouchbaseLocalContainerInfraService.java @@ -17,6 +17,7 @@ package org.apache.camel.test.infra.couchbase.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.couchbase.common.CouchbaseProperties; @@ -25,6 +26,7 @@ import org.testcontainers.couchbase.CouchbaseContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = CouchbaseInfraService.class, serviceAlias = { "couchbase" }) public class CouchbaseLocalContainerInfraService implements CouchbaseInfraService, ContainerService { /* diff --git a/test-infra/camel-test-infra-couchdb/src/main/java/org/apache/camel/test/infra/couchdb/services/CouchDbLocalContainerInfraService.java b/test-infra/camel-test-infra-couchdb/src/main/java/org/apache/camel/test/infra/couchdb/services/CouchDbLocalContainerInfraService.java index 036b72437d784..ff0541c1b95df 100644 --- a/test-infra/camel-test-infra-couchdb/src/main/java/org/apache/camel/test/infra/couchdb/services/CouchDbLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-couchdb/src/main/java/org/apache/camel/test/infra/couchdb/services/CouchDbLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.couchdb.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.couchdb.common.CouchDbProperties; @@ -25,6 +26,7 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +@InfraService(service = CouchDbInfraService.class, serviceAlias = { "couchdb" }) public class CouchDbLocalContainerInfraService implements CouchDbInfraService, ContainerService { public static final String CONTAINER_NAME = "couchdb"; diff --git a/test-infra/camel-test-infra-elasticsearch/src/main/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchLocalContainerInfraService.java b/test-infra/camel-test-infra-elasticsearch/src/main/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchLocalContainerInfraService.java index dcbf471892b01..55d598e65038f 100644 --- a/test-infra/camel-test-infra-elasticsearch/src/main/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-elasticsearch/src/main/java/org/apache/camel/test/infra/elasticsearch/services/ElasticSearchLocalContainerInfraService.java @@ -26,6 +26,7 @@ import javax.net.ssl.SSLContext; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil; import org.apache.camel.test.infra.common.services.ContainerService; @@ -35,6 +36,7 @@ import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; import org.testcontainers.elasticsearch.ElasticsearchContainer; +@InfraService(service = ElasticSearchInfraService.class, serviceAlias = { "elasticsearch", "elastic-search" }) public class ElasticSearchLocalContainerInfraService implements ElasticSearchInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(ElasticSearchLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-etcd3/src/main/java/org/apache/camel/test/infra/etcd3/services/Etcd3LocalContainerInfraService.java b/test-infra/camel-test-infra-etcd3/src/main/java/org/apache/camel/test/infra/etcd3/services/Etcd3LocalContainerInfraService.java index f2828ee0fcbb0..cd69c8c3675ff 100644 --- a/test-infra/camel-test-infra-etcd3/src/main/java/org/apache/camel/test/infra/etcd3/services/Etcd3LocalContainerInfraService.java +++ b/test-infra/camel-test-infra-etcd3/src/main/java/org/apache/camel/test/infra/etcd3/services/Etcd3LocalContainerInfraService.java @@ -20,6 +20,7 @@ import java.util.UUID; import io.etcd.jetcd.launcher.EtcdContainer; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.etcd3.common.Etcd3Properties; @@ -27,6 +28,7 @@ import org.slf4j.LoggerFactory; import org.testcontainers.containers.wait.strategy.Wait; +@InfraService(service = Etcd3InfraService.class, serviceAlias = { "etcd3" }) public class Etcd3LocalContainerInfraService implements Etcd3InfraService, ContainerService { public static final String CONTAINER_NAME = "etcd"; public static final int ETCD_CLIENT_PORT = 2379; diff --git a/test-infra/camel-test-infra-fhir/src/main/java/org/apache/camel/test/infra/fhir/services/FhirLocalContainerInfraService.java b/test-infra/camel-test-infra-fhir/src/main/java/org/apache/camel/test/infra/fhir/services/FhirLocalContainerInfraService.java index 7be625650cd26..b59e60cc772ef 100644 --- a/test-infra/camel-test-infra-fhir/src/main/java/org/apache/camel/test/infra/fhir/services/FhirLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-fhir/src/main/java/org/apache/camel/test/infra/fhir/services/FhirLocalContainerInfraService.java @@ -18,6 +18,7 @@ import java.time.Duration; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.fhir.common.FhirProperties; @@ -26,6 +27,7 @@ import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; +@InfraService(service = FhirInfraService.class, serviceAlias = { "fhir" }) public class FhirLocalContainerInfraService implements FhirInfraService, ContainerService { // needs https://github.com/hapifhir/hapi-fhir-jpaserver-starter/commit/54120f374eea5084634830d34c99a9137b22a310 public static final String CONTAINER_NAME = "fhir"; diff --git a/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpEmbeddedInfraService.java b/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpEmbeddedInfraService.java index 1827047ffb56e..d835376432670 100644 --- a/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpEmbeddedInfraService.java +++ b/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpEmbeddedInfraService.java @@ -24,6 +24,7 @@ import java.util.Set; import java.util.function.BiConsumer; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.services.AbstractService; import org.apache.camel.test.infra.ftp.common.FtpProperties; import org.apache.camel.test.infra.ftp.services.FtpInfraService; @@ -45,6 +46,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = FtpInfraService.class, serviceAlias = { "ftp" }) public class FtpEmbeddedInfraService extends AbstractService implements FtpInfraService { protected static final String DEFAULT_LISTENER = "default"; private static final Logger LOG = LoggerFactory.getLogger(FtpEmbeddedInfraService.class); diff --git a/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpsEmbeddedInfraService.java b/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpsEmbeddedInfraService.java index 0eb7b6420a9bf..4ef888d57f9f8 100644 --- a/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpsEmbeddedInfraService.java +++ b/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/FtpsEmbeddedInfraService.java @@ -19,13 +19,21 @@ import java.io.File; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.test.infra.ftp.services.FtpInfraService; import org.apache.ftpserver.FtpServerFactory; import org.apache.ftpserver.listener.ListenerFactory; import org.apache.ftpserver.ssl.SslConfigurationFactory; +@InfraService(service = FtpInfraService.class, serviceAlias = { "ftps" }) public class FtpsEmbeddedInfraService extends FtpEmbeddedInfraService { - public FtpsEmbeddedInfraService(EmbeddedConfigurationBuilder embeddedConfigurationBuilder) { - super(EmbeddedConfigurationBuilder.defaultFtpsConfigurationTemplate()); + + /** + * Use a default constructor with a default security configuration for camel jbang + */ + public FtpsEmbeddedInfraService() { + super(EmbeddedConfigurationBuilder.defaultFtpsConfigurationTemplate() + .withSecurityConfiguration(false, "TLSv1.3", true)); } public FtpsEmbeddedInfraService(EmbeddedConfiguration.SecurityConfiguration securityConfiguration) { diff --git a/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/SftpEmbeddedInfraService.java b/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/SftpEmbeddedInfraService.java index 016d6609c79ff..f81e6522caca3 100644 --- a/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/SftpEmbeddedInfraService.java +++ b/test-infra/camel-test-infra-ftp/src/main/java/org/apache/camel/test/infra/ftp/services/embedded/SftpEmbeddedInfraService.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.function.BiConsumer; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.services.AbstractService; import org.apache.camel.test.infra.ftp.common.FtpProperties; import org.apache.camel.test.infra.ftp.services.FtpInfraService; @@ -43,6 +44,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = FtpInfraService.class, serviceAlias = { "sftp" }) public class SftpEmbeddedInfraService extends AbstractService implements FtpInfraService { private static final Logger LOG = LoggerFactory.getLogger(SftpEmbeddedInfraService.class); diff --git a/test-infra/camel-test-infra-google-pubsub/src/main/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubLocalContainerInfraService.java b/test-infra/camel-test-infra-google-pubsub/src/main/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubLocalContainerInfraService.java index 4d0677fa3c236..6cb160ad70c8c 100644 --- a/test-infra/camel-test-infra-google-pubsub/src/main/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-google-pubsub/src/main/java/org/apache/camel/test/infra/google/pubsub/services/GooglePubSubLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.google.pubsub.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.google.pubsub.common.GooglePubSubProperties; @@ -24,6 +25,8 @@ import org.testcontainers.containers.PubSubEmulatorContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = GooglePubSubInfraService.class, serviceAlias = { "google", "google-pub-sub" }, + serviceImplementationAlias = "pub-sub") public class GooglePubSubLocalContainerInfraService implements GooglePubSubInfraService, ContainerService { diff --git a/test-infra/camel-test-infra-hashicorp-vault/src/main/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultLocalContainerInfraService.java b/test-infra/camel-test-infra-hashicorp-vault/src/main/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultLocalContainerInfraService.java index 9b959ad62288b..d92e39ba2d004 100644 --- a/test-infra/camel-test-infra-hashicorp-vault/src/main/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-hashicorp-vault/src/main/java/org/apache/camel/test/infra/hashicorp/vault/services/HashicorpVaultLocalContainerInfraService.java @@ -34,6 +34,7 @@ import java.util.function.Consumer; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.hashicorp.vault.common.HashicorpVaultProperties; @@ -44,6 +45,8 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.wait.strategy.Wait; +@InfraService(service = HashicorpVaultInfraService.class, serviceAlias = { "hashicorp-vault", "hashicorp" }, + serviceImplementationAlias = "vault") public class HashicorpVaultLocalContainerInfraService implements HashicorpVaultInfraService, ContainerService> { public static final String CONTAINER_NAME = "hashicorp-vault"; diff --git a/test-infra/camel-test-infra-hazelcast/src/main/java/org/apache/camel/test/infra/hazelcast/services/HazelcastEmbeddedInfraService.java b/test-infra/camel-test-infra-hazelcast/src/main/java/org/apache/camel/test/infra/hazelcast/services/HazelcastEmbeddedInfraService.java index 53ce2392fa96d..6a3ae550dc640 100644 --- a/test-infra/camel-test-infra-hazelcast/src/main/java/org/apache/camel/test/infra/hazelcast/services/HazelcastEmbeddedInfraService.java +++ b/test-infra/camel-test-infra-hazelcast/src/main/java/org/apache/camel/test/infra/hazelcast/services/HazelcastEmbeddedInfraService.java @@ -18,7 +18,9 @@ package org.apache.camel.test.infra.hazelcast.services; import com.hazelcast.config.Config; +import org.apache.camel.spi.annotations.InfraService; +@InfraService(service = HazelcastInfraService.class, serviceAlias = { "hazelcast" }) public class HazelcastEmbeddedInfraService implements HazelcastInfraService { @Override diff --git a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQInfraService.java b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQInfraService.java index 694966d9f813a..2506c38eda93b 100644 --- a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQInfraService.java +++ b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQInfraService.java @@ -16,11 +16,13 @@ */ package org.apache.camel.test.infra.hivemq.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.hivemq.common.HiveMQProperties; import org.testcontainers.hivemq.HiveMQContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = HiveMQInfraService.class, serviceAlias = { "hivemq", "hive-mq" }) public class LocalHiveMQInfraService extends AbstractLocalHiveMQService { LocalHiveMQInfraService() { diff --git a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java index afa19f0acb865..7ee36e269fc48 100644 --- a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java +++ b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java @@ -16,12 +16,15 @@ */ package org.apache.camel.test.infra.hivemq.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.hivemq.common.HiveMQProperties; import org.testcontainers.hivemq.HiveMQContainer; import org.testcontainers.images.builder.ImageFromDockerfile; import org.testcontainers.utility.DockerImageName; +@InfraService(service = HiveMQInfraService.class, serviceAlias = { "hivemq", "hive-mq" }, + serviceImplementationAlias = "sparkplug") public class LocalHiveMQSparkplugTCKInfraService extends AbstractLocalHiveMQService { LocalHiveMQSparkplugTCKInfraService() { diff --git a/test-infra/camel-test-infra-ignite/src/main/java/org/apache/camel/test/infra/ignite/services/IgniteEmbeddedInfraService.java b/test-infra/camel-test-infra-ignite/src/main/java/org/apache/camel/test/infra/ignite/services/IgniteEmbeddedInfraService.java index 90b6524cac807..d7428389178e8 100644 --- a/test-infra/camel-test-infra-ignite/src/main/java/org/apache/camel/test/infra/ignite/services/IgniteEmbeddedInfraService.java +++ b/test-infra/camel-test-infra-ignite/src/main/java/org/apache/camel/test/infra/ignite/services/IgniteEmbeddedInfraService.java @@ -20,6 +20,7 @@ import java.util.Collections; import java.util.UUID; +import org.apache.camel.spi.annotations.InfraService; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.configuration.IgniteConfiguration; @@ -31,6 +32,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = IgniteInfraService.class, serviceAlias = { "ignite" }) public class IgniteEmbeddedInfraService implements IgniteInfraService { private static final Logger LOG = LoggerFactory.getLogger(IgniteEmbeddedInfraService.class); diff --git a/test-infra/camel-test-infra-infinispan/src/main/java/org/apache/camel/test/infra/infinispan/services/InfinispanLocalContainerInfraService.java b/test-infra/camel-test-infra-infinispan/src/main/java/org/apache/camel/test/infra/infinispan/services/InfinispanLocalContainerInfraService.java index 555e96ff481d7..9baad3c90533c 100644 --- a/test-infra/camel-test-infra-infinispan/src/main/java/org/apache/camel/test/infra/infinispan/services/InfinispanLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-infinispan/src/main/java/org/apache/camel/test/infra/infinispan/services/InfinispanLocalContainerInfraService.java @@ -18,6 +18,7 @@ import java.util.function.Consumer; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.infinispan.common.InfinispanProperties; @@ -29,6 +30,7 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.wait.strategy.Wait; +@InfraService(service = InfinispanInfraService.class, serviceAlias = { "infinispan" }) public class InfinispanLocalContainerInfraService implements InfinispanInfraService, ContainerService> { public static final String CONTAINER_NAME = "infinispan"; private static final String DEFAULT_USERNAME = "admin"; diff --git a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/ContainerLocalKafkaInfraService.java b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/ContainerLocalKafkaInfraService.java index 0d7e48ce72c06..ef7569d49e988 100644 --- a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/ContainerLocalKafkaInfraService.java +++ b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/ContainerLocalKafkaInfraService.java @@ -17,6 +17,7 @@ package org.apache.camel.test.infra.kafka.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.kafka.common.KafkaProperties; @@ -25,6 +26,7 @@ import org.testcontainers.kafka.KafkaContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = KafkaInfraService.class, serviceAlias = "kafka") public class ContainerLocalKafkaInfraService implements KafkaInfraService, ContainerService { public static final String KAFKA3_IMAGE_NAME = LocalPropertyResolver.getProperty( ContainerLocalKafkaInfraService.class, diff --git a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaInfraService.java b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaInfraService.java index fb0a97e97bc90..677e8b8c9a663 100644 --- a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaInfraService.java +++ b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.kafka.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.TestUtils; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.kafka.common.KafkaProperties; @@ -24,6 +25,7 @@ import org.testcontainers.containers.Network; import org.testcontainers.redpanda.RedpandaContainer; +@InfraService(service = KafkaInfraService.class, serviceAlias = "kafka", serviceImplementationAlias = "redpanda") public class RedpandaInfraService implements KafkaInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(RedpandaInfraService.class); diff --git a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaTransactionsEnabledContainer.java b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaTransactionsEnabledContainer.java index 91d2adc9850b9..51b543d248610 100644 --- a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaTransactionsEnabledContainer.java +++ b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/RedpandaTransactionsEnabledContainer.java @@ -21,6 +21,7 @@ import org.apache.camel.test.infra.kafka.common.KafkaProperties; import org.testcontainers.images.builder.Transferable; import org.testcontainers.redpanda.RedpandaContainer; +import org.testcontainers.utility.DockerImageName; public class RedpandaTransactionsEnabledContainer extends RedpandaContainer { public static final String REDPANDA_CONTAINER = LocalPropertyResolver.getProperty( @@ -29,7 +30,8 @@ public class RedpandaTransactionsEnabledContainer extends RedpandaContainer { public static final int REDPANDA_PORT = 9092; public RedpandaTransactionsEnabledContainer(String image) { - super(image); + super(DockerImageName.parse(System.getProperty(KafkaProperties.REDPANDA_CONTAINER, REDPANDA_CONTAINER)) + .asCompatibleSubstituteFor("redpandadata/redpanda")); } protected void containerIsStarting(InspectContainerResponse containerInfo) { diff --git a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/StrimziInfraService.java b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/StrimziInfraService.java index 4334b73a20cb9..3803bfac2209c 100644 --- a/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/StrimziInfraService.java +++ b/test-infra/camel-test-infra-kafka/src/main/java/org/apache/camel/test/infra/kafka/services/StrimziInfraService.java @@ -17,6 +17,7 @@ package org.apache.camel.test.infra.kafka.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.TestUtils; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.kafka.common.KafkaProperties; @@ -24,6 +25,7 @@ import org.slf4j.LoggerFactory; import org.testcontainers.containers.Network; +@InfraService(service = KafkaInfraService.class, serviceAlias = "kafka", serviceImplementationAlias = "strimzi") public class StrimziInfraService implements KafkaInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(StrimziInfraService.class); diff --git a/test-infra/camel-test-infra-microprofile-lra/src/main/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRALocalContainerInfraService.java b/test-infra/camel-test-infra-microprofile-lra/src/main/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRALocalContainerInfraService.java index e4f4db3d62fc0..066fdeb21b5a8 100644 --- a/test-infra/camel-test-infra-microprofile-lra/src/main/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRALocalContainerInfraService.java +++ b/test-infra/camel-test-infra-microprofile-lra/src/main/java/org/apache/camel/test/infra/microprofile/lra/services/MicroprofileLRALocalContainerInfraService.java @@ -17,6 +17,7 @@ package org.apache.camel.test.infra.microprofile.lra.services; import com.github.dockerjava.api.model.Network; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.microprofile.lra.common.MicroprofileLRAProperties; @@ -26,6 +27,8 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +@InfraService(service = MicroprofileLRAInfraService.class, serviceAlias = { "microprofile-lra", "microprofile" }, + serviceImplementationAlias = "lra") public class MicroprofileLRALocalContainerInfraService implements MicroprofileLRAInfraService, ContainerService { public static final String CONTAINER_NAME = "microprofile-lra"; diff --git a/test-infra/camel-test-infra-milvus/src/main/java/org/apache/camel/test/infra/milvus/services/MilvusLocalContainerInfraService.java b/test-infra/camel-test-infra-milvus/src/main/java/org/apache/camel/test/infra/milvus/services/MilvusLocalContainerInfraService.java index 7d0af0663d338..c580931c1ccdd 100644 --- a/test-infra/camel-test-infra-milvus/src/main/java/org/apache/camel/test/infra/milvus/services/MilvusLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-milvus/src/main/java/org/apache/camel/test/infra/milvus/services/MilvusLocalContainerInfraService.java @@ -20,6 +20,7 @@ import java.net.URL; import java.time.Duration; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.milvus.common.MilvusProperties; @@ -28,6 +29,7 @@ import org.testcontainers.milvus.MilvusContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = MilvusInfraService.class, serviceAlias = { "milvus" }) public class MilvusLocalContainerInfraService implements MilvusInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(MilvusLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-minio/src/main/java/org/apache/camel/test/infra/minio/services/MinioLocalContainerInfraService.java b/test-infra/camel-test-infra-minio/src/main/java/org/apache/camel/test/infra/minio/services/MinioLocalContainerInfraService.java index ed9417fb85a32..2e7b0fb2f09c8 100644 --- a/test-infra/camel-test-infra-minio/src/main/java/org/apache/camel/test/infra/minio/services/MinioLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-minio/src/main/java/org/apache/camel/test/infra/minio/services/MinioLocalContainerInfraService.java @@ -18,6 +18,7 @@ import java.time.Duration; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.minio.common.MinioProperties; @@ -26,6 +27,7 @@ import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.HttpWaitStrategy; +@InfraService(service = MinioInfraService.class, serviceAlias = { "minio" }) public class MinioLocalContainerInfraService implements MinioInfraService, ContainerService { public static final String CONTAINER_NAME = "minio"; private static final String ACCESS_KEY; diff --git a/test-infra/camel-test-infra-mongodb/src/main/java/org/apache/camel/test/infra/mongodb/services/MongoDBLocalContainerInfraService.java b/test-infra/camel-test-infra-mongodb/src/main/java/org/apache/camel/test/infra/mongodb/services/MongoDBLocalContainerInfraService.java index 07b19490a6950..15bbd95d00fe6 100644 --- a/test-infra/camel-test-infra-mongodb/src/main/java/org/apache/camel/test/infra/mongodb/services/MongoDBLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-mongodb/src/main/java/org/apache/camel/test/infra/mongodb/services/MongoDBLocalContainerInfraService.java @@ -17,6 +17,7 @@ package org.apache.camel.test.infra.mongodb.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.mongodb.common.MongoDBProperties; @@ -25,6 +26,7 @@ import org.testcontainers.containers.MongoDBContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = MongoDBInfraService.class, serviceAlias = { "mongodb" }) public class MongoDBLocalContainerInfraService implements MongoDBInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(MongoDBLocalContainerInfraService.class); private static final int DEFAULT_MONGODB_PORT = 27017; diff --git a/test-infra/camel-test-infra-mosquitto/src/main/java/org/apache/camel/test/infra/mosquitto/services/MosquittoLocalContainerInfraService.java b/test-infra/camel-test-infra-mosquitto/src/main/java/org/apache/camel/test/infra/mosquitto/services/MosquittoLocalContainerInfraService.java index 961aaddd23eb7..2d0bde91a0cee 100644 --- a/test-infra/camel-test-infra-mosquitto/src/main/java/org/apache/camel/test/infra/mosquitto/services/MosquittoLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-mosquitto/src/main/java/org/apache/camel/test/infra/mosquitto/services/MosquittoLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.mosquitto.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.mosquitto.common.MosquittoProperties; @@ -26,6 +27,7 @@ import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; +@InfraService(service = MosquittoInfraService.class, serviceAlias = { "mosquitto" }) public class MosquittoLocalContainerInfraService implements MosquittoInfraService, ContainerService { public static final String CONTAINER_NAME = "mosquitto"; public static final int CONTAINER_PORT = 1883; diff --git a/test-infra/camel-test-infra-nats/src/main/java/org/apache/camel/test/infra/nats/services/NatsLocalContainerInfraService.java b/test-infra/camel-test-infra-nats/src/main/java/org/apache/camel/test/infra/nats/services/NatsLocalContainerInfraService.java index 26744ab451a36..b1939327cdf94 100644 --- a/test-infra/camel-test-infra-nats/src/main/java/org/apache/camel/test/infra/nats/services/NatsLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-nats/src/main/java/org/apache/camel/test/infra/nats/services/NatsLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.nats.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.nats.common.NatsProperties; @@ -24,6 +25,7 @@ import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; +@InfraService(service = NatsInfraService.class, serviceAlias = { "nats" }) public class NatsLocalContainerInfraService implements NatsInfraService, ContainerService { public static final String CONTAINER_NAME = "nats"; private static final int PORT = 4222; diff --git a/test-infra/camel-test-infra-ollama/src/main/java/org/apache/camel/test/infra/ollama/services/OllamaLocalContainerInfraService.java b/test-infra/camel-test-infra-ollama/src/main/java/org/apache/camel/test/infra/ollama/services/OllamaLocalContainerInfraService.java index 9e3d206ecc20d..a53aeac2cc4d6 100644 --- a/test-infra/camel-test-infra-ollama/src/main/java/org/apache/camel/test/infra/ollama/services/OllamaLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-ollama/src/main/java/org/apache/camel/test/infra/ollama/services/OllamaLocalContainerInfraService.java @@ -18,6 +18,7 @@ import java.io.IOException; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.ollama.commons.OllamaProperties; @@ -26,6 +27,7 @@ import org.testcontainers.ollama.OllamaContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = OllamaInfraService.class, serviceAlias = { "ollama" }) public class OllamaLocalContainerInfraService implements OllamaInfraService, ContainerService { private static class DefaultServiceConfiguration implements OllamaServiceConfiguration { diff --git a/test-infra/camel-test-infra-openldap/src/main/java/org/apache/camel/test/infra/openldap/services/OpenldapLocalContainerInfraService.java b/test-infra/camel-test-infra-openldap/src/main/java/org/apache/camel/test/infra/openldap/services/OpenldapLocalContainerInfraService.java index edef96a0d1fe5..f3b2e3689b63e 100644 --- a/test-infra/camel-test-infra-openldap/src/main/java/org/apache/camel/test/infra/openldap/services/OpenldapLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-openldap/src/main/java/org/apache/camel/test/infra/openldap/services/OpenldapLocalContainerInfraService.java @@ -16,11 +16,13 @@ */ package org.apache.camel.test.infra.openldap.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.openldap.common.OpenldapProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = OpenldapInfraService.class, serviceAlias = { "openldap" }) public class OpenldapLocalContainerInfraService implements OpenldapInfraService, ContainerService { public static final int CONTAINER_PORT_LDAP = 389; public static final int CONTAINER_PORT_LDAP_OVER_SSL = 636; diff --git a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresLocalContainerInfraService.java b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresLocalContainerInfraService.java index 1a7e80e0e94ab..9ff3e51c73ec7 100644 --- a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresLocalContainerInfraService.java @@ -16,13 +16,16 @@ */ package org.apache.camel.test.infra.postgres.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.postgres.common.PostgresProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testcontainers.containers.PostgreSQLContainer; +import org.testcontainers.utility.DockerImageName; +@InfraService(service = PostgresInfraService.class, serviceAlias = { "postgres" }) public class PostgresLocalContainerInfraService implements PostgresInfraService, ContainerService { public static final String DEFAULT_POSTGRES_CONTAINER = LocalPropertyResolver.getProperty(PostgresLocalContainerInfraService.class, @@ -43,7 +46,8 @@ public PostgresLocalContainerInfraService(PostgreSQLContainer container) { } protected PostgreSQLContainer initContainer(String imageName) { - return new PostgreSQLContainer(imageName); + return new PostgreSQLContainer( + DockerImageName.parse(imageName).asCompatibleSubstituteFor("postgres")); } @Override diff --git a/test-infra/camel-test-infra-pulsar/src/main/java/org/apache/camel/test/infra/pulsar/services/PulsarLocalContainerInfraService.java b/test-infra/camel-test-infra-pulsar/src/main/java/org/apache/camel/test/infra/pulsar/services/PulsarLocalContainerInfraService.java index 5db0f51aac1e9..62946d75acf39 100644 --- a/test-infra/camel-test-infra-pulsar/src/main/java/org/apache/camel/test/infra/pulsar/services/PulsarLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-pulsar/src/main/java/org/apache/camel/test/infra/pulsar/services/PulsarLocalContainerInfraService.java @@ -18,6 +18,7 @@ import java.time.Duration; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.pulsar.common.PulsarProperties; @@ -26,6 +27,7 @@ import org.testcontainers.containers.PulsarContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = PulsarInfraService.class, serviceAlias = { "pulsar" }) public class PulsarLocalContainerInfraService implements PulsarInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(PulsarLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-qdrant/src/main/java/org/apache/camel/test/infra/qdrant/services/QdrantLocalContainerInfraService.java b/test-infra/camel-test-infra-qdrant/src/main/java/org/apache/camel/test/infra/qdrant/services/QdrantLocalContainerInfraService.java index e0a24980d7d13..4998f3830d509 100644 --- a/test-infra/camel-test-infra-qdrant/src/main/java/org/apache/camel/test/infra/qdrant/services/QdrantLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-qdrant/src/main/java/org/apache/camel/test/infra/qdrant/services/QdrantLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.qdrant.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.qdrant.common.QdrantProperties; @@ -25,6 +26,7 @@ import org.testcontainers.qdrant.QdrantContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = QdrantInfraService.class, serviceAlias = { "qdrant" }) public class QdrantLocalContainerInfraService implements QdrantInfraService, ContainerService { public static final int HTTP_PORT = 6333; public static final int GRPC_PORT = 6334; diff --git a/test-infra/camel-test-infra-rabbitmq/src/main/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQLocalContainerInfraService.java b/test-infra/camel-test-infra-rabbitmq/src/main/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQLocalContainerInfraService.java index 6fab9036efb22..8212e757de7cb 100644 --- a/test-infra/camel-test-infra-rabbitmq/src/main/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-rabbitmq/src/main/java/org/apache/camel/test/infra/rabbitmq/services/RabbitMQLocalContainerInfraService.java @@ -17,6 +17,7 @@ package org.apache.camel.test.infra.rabbitmq.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.rabbitmq.common.RabbitMQProperties; @@ -25,6 +26,7 @@ import org.testcontainers.containers.RabbitMQContainer; import org.testcontainers.utility.DockerImageName; +@InfraService(service = RabbitMQInfraService.class, serviceAlias = { "rabbitmq" }) public class RabbitMQLocalContainerInfraService implements RabbitMQInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(RabbitMQLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-redis/src/main/java/org/apache/camel/test/infra/redis/services/RedisLocalContainerInfraService.java b/test-infra/camel-test-infra-redis/src/main/java/org/apache/camel/test/infra/redis/services/RedisLocalContainerInfraService.java index 1954a22b521e8..41a061e5e8ef6 100644 --- a/test-infra/camel-test-infra-redis/src/main/java/org/apache/camel/test/infra/redis/services/RedisLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-redis/src/main/java/org/apache/camel/test/infra/redis/services/RedisLocalContainerInfraService.java @@ -16,11 +16,13 @@ */ package org.apache.camel.test.infra.redis.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.redis.common.RedisProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = RedisInfraService.class, serviceAlias = { "redis" }) public class RedisLocalContainerInfraService implements RedisInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(RedisLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-rocketmq/src/main/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainerInfraService.java b/test-infra/camel-test-infra-rocketmq/src/main/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainerInfraService.java index 84c0f8dd5d718..b406c6124cdd4 100644 --- a/test-infra/camel-test-infra-rocketmq/src/main/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainerInfraService.java +++ b/test-infra/camel-test-infra-rocketmq/src/main/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainerInfraService.java @@ -19,6 +19,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.rocketmq.common.RocketMQProperties; @@ -28,6 +29,7 @@ import org.testcontainers.containers.Container; import org.testcontainers.containers.Network; +@InfraService(service = RocketMQInfraService.class, serviceAlias = { "rocketmq" }) public class RocketMQContainerInfraService implements RocketMQInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(RocketMQContainerInfraService.class); public static final String ROCKETMQ_VERSION = LocalPropertyResolver.getProperty( diff --git a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbLocalContainerInfraService.java b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbLocalContainerInfraService.java index 241ec0c8533c1..d96763be8df54 100644 --- a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbLocalContainerInfraService.java @@ -16,10 +16,12 @@ */ package org.apache.camel.test.infra.smb.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.util.IOHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = SmbLocalContainerInfraService.class, serviceAlias = { "smb" }) public class SmbLocalContainerInfraService implements SmbInfraService { protected static final Logger LOG = LoggerFactory.getLogger(SmbLocalContainerInfraService.class); protected final SmbContainer container = new SmbContainer(); diff --git a/test-infra/camel-test-infra-solr/src/main/java/org/apache/camel/test/infra/solr/services/SolrLocalContainerInfraService.java b/test-infra/camel-test-infra-solr/src/main/java/org/apache/camel/test/infra/solr/services/SolrLocalContainerInfraService.java index cca2af6ddf877..ca3b5ac8569f7 100644 --- a/test-infra/camel-test-infra-solr/src/main/java/org/apache/camel/test/infra/solr/services/SolrLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-solr/src/main/java/org/apache/camel/test/infra/solr/services/SolrLocalContainerInfraService.java @@ -16,11 +16,13 @@ */ package org.apache.camel.test.infra.solr.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.solr.common.SolrProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = SolrInfraService.class, serviceAlias = { "solr" }) public class SolrLocalContainerInfraService implements SolrInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(SolrLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-torchserve/src/main/java/org/apache/camel/test/infra/torchserve/services/TorchServeLocalContainerInfraService.java b/test-infra/camel-test-infra-torchserve/src/main/java/org/apache/camel/test/infra/torchserve/services/TorchServeLocalContainerInfraService.java index 84f43a3011dcc..9fd8a68392f49 100644 --- a/test-infra/camel-test-infra-torchserve/src/main/java/org/apache/camel/test/infra/torchserve/services/TorchServeLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-torchserve/src/main/java/org/apache/camel/test/infra/torchserve/services/TorchServeLocalContainerInfraService.java @@ -16,6 +16,7 @@ */ package org.apache.camel.test.infra.torchserve.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.torchserve.common.TorchServeProperties; @@ -26,6 +27,7 @@ import org.testcontainers.utility.DockerImageName; import org.testcontainers.utility.MountableFile; +@InfraService(service = TorchServeInfraService.class, serviceAlias = { "torch-serve" }) public class TorchServeLocalContainerInfraService implements TorchServeInfraService, ContainerService> { private static final Logger LOG = LoggerFactory.getLogger(TorchServeLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-xmpp/src/main/java/org/apache/camel/test/infra/xmpp/services/XmppLocalContainerInfraService.java b/test-infra/camel-test-infra-xmpp/src/main/java/org/apache/camel/test/infra/xmpp/services/XmppLocalContainerInfraService.java index aa93199d38b4b..b76a27bc9821b 100644 --- a/test-infra/camel-test-infra-xmpp/src/main/java/org/apache/camel/test/infra/xmpp/services/XmppLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-xmpp/src/main/java/org/apache/camel/test/infra/xmpp/services/XmppLocalContainerInfraService.java @@ -16,12 +16,14 @@ */ package org.apache.camel.test.infra.xmpp.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.xmpp.common.XmppProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = XmppInfraService.class, serviceAlias = { "xmpp" }) public class XmppLocalContainerInfraService implements XmppInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(XmppLocalContainerInfraService.class); diff --git a/test-infra/camel-test-infra-zookeeper/src/main/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperLocalContainerInfraService.java b/test-infra/camel-test-infra-zookeeper/src/main/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperLocalContainerInfraService.java index d35ffe9361f2c..dd22dcf4b827b 100644 --- a/test-infra/camel-test-infra-zookeeper/src/main/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperLocalContainerInfraService.java +++ b/test-infra/camel-test-infra-zookeeper/src/main/java/org/apache/camel/test/infra/zookeeper/services/ZooKeeperLocalContainerInfraService.java @@ -16,12 +16,14 @@ */ package org.apache.camel.test.infra.zookeeper.services; +import org.apache.camel.spi.annotations.InfraService; import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.common.services.ContainerService; import org.apache.camel.test.infra.zookeeper.common.ZooKeeperProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@InfraService(service = ZooKeeperInfraService.class, serviceAlias = { "zookeeper" }) public class ZooKeeperLocalContainerInfraService implements ZooKeeperInfraService, ContainerService { private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperLocalContainerInfraService.class); diff --git a/test-infra/pom.xml b/test-infra/pom.xml index 5a25e97b2d674..6b8e7e08d1fda 100644 --- a/test-infra/pom.xml +++ b/test-infra/pom.xml @@ -89,8 +89,16 @@ camel-test-infra-hivemq camel-test-infra-torchserve camel-test-infra-tensorflow-serving + camel-test-infra-all + + + org.apache.camel + spi-annotations + + + diff --git a/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java b/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java index 903a9728d7658..51703d03ae874 100644 --- a/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java +++ b/tests/camel-itest/src/test/java/org/apache/camel/itest/security/GreeterClientTest.java @@ -27,6 +27,7 @@ import javax.xml.namespace.QName; import org.apache.camel.CamelContext; +import org.apache.camel.test.AvailablePort; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.spring.junit5.CamelSpringTest; import org.apache.cxf.endpoint.Client; @@ -129,7 +130,7 @@ void testServiceWithNotAuthorizedUser() { public static boolean isPortAvailable() { try { - AvailablePortFinder.probePort(InetAddress.getByName("localhost"), 9000); + AvailablePort.probePort(InetAddress.getByName("localhost"), 9000); } catch (IllegalStateException | UnknownHostException e) { return false; } diff --git a/tooling/maven/camel-package-maven-plugin/pom.xml b/tooling/maven/camel-package-maven-plugin/pom.xml index 9f592b91abb63..6bb7fb14a1fa9 100644 --- a/tooling/maven/camel-package-maven-plugin/pom.xml +++ b/tooling/maven/camel-package-maven-plugin/pom.xml @@ -154,6 +154,11 @@ ${velocity-version} + + com.fasterxml.jackson.core + jackson-databind + + org.apache.logging.log4j diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/CamelTestInfraGenerateMetadataMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/CamelTestInfraGenerateMetadataMojo.java new file mode 100644 index 0000000000000..8b66134c8c322 --- /dev/null +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/CamelTestInfraGenerateMetadataMojo.java @@ -0,0 +1,140 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.maven.packaging; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.inject.Inject; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.camel.maven.packaging.generics.PackagePluginUtils; +import org.apache.camel.spi.annotations.InfraService; +import org.apache.camel.tooling.util.FileUtil; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; +import org.codehaus.plexus.build.BuildContext; +import org.jboss.jandex.AnnotationInstance; +import org.jboss.jandex.AnnotationValue; +import org.jboss.jandex.DotName; + +/** + * Gather all classes annotated with @InfraService and create a JSON file containing all the metadata. + * + * The JSON can be used to retrieve the test-infra information and run the services (via Camel JBang for example) + */ +@Mojo(name = "test-infra-generate-metadata", threadSafe = true, + requiresDependencyResolution = ResolutionScope.COMPILE, defaultPhase = LifecyclePhase.PROCESS_CLASSES) +public class CamelTestInfraGenerateMetadataMojo extends AbstractGeneratorMojo { + + @Parameter(property = "project", required = true, readonly = true) + protected MavenProject project; + @Parameter(defaultValue = "${project.basedir}/target/classes/META-INF") + protected File resourcesOutputDir; + + public static final DotName INFRA_SERVICE = DotName.createSimple(InfraService.class.getName()); + + @Inject + protected CamelTestInfraGenerateMetadataMojo(MavenProjectHelper projectHelper, BuildContext buildContext) { + super(projectHelper, buildContext); + } + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + Set models = new HashSet<>(); + + for (AnnotationInstance ai : PackagePluginUtils.readJandexIndexQuietly(project).getAnnotations(INFRA_SERVICE)) { + + InfrastructureServiceModel infrastructureServiceModel = new InfrastructureServiceModel(); + + infrastructureServiceModel.setImplementation(ai.target().toString()); + for (AnnotationValue av : ai.values()) { + if (av.name().equals("service")) { + infrastructureServiceModel.setService(av.asString()); + } else if (av.name().equals("serviceAlias")) { + infrastructureServiceModel.setAlias(Arrays.asList(av.asStringArray())); + } else if (av.name().equals("serviceImplementationAlias")) { + infrastructureServiceModel.getAliasImplementation().addAll(Arrays.asList(av.asStringArray())); + } + } + + models.add(infrastructureServiceModel); + } + + try { + String modelsAsJson = new ObjectMapper().writeValueAsString(models); + + if (resourcesOutputDir == null) { + resourcesOutputDir = new File(project.getBasedir(), "src/generated/resources"); + } + + FileUtil.updateFile(resourcesOutputDir.toPath().resolve("test-infra-metadata.json"), modelsAsJson); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private class InfrastructureServiceModel { + private String service; + private String implementation; + private List alias = new ArrayList<>(); + private List aliasImplementation = new ArrayList<>(); + + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public String getImplementation() { + return implementation; + } + + public void setImplementation(String implementation) { + this.implementation = implementation; + } + + public List getAlias() { + return alias; + } + + public void setAlias(List alias) { + this.alias = alias; + } + + public List getAliasImplementation() { + return aliasImplementation; + } + + public void setAliasImplementation(List aliasImplementation) { + this.aliasImplementation = aliasImplementation; + } + } +} diff --git a/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/InfraService.java b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/InfraService.java new file mode 100644 index 0000000000000..b7f513b747c4b --- /dev/null +++ b/tooling/spi-annotations/src/main/java/org/apache/camel/spi/annotations/InfraService.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.spi.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Documented +@Target({ ElementType.TYPE }) +public @interface InfraService { + + Class service(); + + String[] serviceAlias(); + + String[] serviceImplementationAlias() default {}; +}