Skip to content

Commit

Permalink
apache#2967 reading clould container configuration files from classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
ffang committed Aug 24, 2021
1 parent 716df28 commit 1cd8217
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -112,17 +113,21 @@ private void createSslContainer() {
* 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
Expand Down

0 comments on commit 1cd8217

Please sign in to comment.