Skip to content
Permalink
Browse files

[JENKINS-32670] Integration test showing that branch property strateg…

…ies are hidden by default for multibranch Pipeline projects.

Originally-Committed-As: 96460b497b3427fcfba461fbcf45933318b91b34
  • Loading branch information...
jglick committed Mar 15, 2016
1 parent 9e88a2c commit 7c2e34e393ef8ee14f6d3d7865a1f2cc632bb092
@@ -53,7 +53,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>branch-api</artifactId>
<version>1.1</version>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -37,11 +37,13 @@
import javax.annotation.Nonnull;
import jenkins.branch.BranchProperty;
import jenkins.branch.BranchPropertyDescriptor;
import jenkins.branch.BranchPropertyStrategyDescriptor;
import jenkins.branch.BranchSource;
import jenkins.branch.DefaultBranchPropertyStrategy;
import jenkins.plugins.git.GitSCMSource;
import jenkins.scm.api.SCMHead;
import jenkins.scm.api.SCMSource;
import jenkins.scm.api.SCMSourceDescriptor;
import jenkins.scm.impl.SingleSCMSource;
import static org.hamcrest.Matchers.*;
import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval;
@@ -53,6 +55,7 @@
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;

@@ -114,6 +117,7 @@
return p;
}

@Issue("JENKINS-32670")
@Test public void visibleBranchProperties() throws Exception {
WorkflowMultiBranchProject p = r.jenkins.createProject(WorkflowMultiBranchProject.class, "p");
Set<Class<? extends BranchProperty>> clazzes = new HashSet<Class<? extends BranchProperty>>();
@@ -123,6 +127,7 @@
// RateLimitBranchProperty & BuildRetentionBranchProperty hidden by JobPropertyStep.HideSuperfluousBranchProperties.
// UntrustedBranchProperty hidden because it applies only to Project.
assertEquals(Collections.<Class<? extends BranchProperty>>emptySet(), clazzes);
assertEquals(Collections.<BranchPropertyStrategyDescriptor>emptyList(), r.jenkins.getDescriptorByType(BranchSource.DescriptorImpl.class).propertyStrategyDescriptors(p, r.jenkins.getDescriptorByType(SingleSCMSource.DescriptorImpl.class)));
}

@SuppressWarnings("rawtypes")

0 comments on commit 7c2e34e

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