Skip to content
Permalink
Browse files

[JENKINS-46317] Bump baseline and fix tests (#30)

  • Loading branch information
armfergom committed Aug 21, 2017
1 parent c999191 commit a6460a3974e5f55482c1a1ae85998f73156cf744
Showing with 12 additions and 4 deletions.
  1. +1 −1 pom.xml
  2. +11 −3 src/test/java/hudson/tasks/AntTest.java
@@ -28,7 +28,7 @@
</scm>

<properties>
<jenkins.version>1.642.3</jenkins.version>
<jenkins.version>1.651.3</jenkins.version>
</properties>

<dependencies>
@@ -36,6 +36,7 @@
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import hudson.model.ParameterDefinition;
import hudson.model.ParameterValue;
import hudson.model.ParametersAction;
import hudson.model.ParametersDefinitionProperty;
import hudson.model.PasswordParameterDefinition;
@@ -54,7 +55,11 @@
import hudson.util.VersionNumber;
import java.io.IOException;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import jenkins.model.Jenkins;
import org.apache.commons.lang.SystemUtils;
import static org.hamcrest.Matchers.*;
@@ -356,9 +361,12 @@ private void testVariableReplaced(String variableValue) throws Exception {
ParameterDefinition paramDef = new StringParameterDefinition("variable", "");
ParametersDefinitionProperty paramsDef = new ParametersDefinitionProperty(paramDef);
project.addProperty(paramsDef);

FreeStyleBuild build = project.scheduleBuild2(0, new Cause.UserIdCause(),
new ParametersAction(new StringParameterValue("variable", variableValue))).get();

Set<String> safeParams = new HashSet<String>();
safeParams.add("variable");
ParametersAction parameters = new ParametersAction(Arrays.asList(new ParameterValue[] { new StringParameterValue("variable", variableValue) }), safeParams);

FreeStyleBuild build = project.scheduleBuild2(0, new Cause.UserIdCause(), parameters).get();

assertEquals(Result.SUCCESS, build.getResult());
List<String> logs = build.getLog(Integer.MAX_VALUE);

0 comments on commit a6460a3

Please sign in to comment.
You can’t perform that action at this time.