Search in sources :

Example 1 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class DockerAccessWithHcClient method getLogAsync.

@Override
public LogGetHandle getLogAsync(String containerId, LogCallback callback) {
    LogRequestor extractor = new LogRequestor(delegate.createBasicClient(), urlBuilder, containerId, callback);
    extractor.start();
    return extractor;
}
Also used : LogRequestor(io.fabric8.maven.docker.access.log.LogRequestor)

Example 2 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method listContainers.

@Test
public void listContainers() throws MalformedURLException, UnsupportedEncodingException, URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/containers/json"), new URI(builder.listContainers()));
    assertEquals(new URI("/1.0/containers/json?filters=" + URLEncoder.encode("{\"ancestor\":[\"nginx\"]}", "UTF8")), new URI(builder.listContainers("ancestor", "nginx")));
    try {
        builder.listContainers("ancestor");
        fail();
    } catch (IllegalArgumentException exp) {
        assertTrue(exp.getMessage().contains("pair"));
    }
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 3 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method deleteImage.

@Test
public void deleteImage() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/images/n1?force=0"), new URI(builder.deleteImage("n1", false)));
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 4 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method loadImage.

@Test
public void loadImage() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/images/load"), new URI(builder.loadImage()));
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 5 with UrlBuilder

use of io.fabric8.maven.docker.access.UrlBuilder in project docker-maven-plugin by fabric8io.

the class UrlBuilderTest method getImage.

@Test
public void getImage() throws URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/images/n1%3Alatest/get"), new URI(builder.getImage(new ImageName("n1:latest"))));
}
Also used : ImageName(io.fabric8.maven.docker.util.ImageName) UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Aggregations

UrlBuilder (io.fabric8.maven.docker.access.UrlBuilder)9 Test (org.junit.Test)9 ImageName (io.fabric8.maven.docker.util.ImageName)3 LogRequestor (io.fabric8.maven.docker.access.log.LogRequestor)2 BuildOptions (io.fabric8.maven.docker.access.BuildOptions)1 HashMap (java.util.HashMap)1