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);
}
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);
}
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());
}
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));
}
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;
}
Aggregations