Tabnine Logo
MaterialConfigs.clear
Code IndexAdd Tabnine to your IDE (free)

How to use
clear
method
in
com.thoughtworks.go.config.materials.MaterialConfigs

Best Java code snippets using com.thoughtworks.go.config.materials.MaterialConfigs.clear (Showing top 8 results out of 315)

origin: gocd/gocd

public void setConfigAttributes(Object attributes) {
  clear();
  if (attributes == null) {
    return;
  }
  Map attributeMap = (Map) attributes;
  String materialType = (String) attributeMap.get(AbstractMaterialConfig.MATERIAL_TYPE);
  if (SvnMaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getSvnMaterial(), (Map) attributeMap.get(SvnMaterialConfig.TYPE));
  } else if (HgMaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getHgMaterial(), (Map) attributeMap.get(HgMaterialConfig.TYPE));
  } else if (GitMaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getGitMaterial(), (Map) attributeMap.get(GitMaterialConfig.TYPE));
  } else if (P4MaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getP4Material(), (Map) attributeMap.get(P4MaterialConfig.TYPE));
  } else if (DependencyMaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getDependencyMaterial(), (Map) attributeMap.get(DependencyMaterialConfig.TYPE));
  } else if (TfsMaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getTfsMaterial(), (Map) attributeMap.get(TfsMaterialConfig.TYPE));
  } else if (PackageMaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getPackageMaterial(), (Map) attributeMap.get(PackageMaterialConfig.TYPE));
  } else if (PluggableSCMMaterialConfig.TYPE.equals(materialType)) {
    addMaterialConfig(getSCMMaterial(), (Map) attributeMap.get(PluggableSCMMaterialConfig.TYPE));
  }
}
origin: gocd/gocd

public static PipelineConfig createManualTriggerPipelineConfig(MaterialConfig materialConfig, String pipelineName, String stageName, String... buildNames) {
  PipelineConfig pipelineConfig = createPipelineConfig(pipelineName, stageName, buildNames);
  pipelineConfig.materialConfigs().clear();
  materialConfig.setName(new CaseInsensitiveString(String.format("%s-%s", pipelineName, materialConfig.getType())));
  materialConfig.setAutoUpdate(false);
  pipelineConfig.materialConfigs().add(materialConfig);
  pipelineConfig.first().setApproval(Approval.manualApproval());
  return pipelineConfig;
}
origin: gocd/gocd

private void setDepedencyOn(CruiseConfig cruiseConfig, String toPipeline, String upstreamPipeline, String upstreamStage) {
  PipelineConfig targetPipeline = cruiseConfig.pipelineConfigByName(new CaseInsensitiveString(toPipeline));
  targetPipeline.materialConfigs().clear();
  targetPipeline.addMaterialConfig(new DependencyMaterialConfig(new CaseInsensitiveString(upstreamPipeline), new CaseInsensitiveString(upstreamStage)));
}
origin: gocd/gocd

@Test
public void shouldReturnTrueWhenOneOfPipelineMaterialsIsTheSameAsConfigOriginButDestinationIsDifferent() {
  PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfig("pipeline", "stage", "build");
  pipelineConfig.materialConfigs().clear();
  GitMaterialConfig pipeMaterialConfig = new GitMaterialConfig("http://git");
  pipeMaterialConfig.setFolder("dest1");
  pipelineConfig.materialConfigs().add(pipeMaterialConfig);
  GitMaterialConfig repoMaterialConfig = new GitMaterialConfig("http://git");
  pipelineConfig.setOrigin(new RepoConfigOrigin(new ConfigRepoConfig(repoMaterialConfig, "plugin"), "1233"));
  assertThat(pipelineConfig.isConfigOriginSameAsOneOfMaterials(), is(true));
}
origin: gocd/gocd

@Test
public void shouldNotThrowUpWhenTfsWorkspaceIsNotSpecified() {
  CruiseConfig cruiseConfig = GoConfigMother.configWithPipelines("tfs_pipeline");
  PipelineConfig tfs_pipeline = cruiseConfig.pipelineConfigByName(new CaseInsensitiveString("tfs_pipeline"));
  tfs_pipeline.materialConfigs().clear();
  tfs_pipeline.addMaterialConfig(new TfsMaterialConfig(new GoCipher(), new UrlArgument("http://tfs.com"), "username", "CORPORATE", "password", "$/project_path"));
  try {
    xmlWriter.write(cruiseConfig, output, false);
  } catch (Exception e) {
    fail("should not fail as workspace name is not mandatory anymore " + e);
  }
}
origin: gocd/gocd

@Test
public void shouldNotThrowWhenMaterialAndConfigOriginRevisionDontMatch_WhenManualTrigger() {
  SvnMaterial material = MaterialsMother.svnMaterial();
  MaterialConfig materialConfig = material.config();
  MaterialRevisions first = new MaterialRevisions(
      new MaterialRevision(material, oneModifiedFile("revision1"))
  );
  BuildCause buildCause = BuildCause.createManualForced();
  buildCause.setMaterialRevisions(first);
  PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfigWithStages("pipe1", "build");
  pipelineConfig.materialConfigs().clear();
  pipelineConfig.materialConfigs().add(materialConfig);
  pipelineConfig.setOrigin(new RepoConfigOrigin(new ConfigRepoConfig(materialConfig,"plug"),"revision2"));
  buildCause.assertPipelineConfigAndMaterialRevisionMatch(pipelineConfig);
}
origin: gocd/gocd

@Test
public void shouldNotThrowWhenMaterialAndConfigOriginRevisionMatch_WhenAutoTrigger() {
  SvnMaterial material = MaterialsMother.svnMaterial();
  MaterialConfig materialConfig = material.config();
  MaterialRevisions first = new MaterialRevisions(
      new MaterialRevision(material, oneModifiedFile("revision1"))
  );
  BuildCause buildCause = BuildCause.createWithModifications(first,"");
  buildCause.setMaterialRevisions(first);
  PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfigWithStages("pipe1", "build");
  pipelineConfig.materialConfigs().clear();
  pipelineConfig.materialConfigs().add(materialConfig);
  pipelineConfig.setOrigin(new RepoConfigOrigin(new ConfigRepoConfig(materialConfig,"plug"),"revision1"));
  buildCause.assertPipelineConfigAndMaterialRevisionMatch(pipelineConfig);
}
origin: gocd/gocd

@Test
public void shouldThrowWhenMaterialAndConfigOriginRevisionDontMatch_WhenAutoTrigger() {
  SvnMaterial material = MaterialsMother.svnMaterial();
  MaterialConfig materialConfig = material.config();
  MaterialRevisions first = new MaterialRevisions(
      new MaterialRevision(material, oneModifiedFile("revision1"))
  );
  BuildCause buildCause = BuildCause.createWithModifications(first,"");
  buildCause.setMaterialRevisions(first);
  PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfigWithStages("pipe1", "build");
  pipelineConfig.materialConfigs().clear();
  pipelineConfig.materialConfigs().add(materialConfig);
  pipelineConfig.setOrigin(new RepoConfigOrigin(new ConfigRepoConfig(materialConfig,"plug"),"revision2"));
  try {
    buildCause.assertPipelineConfigAndMaterialRevisionMatch(pipelineConfig);
  }
  catch (BuildCauseOutOfDateException ex)
  {
    //good
    return;
  }
  fail("should have thrown");
}
com.thoughtworks.go.config.materialsMaterialConfigsclear

Popular methods of MaterialConfigs

  • <init>
  • add
  • get
  • first
  • errors
  • findDependencyMaterial
  • forEach
  • size
  • validate
  • getExistingOrDefaultMaterial
  • hasDependencyMaterial
  • hasMaterialWithFingerprint
  • hasDependencyMaterial,
  • hasMaterialWithFingerprint,
  • isEmpty,
  • setConfigAttributes,
  • validateTree,
  • addAll,
  • addError,
  • addMaterialConfig,
  • displayNameFor

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • JComboBox (javax.swing)
  • JTextField (javax.swing)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now