Search in sources :

Example 21 with DockerImageURI

use of com.openshift.restclient.images.DockerImageURI in project jbosstools-openshift by jbosstools.

the class DockerImage2OpenshiftResourceConverterTest method testTrailingUnderscore.

@Test
public void testTrailingUnderscore() {
    String resourceName = converter.convert(new DockerImageURI("image_"));
    assertEquals("image", resourceName);
}
Also used : DockerImageURI(com.openshift.restclient.images.DockerImageURI) Test(org.junit.Test)

Example 22 with DockerImageURI

use of com.openshift.restclient.images.DockerImageURI in project jbosstools-openshift by jbosstools.

the class DockerImage2OpenshiftResourceConverterTest method testLeadingUnderscore.

@Test
public void testLeadingUnderscore() {
    String resourceName = converter.convert(new DockerImageURI("_image"));
    assertEquals("image", resourceName);
}
Also used : DockerImageURI(com.openshift.restclient.images.DockerImageURI) Test(org.junit.Test)

Example 23 with DockerImageURI

use of com.openshift.restclient.images.DockerImageURI in project jbosstools-openshift by jbosstools.

the class ServerSettingsWizardPageModelTest method testGetEapOpenshiftProfile.

@Test
public void testGetEapOpenshiftProfile() {
    DockerImageURI image = mock(DockerImageURI.class);
    when(image.getName()).thenReturn("super-puper-eap-name");
    ISourceBuildStrategy buildStrategy = mock(ISourceBuildStrategy.class);
    when(buildStrategy.getImage()).thenReturn(image);
    IBuildConfig buildConfig = (IBuildConfig) connection.getResources(ResourceKind.BUILD_CONFIG, ResourceMocks.PROJECT2.getName()).get(1);
    when(buildConfig.getBuildStrategy()).thenReturn(buildStrategy);
    assertEquals("openshift3.eap", this.model.getProfileId());
}
Also used : ISourceBuildStrategy(com.openshift.restclient.model.build.ISourceBuildStrategy) DockerImageURI(com.openshift.restclient.images.DockerImageURI) IBuildConfig(com.openshift.restclient.model.IBuildConfig) Test(org.junit.Test)

Example 24 with DockerImageURI

use of com.openshift.restclient.images.DockerImageURI in project jbosstools-openshift by jbosstools.

the class ResourceUtilsTest method testImageRefForBuild.

@Test
public void testImageRefForBuild() {
    assertEquals("", imageRef((IBuild) null));
    when(build.getOutputKind()).thenReturn("something");
    assertEquals("", imageRef(build));
    DockerImageURI uri = new DockerImageURI(IMAGE_REF);
    when(build.getOutputTo()).thenReturn(uri);
    when(build.getOutputKind()).thenReturn(ResourceKind.IMAGE_STREAM_TAG);
    assertEquals(IMAGE_REF, imageRef(build));
    when(build.getOutputKind()).thenReturn(ResourceUtils.IMAGE_STREAM_IMAGE_KIND);
    assertEquals(IMAGE_REF, imageRef(build));
    when(build.getOutputKind()).thenReturn(ResourceUtils.DOCKER_IMAGE_KIND);
    assertEquals(IMAGE_REF, imageRef(build));
}
Also used : DockerImageURI(com.openshift.restclient.images.DockerImageURI) IBuild(com.openshift.restclient.model.IBuild) Test(org.junit.Test)

Example 25 with DockerImageURI

use of com.openshift.restclient.images.DockerImageURI in project jbosstools-openshift by jbosstools.

the class BuildConfigPropertySourceTest method givenDockerbuBuildStrategy.

private IDockerBuildStrategy givenDockerbuBuildStrategy() {
    IDockerBuildStrategy strategy = mock(IDockerBuildStrategy.class);
    when(strategy.getBaseImage()).thenReturn(new DockerImageURI("foobar"));
    when(strategy.getType()).thenReturn(BuildStrategyType.DOCKER);
    when(strategy.getContextDir()).thenReturn("thepathway");
    when(resource.getBuildStrategy()).thenReturn(strategy);
    return strategy;
}
Also used : DockerImageURI(com.openshift.restclient.images.DockerImageURI) IDockerBuildStrategy(com.openshift.restclient.model.build.IDockerBuildStrategy)

Aggregations

DockerImageURI (com.openshift.restclient.images.DockerImageURI)39 Test (org.junit.Test)23 IDeploymentImageChangeTrigger (com.openshift.restclient.model.deploy.IDeploymentImageChangeTrigger)9 IDeploymentConfig (com.openshift.restclient.model.IDeploymentConfig)6 IImageStream (com.openshift.restclient.model.IImageStream)5 ISourceBuildStrategy (com.openshift.restclient.model.build.ISourceBuildStrategy)5 IImageStreamImportCapability (com.openshift.restclient.capability.resources.IImageStreamImportCapability)4 IResource (com.openshift.restclient.model.IResource)4 IImageStreamImport (com.openshift.restclient.model.image.IImageStreamImport)4 HashMap (java.util.HashMap)4 IResourceFactory (com.openshift.restclient.IResourceFactory)3 IBuildConfig (com.openshift.restclient.model.IBuildConfig)3 IProject (com.openshift.restclient.model.IProject)3 IStatus (com.openshift.restclient.model.IStatus)3 ICustomBuildStrategy (com.openshift.restclient.model.build.ICustomBuildStrategy)3 IDockerBuildStrategy (com.openshift.restclient.model.build.IDockerBuildStrategy)3 Collection (java.util.Collection)3 EnvironmentVariable (org.jboss.tools.openshift.internal.ui.wizard.common.EnvironmentVariable)3 ResourceKind (com.openshift.restclient.ResourceKind)2 IBuildStrategy (com.openshift.restclient.model.build.IBuildStrategy)2