This is an automated email from the ASF dual-hosted git repository. ppalaga pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 290eadede5f403572a55ac1f2abb22aca3ea2949 Author: Peter Palaga <ppal...@redhat.com> AuthorDate: Wed Feb 10 15:48:52 2021 +0100 Allow running AWS 2 tests both grouped and isolated --- .../aws2-s3/README.adoc | 0 .../aws2-s3/pom.xml | 14 ++- .../quarkus/component/aws2/Aws2S3Resource.java | 0 .../src/main/resources/application.properties | 0 .../camel/quarkus/component/aws2/Aws2S3IT.java | 0 .../camel/quarkus/component/aws2/Aws2S3Test.java | 0 .../component/aws2/Aws2S3TestEnvCustomizer.java | 0 ...quarkus.test.support.aws2.Aws2TestEnvCustomizer | 0 .../aws2-sqs-sns/README.adoc | 0 .../aws2-sqs-sns/pom.xml | 2 +- .../component/aws2/sqs/it/Aws2SqsSnsResource.java | 2 +- .../src/main/resources/application.properties | 0 .../component/aws2/sqs/it/Aws2SqsSnsIT.java | 2 +- .../component/aws2/sqs/it/Aws2SqsSnsTest.java | 2 +- .../aws2/sqs/it/Aws2SqsSnsTestEnvCustomizer.java | 2 +- ...quarkus.test.support.aws2.Aws2TestEnvCustomizer | 1 + integration-tests-aws2/pom.xml | 45 +++++++++ integration-tests/aws2-grouped/README.adoc | 19 ++++ .../{aws2-sqs-sns => aws2-grouped}/pom.xml | 112 +++++++++++++++++++-- ...quarkus.test.support.aws2.Aws2TestEnvCustomizer | 1 - integration-tests/pom.xml | 3 +- pom.xml | 8 +- tooling/scripts/group-tests.groovy | 50 +++++++++ tooling/scripts/test-categories.yaml | 3 +- 24 files changed, 242 insertions(+), 24 deletions(-) diff --git a/integration-tests/aws2-s3/README.adoc b/integration-tests-aws2/aws2-s3/README.adoc similarity index 100% rename from integration-tests/aws2-s3/README.adoc rename to integration-tests-aws2/aws2-s3/README.adoc diff --git a/integration-tests/aws2-s3/pom.xml b/integration-tests-aws2/aws2-s3/pom.xml similarity index 91% rename from integration-tests/aws2-s3/pom.xml rename to integration-tests-aws2/aws2-s3/pom.xml index 3430b7c..f7e0b71 100644 --- a/integration-tests/aws2-s3/pom.xml +++ b/integration-tests-aws2/aws2-s3/pom.xml @@ -20,7 +20,7 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-integration-tests</artifactId> + <artifactId>camel-quarkus-integration-tests-aws2</artifactId> <version>1.7.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> @@ -29,6 +29,18 @@ <name>Camel Quarkus :: Integration Tests :: AWS2 S3</name> <description>The camel integration tests</description> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom-test</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> <dependency> <groupId>org.apache.camel.quarkus</groupId> diff --git a/integration-tests/aws2-s3/src/main/java/org/apache/camel/quarkus/component/aws2/Aws2S3Resource.java b/integration-tests-aws2/aws2-s3/src/main/java/org/apache/camel/quarkus/component/aws2/Aws2S3Resource.java similarity index 100% rename from integration-tests/aws2-s3/src/main/java/org/apache/camel/quarkus/component/aws2/Aws2S3Resource.java rename to integration-tests-aws2/aws2-s3/src/main/java/org/apache/camel/quarkus/component/aws2/Aws2S3Resource.java diff --git a/integration-tests/aws2-s3/src/main/resources/application.properties b/integration-tests-aws2/aws2-s3/src/main/resources/application.properties similarity index 100% rename from integration-tests/aws2-s3/src/main/resources/application.properties rename to integration-tests-aws2/aws2-s3/src/main/resources/application.properties diff --git a/integration-tests/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3IT.java b/integration-tests-aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3IT.java similarity index 100% rename from integration-tests/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3IT.java rename to integration-tests-aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3IT.java diff --git a/integration-tests/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3Test.java b/integration-tests-aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3Test.java similarity index 100% rename from integration-tests/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3Test.java rename to integration-tests-aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3Test.java diff --git a/integration-tests/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3TestEnvCustomizer.java b/integration-tests-aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3TestEnvCustomizer.java similarity index 100% rename from integration-tests/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3TestEnvCustomizer.java rename to integration-tests-aws2/aws2-s3/src/test/java/org/apache/camel/quarkus/component/aws2/Aws2S3TestEnvCustomizer.java diff --git a/integration-tests/aws2-s3/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer b/integration-tests-aws2/aws2-s3/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer similarity index 100% rename from integration-tests/aws2-s3/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer rename to integration-tests-aws2/aws2-s3/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer diff --git a/integration-tests/aws2-sqs-sns/README.adoc b/integration-tests-aws2/aws2-sqs-sns/README.adoc similarity index 100% rename from integration-tests/aws2-sqs-sns/README.adoc rename to integration-tests-aws2/aws2-sqs-sns/README.adoc diff --git a/integration-tests/aws2-sqs-sns/pom.xml b/integration-tests-aws2/aws2-sqs-sns/pom.xml similarity index 98% copy from integration-tests/aws2-sqs-sns/pom.xml copy to integration-tests-aws2/aws2-sqs-sns/pom.xml index 962ea6f..a83ec15 100644 --- a/integration-tests/aws2-sqs-sns/pom.xml +++ b/integration-tests-aws2/aws2-sqs-sns/pom.xml @@ -23,7 +23,7 @@ <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-integration-tests</artifactId> + <artifactId>camel-quarkus-integration-tests-aws2</artifactId> <version>1.7.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> diff --git a/integration-tests/aws2-sqs-sns/src/main/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsResource.java b/integration-tests-aws2/aws2-sqs-sns/src/main/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsResource.java similarity index 99% rename from integration-tests/aws2-sqs-sns/src/main/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsResource.java rename to integration-tests-aws2/aws2-sqs-sns/src/main/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsResource.java index cfc1325..228740b 100644 --- a/integration-tests/aws2-sqs-sns/src/main/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsResource.java +++ b/integration-tests-aws2/aws2-sqs-sns/src/main/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsResource.java @@ -37,7 +37,7 @@ import software.amazon.awssdk.services.sqs.model.ListQueuesResponse; @Path("/aws2-sqs-sns") @ApplicationScoped -public class Aws2SqsResource { +public class Aws2SqsSnsResource { @ConfigProperty(name = "aws-sqs.queue-name") String queueName; diff --git a/integration-tests/aws2-sqs-sns/src/main/resources/application.properties b/integration-tests-aws2/aws2-sqs-sns/src/main/resources/application.properties similarity index 100% rename from integration-tests/aws2-sqs-sns/src/main/resources/application.properties rename to integration-tests-aws2/aws2-sqs-sns/src/main/resources/application.properties diff --git a/integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsIT.java b/integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsIT.java similarity index 96% rename from integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsIT.java rename to integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsIT.java index 4212303..efe8d68 100644 --- a/integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsIT.java +++ b/integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsIT.java @@ -21,6 +21,6 @@ import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; @NativeImageTest @EnabledIfEnvironmentVariable(named = "AWS_ACCESS_KEY", matches = "[a-zA-Z0-9]+") // TODO https://github.com/apache/camel-quarkus/issues/2216 -class Aws2SqsIT extends Aws2SqsTest { +class Aws2SqsSnsIT extends Aws2SqsSnsTest { } diff --git a/integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTest.java b/integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsTest.java similarity index 99% rename from integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTest.java rename to integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsTest.java index ddc912d..d55b8d5 100644 --- a/integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTest.java +++ b/integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsTest.java @@ -39,7 +39,7 @@ import static org.hamcrest.core.Is.is; @QuarkusTestResource(Aws2TestResource.class) @EnabledIfEnvironmentVariable(named = "AWS_ACCESS_KEY", matches = "[a-zA-Z0-9]+") // TODO // https://github.com/apache/camel-quarkus/issues/2216 -class Aws2SqsTest { +class Aws2SqsSnsTest { @Test public void sqs() { diff --git a/integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTestEnvCustomizer.java b/integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsTestEnvCustomizer.java similarity index 98% rename from integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTestEnvCustomizer.java rename to integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsTestEnvCustomizer.java index b4231b1..fb9d980 100644 --- a/integration-tests/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsTestEnvCustomizer.java +++ b/integration-tests-aws2/aws2-sqs-sns/src/test/java/org/apache/camel/quarkus/component/aws2/sqs/it/Aws2SqsSnsTestEnvCustomizer.java @@ -36,7 +36,7 @@ import software.amazon.awssdk.services.sqs.model.GetQueueAttributesRequest; import software.amazon.awssdk.services.sqs.model.QueueAttributeName; import software.amazon.awssdk.services.sqs.model.SetQueueAttributesRequest; -public class Aws2SqsTestEnvCustomizer implements Aws2TestEnvCustomizer { +public class Aws2SqsSnsTestEnvCustomizer implements Aws2TestEnvCustomizer { @Override public Service[] localstackServices() { diff --git a/integration-tests-aws2/aws2-sqs-sns/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer b/integration-tests-aws2/aws2-sqs-sns/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer new file mode 100644 index 0000000..d1971b8 --- /dev/null +++ b/integration-tests-aws2/aws2-sqs-sns/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer @@ -0,0 +1 @@ +org.apache.camel.quarkus.component.aws2.sqs.it.Aws2SqsSnsTestEnvCustomizer \ No newline at end of file diff --git a/integration-tests-aws2/pom.xml b/integration-tests-aws2/pom.xml new file mode 100644 index 0000000..0448a1c --- /dev/null +++ b/integration-tests-aws2/pom.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-build-parent-it</artifactId> + <version>1.7.0-SNAPSHOT</version> + <relativePath>../poms/build-parent-it/pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-integration-tests-aws2</artifactId> + <packaging>pom</packaging> + + <name>Camel Quarkus :: AWS 2 Integration Tests</name> + + <properties> + <quarkus.banner.enabled>false</quarkus.banner.enabled> + </properties> + + <modules> + <!-- extensions a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat --> + <module>aws2-s3</module> + <module>aws2-sqs-sns</module> + </modules> + +</project> diff --git a/integration-tests/aws2-grouped/README.adoc b/integration-tests/aws2-grouped/README.adoc new file mode 100644 index 0000000..6c00519 --- /dev/null +++ b/integration-tests/aws2-grouped/README.adoc @@ -0,0 +1,19 @@ +== AWS 2 grouped integration tests + +This module allows executing all tests from `integration-tests-aws2/*` grouped together. + +While grouping brings the benefit of faster native compilation +(compared to the sum of compilation times of all modules under `integration-tests-aws2/*`) +it is methodologically not as clean as running those tests in isolation. +Hence, this module is intended to be run instead of the tests under `integration-tests-aws2/*` +if, in the given situation, the speed matters more than isolation. + +=== How the grouping works + +The grouped module dynamically pulls all sources from the individual AWS test modules to its +`target/[test-]classes` directories. +`application.properties` files and service descriptors are concatenated using a Groovy script. + +=== Mock backend vs. real service + +Please refer to the README files in `integration-tests-aws2` for more details. diff --git a/integration-tests/aws2-sqs-sns/pom.xml b/integration-tests/aws2-grouped/pom.xml similarity index 51% rename from integration-tests/aws2-sqs-sns/pom.xml rename to integration-tests/aws2-grouped/pom.xml index 962ea6f..c97c364 100644 --- a/integration-tests/aws2-sqs-sns/pom.xml +++ b/integration-tests/aws2-grouped/pom.xml @@ -17,20 +17,17 @@ limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-integration-tests</artifactId> <version>1.7.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> </parent> + <modelVersion>4.0.0</modelVersion> - <artifactId>camel-quarkus-integration-test-aws2-sqs-sns</artifactId> - <name>Camel Quarkus :: Integration Tests :: AWS 2 SQS and SNS</name> - <description>Integration tests for SQS and SNS extensions</description> + <artifactId>camel-quarkus-integration-test-aws2-grouped</artifactId> + <name>Camel Quarkus :: Integration Tests :: AWS2 Grouped</name> + <description>AWS 2 tests from ../integration-tests-aws2 merged together</description> <dependencyManagement> <dependencies> @@ -47,7 +44,7 @@ <dependencies> <dependency> <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-main</artifactId> + <artifactId>camel-quarkus-aws2-s3</artifactId> </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> @@ -57,6 +54,7 @@ <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-sqs</artifactId> </dependency> + <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-resteasy</artifactId> @@ -65,6 +63,10 @@ <groupId>io.quarkus</groupId> <artifactId>quarkus-resteasy-jackson</artifactId> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-main</artifactId> + </dependency> <!-- test dependencies --> <dependency> @@ -91,6 +93,19 @@ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory --> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-aws2-s3-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>*</groupId> + <artifactId>*</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-sns-deployment</artifactId> <version>${project.version}</version> <type>pom</type> @@ -102,8 +117,6 @@ </exclusion> </exclusions> </dependency> - - <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory --> <dependency> <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws2-sqs-deployment</artifactId> @@ -130,8 +143,85 @@ </exclusion> </exclusions> </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>add-sources</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + <goal>add-resource</goal> + </goals> + <configuration> + <sources> + <source>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-s3/src/main/java</source> + <source>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-sqs-sns/src/main/java</source> + </sources> + <resources> + <resource> + <directory>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-s3/src/main/resources</directory> + </resource> + <resource> + <directory>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-sqs-sns/src/main/resources</directory> + </resource> + </resources> + </configuration> + </execution> + <execution> + <id>add-test-sources</id> + <phase>generate-sources</phase> + <goals> + <goal>add-test-source</goal> + <goal>add-test-resource</goal> + </goals> + <configuration> + <sources> + <source>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-s3/src/test/java</source> + <source>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-sqs-sns/src/test/java</source> + </sources> + <resources> + <resource> + <directory>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-s3/src/test/resources</directory> + </resource> + <resource> + <directory>${maven.multiModuleProjectDirectory}/integration-tests-aws2/aws2-sqs-sns/src/test/resources</directory> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.gmaven</groupId> + <artifactId>groovy-maven-plugin</artifactId> + <executions> + <execution> + <id>group-sources</id> + <goals> + <goal>execute</goal> + </goals> + <phase>generate-sources</phase> + <configuration> + <source>file:///${maven.multiModuleProjectDirectory}/tooling/scripts/group-tests.groovy</source> + <properties> + <group-tests.source.dir>${maven.multiModuleProjectDirectory}/integration-tests-aws2</group-tests.source.dir> + <group-tests.dest.module.dir>${project.basedir}</group-tests.dest.module.dir> + <group-tests.concat.rel.paths>src/main/resources/application.properties,src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer</group-tests.concat.rel.paths> + </properties> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <profiles> <profile> <id>native</id> diff --git a/integration-tests/aws2-sqs-sns/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer b/integration-tests/aws2-sqs-sns/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer deleted file mode 100644 index 544add9..0000000 --- a/integration-tests/aws2-sqs-sns/src/test/resources/META-INF/services/org.apache.camel.quarkus.test.support.aws2.Aws2TestEnvCustomizer +++ /dev/null @@ -1 +0,0 @@ -org.apache.camel.quarkus.component.aws2.sqs.it.Aws2SqsTestEnvCustomizer \ No newline at end of file diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index a936147..b2455af 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -68,8 +68,7 @@ <module>avro-rpc</module> <module>aws</module> <module>aws2</module> - <module>aws2-s3</module> - <module>aws2-sqs-sns</module> + <module>aws2-grouped</module> <module>azure</module> <module>azure-eventhubs</module> <module>azure-storage-blob</module> diff --git a/pom.xml b/pom.xml index 18d7f03..7148774 100644 --- a/pom.xml +++ b/pom.xml @@ -201,6 +201,7 @@ <module>catalog</module> <module>integration-tests-support</module> <module>integration-tests</module> + <module>integration-tests-aws2</module> <module>docs</module> </modules> @@ -783,6 +784,7 @@ <sortModulesPath>extensions/pom.xml</sortModulesPath> <sortModulesPath>extensions-jvm/pom.xml</sortModulesPath> <sortModulesPath>integration-tests/pom.xml</sortModulesPath> + <sortModulesPath>integration-tests-aws2/pom.xml</sortModulesPath> </sortModulesPaths> <sortDependencyManagementPaths> <sortDependencyManagementPath>poms/bom/pom.xml</sortDependencyManagementPath> @@ -793,6 +795,7 @@ <includes> <include>extensions-jvm/*/integration-test/pom.xml</include> <include>integration-tests/*/pom.xml</include> + <include>integration-tests-aws2/*/pom.xml</include> </includes> </updateVirtualDependency> </updateVirtualDependencies> @@ -827,9 +830,10 @@ </extensionDir> </extensionDirs> <removeEmptyApplicationProperties> - <directory>${basedir}/integration-tests</directory> + <directory>${basedir}</directory> <includes> - <include>*/src/main/resources/application.properties</include> + <include>integration-tests/*/src/main/resources/application.properties</include> + <include>integration-tests-aws2/*/src/main/resources/application.properties</include> </includes> </removeEmptyApplicationProperties> </configuration> diff --git a/tooling/scripts/group-tests.groovy b/tooling/scripts/group-tests.groovy new file mode 100644 index 0000000..5b71408 --- /dev/null +++ b/tooling/scripts/group-tests.groovy @@ -0,0 +1,50 @@ +/* + * 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. + */ + +/** + * Group tests in a directory to a single Maven module + */ +import java.nio.file.Path +import java.nio.file.Paths +import java.nio.file.Files +import java.util.stream.Stream +import java.util.stream.Collectors +import java.util.regex.Pattern +import java.util.regex.Matcher + + +final Path sourceDir = Paths.get(properties['group-tests.source.dir']) +final String[] concatRelPaths = properties['group-tests.concat.rel.paths'].split('[\\s,]+') +final Path destinationModuleDir = Paths.get(properties['group-tests.dest.module.dir']) + +final Map<String, StringBuilder> mergedFiles = new HashMap<>() +concatRelPaths.each {relPath -> mergedFiles.put(relPath, new StringBuilder())} + +Files.list(sourceDir) + .filter {p -> Files.exists(p.resolve('pom.xml'))} + .sorted() + .forEach {p -> + mergedFiles.each { relPath, sb -> sb.append(p.resolve(relPath).getText('UTF-8') + '\n') } + } + +mergedFiles.each { relPath, sb -> + String destRelPath = relPath.replace('src/main/resources/', 'target/classes/').replace('src/test/resources/', 'target/test-classes/') + Path destPath = destinationModuleDir.resolve(destRelPath) + Files.createDirectories(destPath.getParent()) + Files.write(destPath, sb.toString().getBytes('UTF-8')) +} + diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml index 26dcb9a..e11f229 100644 --- a/tooling/scripts/test-categories.yaml +++ b/tooling/scripts/test-categories.yaml @@ -166,8 +166,7 @@ platform: - rest - rest-openapi - csimple - - aws2-s3 - - aws2-sqs-sns + - aws2-grouped saas: - box - github