Search in sources :

Example 16 with BasicCruiseConfig

use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.

the class PackageRepositoryTest method shouldValidateIfNameIsMissing.

@Test
public void shouldValidateIfNameIsMissing() {
    PackageRepository packageRepository = new PackageRepository();
    packageRepository.validate(new ConfigSaveValidationContext(new BasicCruiseConfig(), null));
    assertThat(packageRepository.errors().getAllOn("name"), is(asList("Please provide name")));
}
Also used : ConfigSaveValidationContext(com.thoughtworks.go.config.ConfigSaveValidationContext) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) Test(org.junit.Test)

Example 17 with BasicCruiseConfig

use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.

the class MaterialUpdateServiceIntegrationTest method configWithMaterial.

private CruiseConfig configWithMaterial(SvnMaterialConfig goodMaterial) {
    CruiseConfig config = new BasicCruiseConfig();
    new GoConfigMother().addPipeline(config, "good-pipeline", "first-stage", new MaterialConfigs(goodMaterial));
    return config;
}
Also used : MaterialConfigs(com.thoughtworks.go.config.materials.MaterialConfigs) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) GoConfigMother(com.thoughtworks.go.helper.GoConfigMother)

Example 18 with BasicCruiseConfig

use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.

the class ElasticAgentProfileCreateCommandTest method shouldAddElasticProfile.

@Test
public void shouldAddElasticProfile() throws Exception {
    BasicCruiseConfig cruiseConfig = GoConfigMother.defaultCruiseConfig();
    ElasticProfile elasticProfile = new ElasticProfile("foo", "docker");
    ElasticAgentProfileCreateCommand command = new ElasticAgentProfileCreateCommand(null, elasticProfile, extension, null, null);
    command.update(cruiseConfig);
    assertThat(cruiseConfig.server().getElasticConfig().getProfiles().find("foo"), equalTo(elasticProfile));
}
Also used : BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) ElasticProfile(com.thoughtworks.go.config.elastic.ElasticProfile) Test(org.junit.Test)

Example 19 with BasicCruiseConfig

use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.

the class DiskSpaceFullCheckerTest method simulateFullDisk.

private CruiseConfig simulateFullDisk() {
    new SystemEnvironment().setProperty(SystemEnvironment.ARTIFACT_FULL_SIZE_LIMIT, "1200009M");
    CruiseConfig cruiseConfig = new BasicCruiseConfig();
    cruiseConfig.setServerConfig(new ServerConfig(".", new SecurityConfig()));
    return cruiseConfig;
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ServerConfig(com.thoughtworks.go.config.ServerConfig) SecurityConfig(com.thoughtworks.go.config.SecurityConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig)

Example 20 with BasicCruiseConfig

use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.

the class DiskSpaceWarningCheckerTest method shouldUseWarningLimit.

@Test
public void shouldUseWarningLimit() {
    new SystemEnvironment().setProperty(SystemEnvironment.ARTIFACT_WARNING_SIZE_LIMIT, "1M");
    CruiseConfig cruiseConfig = new BasicCruiseConfig();
    cruiseConfig.setServerConfig(new ServerConfig(".", new SecurityConfig()));
    ArtifactsDiskSpaceWarningChecker fullChecker = new ArtifactsDiskSpaceWarningChecker(new SystemEnvironment(), sender, goConfigService, new SystemDiskSpaceChecker(), serverHealthService);
    assertThat(fullChecker.limitInMb(), is(1L));
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ServerConfig(com.thoughtworks.go.config.ServerConfig) SecurityConfig(com.thoughtworks.go.config.SecurityConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) CruiseConfig(com.thoughtworks.go.config.CruiseConfig) BasicCruiseConfig(com.thoughtworks.go.config.BasicCruiseConfig) Test(org.junit.Test)

Aggregations

BasicCruiseConfig (com.thoughtworks.go.config.BasicCruiseConfig)31 Test (org.junit.Test)28 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)18 ServerConfig (com.thoughtworks.go.config.ServerConfig)10 BasicPipelineConfigs (com.thoughtworks.go.config.BasicPipelineConfigs)4 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)4 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)4 ServerSiteUrlConfig (com.thoughtworks.go.domain.ServerSiteUrlConfig)4 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)4 ConfigSaveValidationContext (com.thoughtworks.go.config.ConfigSaveValidationContext)3 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)3 ValidationError (com.thoughtworks.go.plugin.api.response.validation.ValidationError)3 ValidationResult (com.thoughtworks.go.plugin.api.response.validation.ValidationResult)3 GoConfigService (com.thoughtworks.go.server.service.GoConfigService)3 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)3 PluginRoleConfig (com.thoughtworks.go.config.PluginRoleConfig)2 SecurityAuthConfig (com.thoughtworks.go.config.SecurityAuthConfig)2 ElasticProfile (com.thoughtworks.go.config.elastic.ElasticProfile)2 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)2 ConfigurationKey (com.thoughtworks.go.domain.config.ConfigurationKey)2