当前位置: 首页>>代码示例>>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;未经允许,请勿转载。