Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-34564] Adjusted integration test to match modified behavior.
  • Loading branch information
jglick committed Sep 17, 2016
1 parent 4fa8a41 commit 7c908dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 8 additions & 2 deletions pom.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -66,14 +64,14 @@ public class WorkflowBranchProjectFactoryTest {
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="));
}
Expand All @@ -87,7 +85,7 @@ public class WorkflowBranchProjectFactoryTest {
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);
}
});
Expand Down

0 comments on commit 7c908dc

Please sign in to comment.