Search in sources :

Example 41 with IDockerImage

use of org.eclipse.linuxtools.docker.core.IDockerImage in project jbosstools-openshift by jbosstools.

the class DeployImageWizardModelTest method resourceNameIsReturnedWhenSettingADockerImage.

@Test
public void resourceNameIsReturnedWhenSettingADockerImage() {
    IDockerImage image = mock(IDockerImage.class);
    when(image.repoTags()).thenReturn(Collections.singletonList("image:latest"));
    when(dockerConnection.getImages()).thenReturn(Collections.singletonList(image));
    model.setDockerConnection(dockerConnection);
    model.setImageName("image:latest");
    assertThat(model.getResourceName()).isEqualTo("image");
}
Also used : IDockerImage(org.eclipse.linuxtools.docker.core.IDockerImage) Test(org.junit.Test)

Aggregations

IDockerImage (org.eclipse.linuxtools.docker.core.IDockerImage)41 IDockerConnection (org.eclipse.linuxtools.docker.core.IDockerConnection)16 DockerException (org.eclipse.linuxtools.docker.core.DockerException)10 ArrayList (java.util.ArrayList)9 Test (org.junit.Test)8 IDockerImageHierarchyNode (org.eclipse.linuxtools.docker.core.IDockerImageHierarchyNode)7 List (java.util.List)6 CoreException (org.eclipse.core.runtime.CoreException)6 IDockerHostConfig (org.eclipse.linuxtools.docker.core.IDockerHostConfig)6 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)5 IDockerContainer (org.eclipse.linuxtools.docker.core.IDockerContainer)5 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)5 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)5 HashMap (java.util.HashMap)4 Map (java.util.Map)3 Job (org.eclipse.core.runtime.jobs.Job)3 ColumnLabelProvider (org.eclipse.jface.viewers.ColumnLabelProvider)3 IDockerContainerConfig (org.eclipse.linuxtools.docker.core.IDockerContainerConfig)3 IDockerImageInfo (org.eclipse.linuxtools.docker.core.IDockerImageInfo)3 DockerContainerConfig (org.eclipse.linuxtools.internal.docker.core.DockerContainerConfig)3