Search in sources :

Example 1 with RestartPolicy

use of io.fabric8.maven.docker.config.RestartPolicy in project docker-maven-plugin by fabric8io.

the class AbstractConfigHandlerTest method validateRunConfiguration.

protected void validateRunConfiguration(RunImageConfiguration runConfig) {
    assertEquals(a("/foo", "/tmp:/tmp"), runConfig.getVolumeConfiguration().getBind());
    assertEquals(a("CAP"), runConfig.getCapAdd());
    assertEquals(a("CAP"), runConfig.getCapDrop());
    assertEquals("command.sh", runConfig.getCmd().getShell());
    assertEquals(a("8.8.8.8"), runConfig.getDns());
    assertEquals(a("example.com"), runConfig.getDnsSearch());
    assertEquals("domain.com", runConfig.getDomainname());
    assertEquals("entrypoint.sh", runConfig.getEntrypoint().getShell());
    assertEquals(a("localhost:127.0.0.1"), runConfig.getExtraHosts());
    assertEquals("subdomain", runConfig.getHostname());
    assertEquals(a("redis"), runConfig.getLinks());
    assertEquals((Long) 1L, runConfig.getMemory());
    assertEquals((Long) 1L, runConfig.getMemorySwap());
    assertEquals(getRunNamingStrategy(), runConfig.getNamingStrategy());
    assertEquals(getEnvPropertyFile(), runConfig.getEnvPropertyFile());
    assertEquals("/tmp/props.txt", runConfig.getPortPropertyFile());
    assertEquals(a("8081:8080"), runConfig.getPorts());
    assertEquals(true, runConfig.getPrivileged());
    assertEquals("tomcat", runConfig.getUser());
    assertEquals(a("from"), runConfig.getVolumeConfiguration().getFrom());
    assertEquals("foo", runConfig.getWorkingDir());
    validateEnv(runConfig.getEnv());
    // not sure it's worth it to implement 'equals/hashcode' for these
    RestartPolicy policy = runConfig.getRestartPolicy();
    assertEquals("on-failure", policy.getName());
    assertEquals(1, policy.getRetry());
}
Also used : RestartPolicy(io.fabric8.maven.docker.config.RestartPolicy)

Example 2 with RestartPolicy

use of io.fabric8.maven.docker.config.RestartPolicy in project docker-maven-plugin by fabric8io.

the class DockerComposeConfigHandlerTest method validateRunConfiguration.

void validateRunConfiguration(RunImageConfiguration runConfig) {
    validateVolumeConfig(runConfig.getVolumeConfiguration());
    assertEquals(a("CAP"), runConfig.getCapAdd());
    assertEquals(a("CAP"), runConfig.getCapDrop());
    assertEquals("command.sh", runConfig.getCmd().getShell());
    assertEquals(a("8.8.8.8"), runConfig.getDns());
    assertEquals(a("example.com"), runConfig.getDnsSearch());
    assertEquals("domain.com", runConfig.getDomainname());
    assertEquals("entrypoint.sh", runConfig.getEntrypoint().getShell());
    assertEquals(a("localhost:127.0.0.1"), runConfig.getExtraHosts());
    assertEquals("subdomain", runConfig.getHostname());
    assertEquals(a("redis", "link1"), runConfig.getLinks());
    assertEquals((Long) 1L, runConfig.getMemory());
    assertEquals((Long) 1L, runConfig.getMemorySwap());
    assertEquals(RunImageConfiguration.NamingStrategy.none, runConfig.getNamingStrategy());
    assertEquals(null, runConfig.getEnvPropertyFile());
    assertEquals(null, runConfig.getPortPropertyFile());
    assertEquals(a("8081:8080"), runConfig.getPorts());
    assertEquals(true, runConfig.getPrivileged());
    assertEquals("tomcat", runConfig.getUser());
    assertEquals(a("from"), runConfig.getVolumeConfiguration().getFrom());
    assertEquals("foo", runConfig.getWorkingDir());
    validateEnv(runConfig.getEnv());
    // not sure it's worth it to implement 'equals/hashcode' for these
    RestartPolicy policy = runConfig.getRestartPolicy();
    assertEquals("on-failure", policy.getName());
    assertEquals(1, policy.getRetry());
}
Also used : RestartPolicy(io.fabric8.maven.docker.config.RestartPolicy)

Aggregations

RestartPolicy (io.fabric8.maven.docker.config.RestartPolicy)2