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 67e26367c2f835df6849490304cfc552e5b3894e
Author: Peter Palaga <ppal...@redhat.com>
AuthorDate: Wed Feb 10 18:15:20 2021 +0100

    Autogenerate the dependencies in the aws2-grouped test
---
 integration-tests/aws2-grouped/README.adoc |  7 +++--
 integration-tests/aws2-grouped/pom.xml     | 44 ++++++++----------------------
 integration-tests/cassandraql/pom.xml      | 15 ----------
 pom.xml                                    | 13 ++++++++-
 tooling/scripts/group-tests.groovy         | 16 +++++++++++
 5 files changed, 43 insertions(+), 52 deletions(-)

diff --git a/integration-tests/aws2-grouped/README.adoc 
b/integration-tests/aws2-grouped/README.adoc
index 6c00519..0bb87fa 100644
--- a/integration-tests/aws2-grouped/README.adoc
+++ b/integration-tests/aws2-grouped/README.adoc
@@ -10,9 +10,10 @@ 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.
+* 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.
+* The dependencies in the grouped `pom.xml` can be updated via `mvn 
process-resources -Pformat -N`.
 
 === Mock backend vs. real service
 
diff --git a/integration-tests/aws2-grouped/pom.xml 
b/integration-tests/aws2-grouped/pom.xml
index c97c364..74fe8a6 100644
--- a/integration-tests/aws2-grouped/pom.xml
+++ b/integration-tests/aws2-grouped/pom.xml
@@ -41,8 +41,17 @@
         </dependencies>
     </dependencyManagement>
 
+    <!-- Regenerate the dependencies via `mvn process-resources -Pformat -N` 
from the source tree root directory -->
     <dependencies>
         <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy-jackson</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-aws2-s3</artifactId>
         </dependency>
@@ -54,21 +63,10 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-aws2-sqs</artifactId>
         </dependency>
-
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy</artifactId>
-        </dependency>
-        <dependency>
-            <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>
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-junit5</artifactId>
@@ -157,21 +155,11 @@
                         <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>
+                                
<source>${basedir}/target/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>
@@ -179,21 +167,11 @@
                         <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>
+                                
<source>${basedir}/target/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>
diff --git a/integration-tests/cassandraql/pom.xml 
b/integration-tests/cassandraql/pom.xml
index 0f56448..824d537 100644
--- a/integration-tests/cassandraql/pom.xml
+++ b/integration-tests/cassandraql/pom.xml
@@ -89,21 +89,6 @@
             <artifactId>cassandra</artifactId>
             <scope>test</scope>
         </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-cassandraql-deployment</artifactId>
-            <version>${project.version}</version>
-            <type>pom</type>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>*</groupId>
-                    <artifactId>*</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
     </dependencies>
 
     <profiles>
diff --git a/pom.xml b/pom.xml
index 9ef7d3db..708f601 100644
--- a/pom.xml
+++ b/pom.xml
@@ -145,7 +145,7 @@
         <zt-exec.version>1.11</zt-exec.version>
 
         <!-- Maven plugin versions (keep sorted alphabetically) -->
-        <cq-plugin.version>0.28.0</cq-plugin.version>
+        <cq-plugin.version>0.29.0</cq-plugin.version>
         
<build-helper-maven-plugin.version>3.1.0</build-helper-maven-plugin.version>
         <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
         <formatter-maven-plugin.version>2.11.0</formatter-maven-plugin.version>
@@ -836,6 +836,17 @@
                                             
<include>integration-tests-aws2/*/src/main/resources/application.properties</include>
                                         </includes>
                                     </removeEmptyApplicationProperties>
+                                    <mergePoms>
+                                        <mergePom>
+                                            <sourcePoms>
+                                                
<directory>${basedir}/integration-tests-aws2</directory>
+                                                <includes>
+                                                    
<include>*/pom.xml</include>
+                                                </includes>
+                                            </sourcePoms>
+                                            
<destinationPom>${basedir}/integration-tests/aws2-grouped/pom.xml</destinationPom>
+                                        </mergePom>
+                                    </mergePoms>
                                 </configuration>
                             </execution>
                         </executions>
diff --git a/tooling/scripts/group-tests.groovy 
b/tooling/scripts/group-tests.groovy
index 5b71408..6e1a654 100644
--- a/tooling/scripts/group-tests.groovy
+++ b/tooling/scripts/group-tests.groovy
@@ -25,7 +25,11 @@ import java.util.stream.Stream
 import java.util.stream.Collectors
 import java.util.regex.Pattern
 import java.util.regex.Matcher
+import groovy.ant.AntBuilder
 
+/* Copies source files from multiple source test modules (subdirs of 
`group-tests.source.dir`) into
+ * one destination module (`group-tests.dest.module.dir`) so that the tests 
can be executed all at once
+ */
 
 final Path sourceDir = Paths.get(properties['group-tests.source.dir'])
 final String[] concatRelPaths = 
properties['group-tests.concat.rel.paths'].split('[\\s,]+')
@@ -39,6 +43,18 @@ Files.list(sourceDir)
     .sorted()
     .forEach {p ->
         mergedFiles.each { relPath, sb -> 
sb.append(p.resolve(relPath).getText('UTF-8') + '\n') }
+        new AntBuilder().copy(todir: 
destinationModuleDir.resolve('target/src/main/java')) {
+            fileset(dir: p.resolve('src/main/java'), includes: "**")
+        }
+        new AntBuilder().copy(todir: 
destinationModuleDir.resolve('target/src/test/java')) {
+            fileset(dir: p.resolve('src/test/java'), includes: "**")
+        }
+        new AntBuilder().copy(todir: 
destinationModuleDir.resolve('target/classes')) {
+            fileset(dir: p.resolve('src/main/resources'), includes: "**")
+        }
+        new AntBuilder().copy(todir: 
destinationModuleDir.resolve('target/test-classes')) {
+            fileset(dir: p.resolve('src/test/resources'), includes: "**")
+        }
     }
 
 mergedFiles.each { relPath, sb ->

Reply via email to