public void setBuildChooser(BuildChooser buildChooser) throws IOException { if (buildChooser.getClass()==DefaultBuildChooser.class) { getExtensions().remove(BuildChooserSetting.class); } else { getExtensions().replace(new BuildChooserSetting(buildChooser)); } }
public void set() throws IOException { List<EnvironmentVariablesNodeProperty.Entry> entries = new ArrayList<>(env.size()); for (Map.Entry<String, String> entry : env.entrySet()) { entries.add(new EnvironmentVariablesNodeProperty.Entry(entry.getKey(), entry.getValue())); } EnvironmentVariablesNodeProperty newProperty = new EnvironmentVariablesNodeProperty(entries); DescribableList<NodeProperty<?>, NodePropertyDescriptor> nodeProperties = agent.getNodeProperties(); nodeProperties.replace(newProperty); }
response.getWriter().write("Successfully added a new JIRA Build Notifier"); } else if (!currentNotifier.postUrl.equals(postUrl)) { publishers.replace(currentNotifier, newNotifier); response.getWriter().write("Successfully replaced the existing JIRA Build Notifier"); } else {
pl.replace(new BuildTrigger(newChildProjects, existing==null?Result.SUCCESS:existing.getThreshold()));
pl.replace(new BuildTrigger(newChildProjects, existing==null?Result.SUCCESS:existing.getThreshold()));
continue; // no need to touch pl.replace(new BuildTrigger(newChildProjects, existing == null ? Result.SUCCESS : existing.getThreshold()));
continue; // no need to touch pl.replace(new BuildTrigger(newChildProjects, existing == null ? Result.SUCCESS : existing.getThreshold()));
getExtensions().replace(new PreBuildMerge(new UserMergeOptions(mergeOptions))); mergeOptions = null;
public MercurialInstallation createInstallation(JenkinsRule r, Version v, boolean debug, boolean useCaches, boolean useSharing, String config, Slave... slaves) throws IOException { MercurialInstallation.DescriptorImpl desc = r.jenkins.getDescriptorByType(MercurialInstallation.DescriptorImpl.class); ToolLocationNodeProperty.ToolLocation location = new ToolLocationNodeProperty.ToolLocation(desc, v.name(), "/opt/mercurial-" + v.exactVersion); MercurialInstallation inst = new MercurialInstallation(v.name(), "", "INSTALLATION/hg", debug, useCaches, useSharing, config, null); desc.setInstallations((MercurialInstallation[]) ArrayUtils.add(desc.getInstallations(), inst)); // TODO stop calling this here, should be responsibility of caller for (Slave slave : slaves) { DescribableList<NodeProperty<?>, NodePropertyDescriptor> props = slave.getNodeProperties(); ToolLocationNodeProperty prop = props.get(ToolLocationNodeProperty.class); List<ToolLocationNodeProperty.ToolLocation> locations; if (prop == null) { locations = Collections.singletonList(location); } else { locations = new ArrayList<>(prop.getLocations()); locations.add(location); } props.replace(new ToolLocationNodeProperty(locations)); } return inst; }
assertEquals(1, releaseBuild.get().getNumber()); assertEquals(2, release.getNextBuildNumber()); top.getProperties().replace(new NoTriggerOrganizationFolderProperty("(?!master$).*")); round3(); WorkflowMultiBranchProjectTest.showIndexing(p);