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:50 UTC

[camel-quarkus] branch main updated (5beab29 -> 10d1cd5)

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

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


    from 5beab29  Fix Splunk container exposed ports configuration
     new 5cf6095  fix SolrTest failure when using CloundContainer #2967
     new 10d1cd5  #2967 reading clould container configuration files from classpath

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../quarkus/component/solr/it/SolrTestResource.java | 21 +++++++++++++++++----
 ...ompose.yml => cloud-docker-compose_nonlinux.yml} |  4 ++++
 2 files changed, 21 insertions(+), 4 deletions(-)
 copy integration-tests/solr/src/test/resources/{cloud-docker-compose.yml => cloud-docker-compose_nonlinux.yml} (95%)

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

Posted by pp...@apache.org.
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

[camel-quarkus] 01/02: fix SolrTest failure when using CloundContainer #2967

Posted by pp...@apache.org.
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 5cf60953c6c8df1b9ca83cddd5bf3fbd95652396
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Fri Aug 20 14:13:36 2021 -0400

    fix SolrTest failure when using CloundContainer #2967
---
 .../component/solr/it/SolrTestResource.java        | 16 ++++--
 .../resources/cloud-docker-compose_nonlinux.yml    | 58 ++++++++++++++++++++++
 2 files changed, 70 insertions(+), 4 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 e7e6ee1..58123c9 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
@@ -21,6 +21,7 @@ import java.util.Map;
 
 import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
 import org.apache.camel.util.CollectionHelper;
+import org.apache.commons.lang3.SystemUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testcontainers.containers.BindMode;
@@ -111,10 +112,17 @@ public class SolrTestResource implements QuarkusTestResourceLifecycleManager {
      * creates a cloud container with zookeeper
      */
     private void createCloudContainer() {
-        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));
+        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"))
+                    .withExposedService("solr1", SOLR_PORT)
+                    .withExposedService("zoo1", ZOOKEEPER_PORT)
+                    .waitingFor("create-collection", Wait.forLogMessage(".*Created collection 'collection1'.*", 1));
+        }
     }
 
     @Override
diff --git a/integration-tests/solr/src/test/resources/cloud-docker-compose_nonlinux.yml b/integration-tests/solr/src/test/resources/cloud-docker-compose_nonlinux.yml
new file mode 100644
index 0000000..7fa239a
--- /dev/null
+++ b/integration-tests/solr/src/test/resources/cloud-docker-compose_nonlinux.yml
@@ -0,0 +1,58 @@
+#
+# 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.
+#
+
+# based on https://raw.githubusercontent.com/docker-solr/docker-solr-examples/master/docker-compose/docker-compose.yml
+version: '3.7'
+services:
+  solr1:
+    image: solr:8.7.0
+    ports:
+     - "8983:8983"
+    environment:
+      - ZK_HOST=zoo1:2181
+      - SOLR_PORT=8983
+      - SOLR_HOST=localhost
+    networks:
+      - solr
+    depends_on:
+      - zoo1
+
+  zoo1:
+    image: zookeeper:3.6.2
+    restart: always
+    hostname: zoo1
+    environment:
+      ZOO_MY_ID: 1
+      ZOO_SERVERS: server.1=zoo1:2888:3888;2181
+    networks:
+      - solr
+      
+  create-collection:
+    image: solr:8.7.0
+    environment:
+      - SOLR_HOST=solr1
+    networks:
+      - solr
+    command:
+      - bash
+      - "-e"
+      - "-x"
+      - "-c"
+      - "wait-for-solr.sh --max-attempts 10 --wait-seconds 5 --solr-url http://$$SOLR_HOST:8983/; solr create_collection -c collection1 -p 8983"
+
+networks:
+  solr: