assertEquals("value3", builder.getEnvVars().get("KEY1"));
assertEquals("value2", builder.getEnvVars().get("KEY2"));
}
public void testMergeParameters() throws Exception {
Project projectA = createFreeStyleProject("projectA");
Project projectB = createFreeStyleProject("projectB");
// projectB defaults: FOO=bar BAR=override-me
// Invoke projectA with: BAR=foo BAZ=override-me
// Merge in predefined: BAZ=moo HOHO=blah
// Expected result: FOO=bar BAR=foo BAZ=moo HOHO=blah
projectB.addProperty(new ParametersDefinitionProperty(
new StringParameterDefinition("FOO", "bar"),
new StringParameterDefinition("BAR", "override-me")));
CaptureEnvironmentBuilder builder = new CaptureEnvironmentBuilder();
projectB.getBuildersList().add(builder);
projectB.setQuietPeriod(1);
projectA.getPublishersList().add(new BuildTrigger(
new BuildTriggerConfig("projectB", ResultCondition.SUCCESS,
new CurrentBuildParameters(),
new PredefinedBuildParameters("BAZ=moo\nHOHO=blah"))));
hudson.rebuildDependencyGraph();