use of com.thoughtworks.go.config.materials.git.GitMaterialConfig in project gocd by gocd.
the class GoConfigMigrationIntegrationTest method migration99_shouldMigrateGitMaterialsUnderConfigRepoAndRetainOnlyTheMinimalRequiredAttributes.
@Test
public void migration99_shouldMigrateGitMaterialsUnderConfigRepoAndRetainOnlyTheMinimalRequiredAttributes() throws Exception {
String configXml = "<cruise schemaVersion='98'>" + "<config-repos>\n" + " <config-repo pluginId=\"json.config.plugin\" id=\"config-repo-1\">\n" + " <git url=\"test-repo\" dest='dest' shallowClone='true' autoUpdate='true' invertFilter='true' materialName=\"foo\">\n" + " <filter>\n" + " <ignore pattern=\"asdsd\" />\n" + " </filter>\n" + " </git>" + " </config-repo>\n" + "</config-repos>" + "</cruise>";
assertThat(configXml).contains("<filter>");
assertThat(configXml).contains("dest='dest'");
assertThat(configXml).contains("autoUpdate='true'");
assertThat(configXml).contains("invertFilter='true'");
assertThat(configXml).contains("shallowClone='true'");
String migratedContent = migrateXmlString(configXml, 98);
CruiseConfig cruiseConfig = loader.deserializeConfig(migratedContent);
GitMaterialConfig materialConfig = (GitMaterialConfig) cruiseConfig.getConfigRepos().getConfigRepo("config-repo-1").getRepo();
assertThat(migratedContent).doesNotContain("<filter>");
assertThat(migratedContent).doesNotContain("dest='dest'");
assertThat(migratedContent).doesNotContain("invertFilter='true'");
assertThat(migratedContent).doesNotContain("shallowClone='true'");
assertThat(materialConfig.getFolder()).isNull();
assertThat(materialConfig.filter().size()).isEqualTo(0);
assertThat(materialConfig.isAutoUpdate()).isTrue();
assertThat(materialConfig.isInvertFilter()).isFalse();
assertThat(materialConfig.isShallowClone()).isFalse();
}
use of com.thoughtworks.go.config.materials.git.GitMaterialConfig in project gocd by gocd.
the class PartialConfigMother method withPipelineMultipleMaterials.
public static PartialConfig withPipelineMultipleMaterials(String name, RepoConfigOrigin repoOrigin) {
GitMaterialConfig gitMaterialConfig = MaterialConfigsMother.gitMaterialConfig();
gitMaterialConfig.setFolder("git");
SvnMaterialConfig svnMaterialConfig = MaterialConfigsMother.svnMaterialConfig();
svnMaterialConfig.setFolder("svn");
PipelineConfig pipe = PipelineConfigMother.pipelineConfig(name, new MaterialConfigs(gitMaterialConfig, svnMaterialConfig));
BasicPipelineConfigs pipes = new BasicPipelineConfigs(pipe);
pipes.setGroup("group");
PartialConfig partialConfig = new PartialConfig(new PipelineGroups(pipes));
partialConfig.setOrigins(repoOrigin);
return partialConfig;
}
use of com.thoughtworks.go.config.materials.git.GitMaterialConfig in project gocd by gocd.
the class MaterialConfigsMother method git.
public static GitMaterialConfig git(String url, String username, String password) {
GitMaterialConfig gitMaterialConfig = git(url);
gitMaterialConfig.setUserName(username);
gitMaterialConfig.setPassword(password);
return gitMaterialConfig;
}
use of com.thoughtworks.go.config.materials.git.GitMaterialConfig in project gocd by gocd.
the class MaterialConfigsMother method git.
public static GitMaterialConfig git(String url, boolean shallowClone) {
GitMaterialConfig gitMaterialConfig = git(url);
gitMaterialConfig.setShallowClone(shallowClone);
return gitMaterialConfig;
}
use of com.thoughtworks.go.config.materials.git.GitMaterialConfig in project gocd by gocd.
the class MaterialConfigsMother method git.
public static GitMaterialConfig git(String url, String userName, String password, String branch, String submoduleFolder, boolean autoUpdate, Filter filter, boolean invertFilter, String folder, CaseInsensitiveString name, Boolean shallowClone) {
GitMaterialConfig gitMaterialConfig = git(url, branch, shallowClone);
gitMaterialConfig.setUserName(userName);
gitMaterialConfig.setPassword(password);
gitMaterialConfig.setSubmoduleFolder(submoduleFolder);
gitMaterialConfig.setAutoUpdate(autoUpdate);
gitMaterialConfig.setFilter(filter);
gitMaterialConfig.setInvertFilter(invertFilter);
gitMaterialConfig.setFolder(folder);
gitMaterialConfig.setName(name);
return gitMaterialConfig;
}
Aggregations