use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class ImportApplicationWizardModel method getApplicationName.
@Override
public String getApplicationName() {
String appName = null;
IBuildConfig buildConfig = getSelectedBuildConfig();
if (buildConfig != null) {
appName = buildConfig.getName();
}
return appName;
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class ProjectTreeSorterTest method mockBuildConfig.
private IBuildConfig mockBuildConfig(String name, String uri, String toString) {
IBuildConfig config = Mockito.mock(IBuildConfig.class);
when(config.getKind()).thenReturn(ResourceKind.BUILD_CONFIG);
when(config.getName()).thenReturn(name);
when(config.getSourceURI()).thenReturn(uri);
when(config.toString()).thenReturn(toString);
return config;
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class OpenShiftExplorerLabelProviderTest method getStyledTextForABuildConfig.
@Test
public void getStyledTextForABuildConfig() {
IBuildConfig buildConfig = givenAResource(IBuildConfig.class, ResourceKind.BUILD_CONFIG);
when(buildConfig.getSourceURI()).thenReturn("git://somplace.com/foo/bar.git");
StyledString actual = provider.getStyledText(buildConfig);
assertEquals(buildConfig.getName() + " git://somplace.com/foo/bar.git", actual.getString());
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class ResourceDetailsContentProviderTest method shouldReturnUnknownResourcePropertyGivenBuildConfigBuildStrategyIsNull.
@Test
public void shouldReturnUnknownResourcePropertyGivenBuildConfigBuildStrategyIsNull() {
// given
IBuildConfig bc = ResourceMocks.createBuildConfig("42", null, null, null, null, null, null, null);
// when
Object[] children = contentProvider.getChildren(bc);
// then
ResourceProperty property = getResourceProperty(ResourceDetailsContentProvider.LABEL_STRATEGY, children);
assertThat(property).isNotNull();
assertThat(property.isUnknownValue()).isTrue();
}
use of com.openshift.restclient.model.IBuildConfig in project jbosstools-openshift by jbosstools.
the class CreateApplicationFromImageJob method addToGeneratedResources.
@Override
protected void addToGeneratedResources(Map<String, IResource> resources, final Connection connection, final String name, final IProject project) {
IBuildConfigBuilder builder = connection.getResourceBuilder(IBuildConfigBuilder.class);
IBuildConfig bc = builder.named(name).inNamespace(project.getName()).fromGitSource().fromGitUrl(buildConfigModel.getGitRepositoryUrl()).usingGitReference(buildConfigModel.getGitReference()).inContextDir(buildConfigModel.getContextDir()).end().usingSourceStrategy().fromImageStreamTag(buildConfigModel.getBuilderImageName()).inNamespace(buildConfigModel.getBuilderImageNamespace()).withEnvVars(createEnvVars()).end().buildOnSourceChange(buildConfigModel.isConfigWebHook()).buildOnConfigChange(buildConfigModel.isConfigChangeTrigger()).buildOnImageChange(buildConfigModel.isImageChangeTrigger()).toImageStreamTag(new DockerImageURI(name).getNameAndTag()).build();
resources.put(ResourceKind.BUILD_CONFIG, bc);
}
Aggregations