當前位置: 首頁>>代碼示例>>Java>>正文


Java DockerComposeContainer類代碼示例

本文整理匯總了Java中org.testcontainers.containers.DockerComposeContainer的典型用法代碼示例。如果您正苦於以下問題:Java DockerComposeContainer類的具體用法?Java DockerComposeContainer怎麽用?Java DockerComposeContainer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DockerComposeContainer類屬於org.testcontainers.containers包,在下文中一共展示了DockerComposeContainer類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startPivioServerAndElasticsearchDockerContainers

import org.testcontainers.containers.DockerComposeContainer; //導入依賴的package包/類
private DockerComposeContainer startPivioServerAndElasticsearchDockerContainers() {
    DockerComposeContainer dockerEnvironment = new DockerComposeContainer(new File("docker-compose.yml"))
            .withLocalCompose(true)
            .withExposedService(ELASTICSEARCH_SERVICE_NAME, ELASTICSEARCH_SERVICE_PORT) // needed for cleaning up persistent data - see TestHelper.cleanUpPersistentData(..)
            .withTailChildContainers(true);
    dockerEnvironment.starting(DOES_NOT_MATTER);
    return dockerEnvironment;
}
 
開發者ID:pivio,項目名稱:pivio-server,代碼行數:9,代碼來源:DockerEnvironmentInitializer.java

示例2: simpleTest

import org.testcontainers.containers.DockerComposeContainer; //導入依賴的package包/類
@Test
public void simpleTest() {

    DockerComposeContainer environment = new DockerComposeContainer(new File("src/test/resources/invalid-compose.yml"))
                .withExposedService("something", 123);

    VisibleAssertions.assertThrows("starting with an invalid docker-compose file throws an exception",
            ContainerLaunchException.class,
            () -> {
                environment.starting(Description.createTestDescription(Object.class, "name"));
            });
}
 
開發者ID:testcontainers,項目名稱:testcontainers-java,代碼行數:13,代碼來源:DockerComposeErrorHandlingTest.java

示例3: initialize

import org.testcontainers.containers.DockerComposeContainer; //導入依賴的package包/類
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
    buildMainSourcesWhenRunningTestsWithoutGradle();
    DockerComposeContainer dockerEnvironment = startPivioServerAndElasticsearchDockerContainers();
    setSpringDataElasticsearchClusterNodesProperty(applicationContext, dockerEnvironment);
}
 
開發者ID:pivio,項目名稱:pivio-server,代碼行數:7,代碼來源:DockerEnvironmentInitializer.java

示例4: setSpringDataElasticsearchClusterNodesProperty

import org.testcontainers.containers.DockerComposeContainer; //導入依賴的package包/類
private void setSpringDataElasticsearchClusterNodesProperty(ConfigurableApplicationContext applicationContext, DockerComposeContainer dockerEnvironment) {
    Integer elasticsearchAmbassadorPort = dockerEnvironment.getServicePort(ELASTICSEARCH_SERVICE_NAME, ELASTICSEARCH_SERVICE_PORT);
    EnvironmentTestUtils.addEnvironment(applicationContext, "spring.data.elasticsearch.cluster-nodes=localhost:" + elasticsearchAmbassadorPort);
}
 
開發者ID:pivio,項目名稱:pivio-server,代碼行數:5,代碼來源:DockerEnvironmentInitializer.java

示例5: getEnvironment

import org.testcontainers.containers.DockerComposeContainer; //導入依賴的package包/類
@Override
protected DockerComposeContainer getEnvironment() {
    return environment;
}
 
開發者ID:testcontainers,項目名稱:testcontainers-java,代碼行數:5,代碼來源:DockerComposeContainerTest.java

示例6: getEnvironment

import org.testcontainers.containers.DockerComposeContainer; //導入依賴的package包/類
protected abstract DockerComposeContainer getEnvironment(); 
開發者ID:testcontainers,項目名稱:testcontainers-java,代碼行數:2,代碼來源:BaseDockerComposeTest.java


注:本文中的org.testcontainers.containers.DockerComposeContainer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。