Skip to content
Permalink
Browse files

[JENKINS-34564] Adjusted integration test to match modified behavior.

  • Loading branch information
jglick committed Sep 17, 2016
1 parent 4fa8a41 commit 7c908dc9409eda22ead2885af3616f435b13ec27
10 pom.xml
@@ -28,8 +28,8 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.12</version>
<relativePath />
<version>2.14</version>
<relativePath/>
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-multibranch</artifactId>
@@ -204,6 +204,12 @@ THE SOFTWARE.
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.1.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
@@ -25,9 +25,7 @@
package org.jenkinsci.plugins.workflow.multibranch;

import java.io.File;
import jenkins.branch.BranchProperty;
import jenkins.branch.BranchSource;
import jenkins.branch.DefaultBranchPropertyStrategy;
import jenkins.plugins.git.GitSCMSource;
import jenkins.plugins.git.GitSampleRepoRule;
import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval;
@@ -66,14 +64,14 @@
sampleRepo.git("add", "Jenkinsfile");
sampleRepo.git("commit", "--all", "--message=flow");
WorkflowMultiBranchProject mp = story.j.jenkins.createProject(WorkflowMultiBranchProject.class, "p");
mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleRepo.toString(), "", "*", "", false), new DefaultBranchPropertyStrategy(new BranchProperty[0])));
mp.getSourcesList().add(new BranchSource(new GitSCMSource(null, sampleRepo.toString(), "", "*", "", false)));
WorkflowJob p = scheduleAndFindBranchProject(mp, "dev%2Fmain");
assertEquals(1, mp.getItems().size());
story.j.waitUntilNoActivity();
WorkflowRun b1 = p.getLastBuild();
assertEquals(1, b1.getNumber());
story.j.assertLogContains("branch=dev/main", b1);
story.j.assertLogContains("workspace=dev%2Fmain", b1);
story.j.assertLogContains("workspace=dev_main-yVp7JkdR.HpV0KPdCvrFv.9HoUgEAQ2OvxCAZF4W_iQ", b1);
verifyProject(p);
sampleRepo.write("Jenkinsfile", script.replace("branch=", "Branch="));
}
@@ -87,7 +85,7 @@
WorkflowRun b2 = p.getLastBuild();
assertEquals(2, b2.getNumber());
story.j.assertLogContains("Branch=dev/main", b2);
story.j.assertLogContains("workspace=dev%2Fmain", b2);
story.j.assertLogContains("workspace=dev_main-yVp7JkdR.HpV0KPdCvrFv.9HoUgEAQ2OvxCAZF4W_iQ", b2);
verifyProject(p);
}
});

0 comments on commit 7c908dc

Please sign in to comment.