Search in sources :

Example 51 with Builder

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

the class ContainerNamingUtilTest method imageConfiguration.

private ImageConfiguration imageConfiguration(String name, String alias, String containerNamePattern) {
    ImageConfiguration.Builder builder = new ImageConfiguration.Builder().name(name).alias(alias);
    if (containerNamePattern != null) {
        RunImageConfiguration runConfig = new RunImageConfiguration.Builder().containerNamePattern(containerNamePattern).build();
        builder.runConfig(runConfig);
    }
    return builder.build();
}
Also used : ImageConfiguration(io.fabric8.maven.docker.config.ImageConfiguration) RunImageConfiguration(io.fabric8.maven.docker.config.RunImageConfiguration) RunImageConfiguration(io.fabric8.maven.docker.config.RunImageConfiguration)

Example 52 with Builder

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

the class BaseMojoTest method singleImageWithCopyNamePatternAndCopyEntries.

protected ImageConfiguration singleImageWithCopyNamePatternAndCopyEntries(String copyNamePattern, List<CopyConfiguration.Entry> entries) {
    final CopyConfiguration.Builder copyConfigBuilder = new CopyConfiguration.Builder();
    if (entries != null) {
        copyConfigBuilder.entries(entries);
    }
    final Builder builder = new Builder().name("example:latest");
    if (copyNamePattern != null) {
        builder.copyNamePattern(copyNamePattern);
    }
    return builder.copyConfig(copyConfigBuilder.build()).build();
}
Also used : Builder(io.fabric8.maven.docker.config.ImageConfiguration.Builder) CopyConfiguration(io.fabric8.maven.docker.config.CopyConfiguration)

Example 53 with Builder

use of io.fabric8.maven.docker.config.CopyConfiguration.Builder 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?all=0"), new URI(builder.listContainers(false)));
    assertEquals(new URI("/1.0/containers/json?all=1&filters=" + URLEncoder.encode("{\"ancestor\":[\"nginx\"]}", "UTF8")), new URI(builder.listContainers(true, "ancestor", "nginx")));
    try {
        builder.listContainers(false, "ancestor");
        fail();
    } catch (IllegalArgumentException exp) {
        assertTrue(exp.getMessage().contains("pair"));
    }
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 54 with Builder

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

the class UrlBuilderTest method listImages.

@Test
public void listImages() throws MalformedURLException, UnsupportedEncodingException, URISyntaxException {
    UrlBuilder builder = new UrlBuilder("", "1.0");
    assertEquals(new URI("/1.0/images/json?all=0"), new URI(builder.listImages(false)));
    assertEquals(new URI("/1.0/images/json?all=1"), new URI(builder.listImages(true)));
}
Also used : UrlBuilder(io.fabric8.maven.docker.access.UrlBuilder) Test(org.junit.Test)

Example 55 with Builder

use of io.fabric8.maven.docker.config.CopyConfiguration.Builder 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

Test (org.junit.Test)60 ProfileBuilder (io.fabric8.api.ProfileBuilder)34 Profile (io.fabric8.api.Profile)33 KubernetesListBuilder (io.fabric8.kubernetes.api.model.KubernetesListBuilder)27 FabricService (io.fabric8.api.FabricService)24 InputStream (java.io.InputStream)21 Deployment (org.jboss.arquillian.container.test.api.Deployment)21 OSGiManifestBuilder (org.jboss.osgi.metadata.OSGiManifestBuilder)21 Asset (org.jboss.shrinkwrap.api.asset.Asset)21 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)21 ServiceTracker (org.osgi.util.tracker.ServiceTracker)20 HashMap (java.util.HashMap)19 Map (java.util.Map)19 Logger (org.slf4j.Logger)19 CommandSupport (io.fabric8.itests.support.CommandSupport)18 ConfigurationAdmin (org.osgi.service.cm.ConfigurationAdmin)17 ServiceLocator (io.fabric8.api.gravia.ServiceLocator)16 IOException (java.io.IOException)16 Action (org.apache.felix.gogo.commands.Action)16 AbstractCommand (org.apache.felix.gogo.commands.basic.AbstractCommand)16