Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #363 from jglick/duplicate-children-JENKINS-32179
[JENKINS-32179] Integration test
  • Loading branch information
jglick committed Mar 16, 2016
2 parents e161fcf + 8119765 commit 5b4c683
Showing 1 changed file with 32 additions and 0 deletions.
Expand Up @@ -24,7 +24,10 @@

package org.jenkinsci.plugins.workflow.multibranch;

import hudson.ExtensionList;
import hudson.model.DescriptorVisibilityFilter;
import hudson.model.Item;
import hudson.model.listeners.ItemListener;
import hudson.plugins.git.GitSCM;
import hudson.scm.ChangeLogParser;
import hudson.scm.SCM;
Expand All @@ -50,9 +53,11 @@
import org.jenkinsci.plugins.workflow.steps.scm.GitSampleRepoRule;
import static org.junit.Assert.*;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.BuildWatcher;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;

Expand Down Expand Up @@ -155,4 +160,31 @@ public DescriptorImpl() {
}
}

@Ignore("TODO cloudbees-folder 5.5+")
@Issue("JENKINS-32179")
@Test public void conflictingBranches() throws Exception {
sampleRepo.init();
sampleRepo.write("Jenkinsfile", "");
sampleRepo.git("add", "Jenkinsfile");
sampleRepo.git("commit", "--all", "--message=flow");
WorkflowMultiBranchProject mp = r.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), new DefaultBranchPropertyStrategy(new BranchProperty[0])));
WorkflowJob p = scheduleAndFindBranchProject(mp, "master");
mp.getIndexing().writeWholeLogTo(System.out);
assertEquals(1, mp.getItems().size());
r.waitUntilNoActivity();
WorkflowRun b1 = p.getLastBuild();
assertEquals(1, b1.getNumber());
mp.scheduleBuild2(0).getFuture().get();
mp.getIndexing().writeWholeLogTo(System.out);
assertEquals("[p, p/master]", ExtensionList.lookup(Listener.class).get(0).names.toString());
}
@TestExtension("conflictingBranches") public static class Listener extends ItemListener {
List<String> names = new ArrayList<>();
@Override public void onCreated(Item item) {
names.add(item.getFullName());
}
}

}

0 comments on commit 5b4c683

Please sign in to comment.