You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2021/08/26 21:32:52 UTC

[camel-quarkus] 02/02: #2967 reading clould container configuration files from classpath

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

ppalaga pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 10d1cd59b05e6250d9f8252471088ec70851e3c9
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Tue Aug 24 09:47:26 2021 -0400

    #2967 reading clould container configuration files from classpath
---
 .../quarkus/component/solr/it/SolrTestResource.java   | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTestResource.java b/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTestResource.java
index 58123c9..2891aa1 100644
--- a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTestResource.java
+++ b/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTestResource.java
@@ -17,6 +17,7 @@
 package org.apache.camel.quarkus.component.solr.it;
 
 import java.io.File;
+import java.net.URI;
 import java.util.Map;
 
 import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
@@ -112,17 +113,21 @@ public class SolrTestResource implements QuarkusTestResourceLifecycleManager {
      * creates a cloud container with zookeeper
      */
     private void createCloudContainer() {
-        if (SystemUtils.IS_OS_LINUX) {
-            cloudContainer = new DockerComposeContainer(new File("src/test/resources/cloud-docker-compose.yml"))
-                    .withExposedService("solr1", SOLR_PORT)
-                    .withExposedService("zoo1", ZOOKEEPER_PORT)
-                    .waitingFor("create-collection", Wait.forLogMessage(".*Created collection 'collection1'.*", 1));
-        } else {
-            cloudContainer = new DockerComposeContainer(new File("src/test/resources/cloud-docker-compose_nonlinux.yml"))
+        URI uri = null;
+        try {
+            if (SystemUtils.IS_OS_LINUX) {
+                uri = this.getClass().getClassLoader().getResource("cloud-docker-compose.yml").toURI();
+            } else {
+                uri = this.getClass().getClassLoader().getResource("cloud-docker-compose_nonlinux.yml").toURI();
+            }
+            cloudContainer = new DockerComposeContainer(new File(uri))
                     .withExposedService("solr1", SOLR_PORT)
                     .withExposedService("zoo1", ZOOKEEPER_PORT)
                     .waitingFor("create-collection", Wait.forLogMessage(".*Created collection 'collection1'.*", 1));
+        } catch (Exception e) {
+            LOGGER.warn("can't create Cloud Container", e);
         }
+
     }
 
     @Override