Search in sources :

Example 86 with Path

use of io.fabric8.annotations.Path in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method copyArchive.

@Test
public void copyArchive() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/containers/cid/archive?path=tp"), new URI(builder.copyArchive("cid", "tp")));
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 87 with Path

use of io.fabric8.annotations.Path in project docker-maven-plugin by fabric8io.

the class ComposeUtilsTest method resolveComposeFileWithRelativeComposeFileAndAbsoluteBaseDir.

@Test
public void resolveComposeFileWithRelativeComposeFileAndAbsoluteBaseDir() throws Exception {
    // relative/path/to/docker-compose.yaml
    String relComposeFile = join(SEP, "relative", "path", "to", "docker-compose.yaml");
    final String absMavenProjectDir = createTmpFile(className).getAbsolutePath();
    new Expectations() {

        {
            project.getBasedir();
            result = new File(absMavenProjectDir);
        }
    };
    assertEquals(new File(ABS_BASEDIR, relComposeFile), ComposeUtils.resolveComposeFileAbsolutely(ABS_BASEDIR, relComposeFile, project));
    new VerificationsInOrder() {

        {
            project.getBasedir();
        }
    };
}
Also used : Expectations(mockit.Expectations) PathTestUtil.createTmpFile(io.fabric8.maven.docker.util.PathTestUtil.createTmpFile) File(java.io.File) VerificationsInOrder(mockit.VerificationsInOrder) Test(org.junit.Test)

Example 88 with Path

use of io.fabric8.annotations.Path in project docker-maven-plugin by fabric8io.

the class ComposeUtilsTest method resolveComposesFileWithRelativeComposeFileParentDirectory.

@Test
public void resolveComposesFileWithRelativeComposeFileParentDirectory() throws Exception {
    // ../relative/path/to/docker-compose.yaml
    String relComposeFile = join(SEP, DOT + DOT, "relative", "path", "to", "docker-compose.yaml");
    File tmpDir = createTmpFile(ComposeUtilsTest.class.getName());
    String absBaseDir = tmpDir.getAbsolutePath();
    assertEquals(new File(tmpDir.getParentFile(), relComposeFile.substring(3)), ComposeUtils.resolveComposeFileAbsolutely(absBaseDir, relComposeFile, null));
}
Also used : PathTestUtil.createTmpFile(io.fabric8.maven.docker.util.PathTestUtil.createTmpFile) File(java.io.File) Test(org.junit.Test)

Example 89 with Path

use of io.fabric8.annotations.Path in project docker-maven-plugin by fabric8io.

the class ComposeUtilsTest method resolveComposeFileWithRelativeComposeFileAndRelativeBaseDir.

@Test
public void resolveComposeFileWithRelativeComposeFileAndRelativeBaseDir() throws Exception {
    // relative/path/to/docker-compose.yaml
    String relComposeFile = join(SEP, "relative", "path", "to", "docker-compose.yaml");
    String relBaseDir = "basedir" + SEP;
    final String absMavenProjectDir = createTmpFile(className).getAbsolutePath();
    new Expectations() {

        {
            project.getBasedir();
            result = new File(absMavenProjectDir);
        }
    };
    assertEquals(new File(new File(absMavenProjectDir, relBaseDir), relComposeFile), ComposeUtils.resolveComposeFileAbsolutely(relBaseDir, relComposeFile, project));
    new VerificationsInOrder() {

        {
            project.getBasedir();
        }
    };
}
Also used : Expectations(mockit.Expectations) PathTestUtil.createTmpFile(io.fabric8.maven.docker.util.PathTestUtil.createTmpFile) File(java.io.File) VerificationsInOrder(mockit.VerificationsInOrder) Test(org.junit.Test)

Example 90 with Path

use of io.fabric8.annotations.Path in project vertx-openshift-it by cescoffier.

the class HealthCheckIT method testLivenessIsPresent.

@Test
public void testLivenessIsPresent() throws Exception {
    final List<Container> containers = getContainers();
    ensureThat("the liveness probe is configured correctly", () -> {
        containers.forEach(c -> {
            final Probe livenessProbe = c.getLivenessProbe();
            assertThat(livenessProbe).as("Liveness probe should not be null.").isNotNull();
            softly.assertThat(livenessProbe.getHttpGet().getPort().getIntVal()).as("port should be defined for liveness probe").isEqualTo(8088);
            softly.assertThat(livenessProbe.getHttpGet().getPath()).as("path should be defined for liveness probe").isEqualTo("/isAlive");
        });
    });
}
Also used : Container(io.fabric8.kubernetes.api.model.Container) Probe(io.fabric8.kubernetes.api.model.Probe) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)45 File (java.io.File)41 IOException (java.io.IOException)34 ArrayList (java.util.ArrayList)18 PathTestUtil.createTmpFile (io.fabric8.maven.docker.util.PathTestUtil.createTmpFile)17 HashMap (java.util.HashMap)12 ResourceConfig (io.fabric8.maven.core.config.ResourceConfig)11 VolumeConfig (io.fabric8.maven.core.config.VolumeConfig)11 Path (java.nio.file.Path)11 FabricService (io.fabric8.api.FabricService)10 RuntimeProperties (io.fabric8.api.RuntimeProperties)9 Properties (java.util.Properties)9 BuildImageConfiguration (io.fabric8.maven.docker.config.BuildImageConfiguration)8 ImageConfiguration (io.fabric8.maven.docker.config.ImageConfiguration)8 InputStream (java.io.InputStream)8 Path (javax.ws.rs.Path)8 HttpProxyRule (io.fabric8.gateway.model.HttpProxyRule)7 NodeState (io.fabric8.groups.NodeState)7 URISyntaxException (java.net.URISyntaxException)7 List (java.util.List)6