This is an automated email from the ASF dual-hosted git repository.

ramu12 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new e2fb236  "CAMEL-13454:camel-testcontainers - Should build if no docker 
reverted back to mvn profile implementation"
e2fb236 is described below

commit e2fb236a3a2b4d026e27c0e65e1f6d1898c6cbee
Author: Kodanda Ramu Kakarla <kkaka...@kkakarla.pnq.csb>
AuthorDate: Thu Jul 25 21:43:57 2019 +0530

    "CAMEL-13454:camel-testcontainers - Should build if no docker reverted back 
to mvn profile implementation"
---
 components/camel-pulsar/pom.xml                    | 65 +++++++++++++++++
 components/camel-testcontainers-spring/pom.xml     | 83 ++++++++++++++++++++++
 .../spring/ContainerAwareSpringTestSupport.java    |  3 -
 components/camel-testcontainers/pom.xml            | 81 +++++++++++++++++++++
 .../testcontainers/ContainerAwareTestSupport.java  |  3 -
 5 files changed, 229 insertions(+), 6 deletions(-)

diff --git a/components/camel-pulsar/pom.xml b/components/camel-pulsar/pom.xml
index 41ace30..2e0820f 100644
--- a/components/camel-pulsar/pom.xml
+++ b/components/camel-pulsar/pom.xml
@@ -89,4 +89,69 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>pulsar-skip-tests</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skipTests>true</skipTests>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <!-- activate test if the docker socket file is accessible -->
+        <profile>
+            <id>pulsar-tests-docker-file</id>
+            <activation>
+                <file>
+                    <exists>/var/run/docker.sock</exists>
+                </file>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skipTests>${skipTests}</skipTests>
+                            <systemPropertyVariables>
+                                
<visibleassertions.silence>true</visibleassertions.silence>
+                            </systemPropertyVariables>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <!-- activate test if the DOCKER_HOST env var is set -->
+        <profile>
+            <id>pulsar-tests-docker-env</id>
+            <activation>
+                <property>
+                    <name>env.DOCKER_HOST</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skipTests>${skipTests}</skipTests>
+                            <systemPropertyVariables>
+                                
<visibleassertions.silence>true</visibleassertions.silence>
+                            </systemPropertyVariables>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git a/components/camel-testcontainers-spring/pom.xml 
b/components/camel-testcontainers-spring/pom.xml
index c2f66c1..d9b7072 100644
--- a/components/camel-testcontainers-spring/pom.xml
+++ b/components/camel-testcontainers-spring/pom.xml
@@ -72,4 +72,87 @@
         </dependency>
 
     </dependencies>
+
+    <profiles>
+        <profile>
+            <id>testcontainers-spring-skip-tests</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skipTests>true</skipTests>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <!-- activate integration test if the docker socket file is accessible 
-->
+        <profile>
+            <id>testcontainers-spring-integration-tests-docker-file</id>
+            <activation>
+                <file>
+                    <exists>/var/run/docker.sock</exists>
+                </file>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <configuration>
+                            <skipTests>${skipTests}</skipTests>
+                            <systemPropertyVariables>
+                                
<visibleassertions.silence>true</visibleassertions.silence>
+                            </systemPropertyVariables>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <!-- activate integration test if the DOCKER_HOST env var is set -->
+        <profile>
+            <id>testcontainers-spring-integration-tests-docker-env</id>
+            <activation>
+                <property>
+                    <name>env.DOCKER_HOST</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <configuration>
+                            <skipTests>${skipTests}</skipTests>
+                            <systemPropertyVariables>
+                                
<visibleassertions.silence>true</visibleassertions.silence>
+                            </systemPropertyVariables>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+    </profiles>
 </project>
diff --git 
a/components/camel-testcontainers-spring/src/main/java/org/apache/camel/test/testcontainers/spring/ContainerAwareSpringTestSupport.java
 
b/components/camel-testcontainers-spring/src/main/java/org/apache/camel/test/testcontainers/spring/ContainerAwareSpringTestSupport.java
index 71cc760..8522801 100644
--- 
a/components/camel-testcontainers-spring/src/main/java/org/apache/camel/test/testcontainers/spring/ContainerAwareSpringTestSupport.java
+++ 
b/components/camel-testcontainers-spring/src/main/java/org/apache/camel/test/testcontainers/spring/ContainerAwareSpringTestSupport.java
@@ -26,10 +26,8 @@ import 
org.apache.camel.component.properties.PropertiesComponent;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.apache.camel.test.testcontainers.ContainerPropertiesFunction;
 import org.apache.camel.test.testcontainers.Containers;
-import org.junit.Assume;
 import org.testcontainers.containers.GenericContainer;
 import org.testcontainers.containers.Network;
-import org.testcontainers.utility.DockerMachineClient;
 
 public abstract class ContainerAwareSpringTestSupport extends 
CamelSpringTestSupport {
     private List<GenericContainer<?>> containers = new 
CopyOnWriteArrayList<>();
@@ -40,7 +38,6 @@ public abstract class ContainerAwareSpringTestSupport extends 
CamelSpringTestSup
 
     @Override
     protected void setupResources() throws Exception {
-        Assume.assumeTrue("Skipping test because docker not installed", 
DockerMachineClient.instance().isInstalled());
         super.setupResources();
 
         containers.clear();
diff --git a/components/camel-testcontainers/pom.xml 
b/components/camel-testcontainers/pom.xml
index 0c1d933..c882cf5 100644
--- a/components/camel-testcontainers/pom.xml
+++ b/components/camel-testcontainers/pom.xml
@@ -75,4 +75,85 @@
 
     </dependencies>
 
+    <profiles>
+          <profile>
+            <id>testcontainers-skip-tests</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <skipTests>true</skipTests>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <!-- activate integration test if the docker socket file is accessible 
-->
+        <profile>
+            <id>testcontainers-integration-tests-docker-file</id>
+            <activation>
+                <file>
+                    <exists>/var/run/docker.sock</exists>
+                </file>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <configuration>
+                            <skipTests>${skipTests}</skipTests>
+                            <systemPropertyVariables>
+                                
<visibleassertions.silence>true</visibleassertions.silence>
+                            </systemPropertyVariables>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <!-- activate integration test if the DOCKER_HOST env var is set -->
+        <profile>
+            <id>testcontainers-integration-tests-docker-env</id>
+            <activation>
+                <property>
+                    <name>env.DOCKER_HOST</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <configuration>
+                            <skipTests>${skipTests}</skipTests>
+                            <systemPropertyVariables>
+                                
<visibleassertions.silence>true</visibleassertions.silence>
+                            </systemPropertyVariables>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git 
a/components/camel-testcontainers/src/main/java/org/apache/camel/test/testcontainers/ContainerAwareTestSupport.java
 
b/components/camel-testcontainers/src/main/java/org/apache/camel/test/testcontainers/ContainerAwareTestSupport.java
index 9f697ef..a2199f1 100644
--- 
a/components/camel-testcontainers/src/main/java/org/apache/camel/test/testcontainers/ContainerAwareTestSupport.java
+++ 
b/components/camel-testcontainers/src/main/java/org/apache/camel/test/testcontainers/ContainerAwareTestSupport.java
@@ -24,10 +24,8 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.properties.PropertiesComponent;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Assume;
 import org.testcontainers.containers.GenericContainer;
 import org.testcontainers.containers.Network;
-import org.testcontainers.utility.DockerMachineClient;
 
 public class ContainerAwareTestSupport extends CamelTestSupport {
     private List<GenericContainer<?>> containers = new 
CopyOnWriteArrayList<>();
@@ -38,7 +36,6 @@ public class ContainerAwareTestSupport extends 
CamelTestSupport {
 
     @Override
     protected void setupResources() throws Exception {
-        Assume.assumeTrue("Skipping test because docker not installed", 
DockerMachineClient.instance().isInstalled());
         super.setupResources();
 
         containers.clear();

Reply via email to