Skip to content

Commit

Permalink
simplify DontBuildBranchBuildStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenKing committed Aug 29, 2017
1 parent 4cc58de commit e6971eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,15 @@
import jenkins.branch.BranchBuildStrategyDescriptor;
import jenkins.scm.api.SCMHead;
import jenkins.scm.api.SCMSource;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

public class DontBuildBranchBuildStrategy extends BranchBuildStrategy {

static final DontBuildBranchBuildStrategy INSTANCE = new DontBuildBranchBuildStrategy();

@Override
public boolean isAutomaticBuild(SCMSource source, SCMHead head) {
// never ever build automatically
return false;
}

@Extension
public static class DescriptorImpl extends BranchBuildStrategyDescriptor {
@Nonnull
@Override
public String getDisplayName() {
return "Hello";
}

@Override
public BranchBuildStrategy newInstance(@CheckForNull StaplerRequest req, @Nonnull JSONObject formData) throws FormException {
return INSTANCE;
}
}
public static class DescriptorImpl extends BranchBuildStrategyDescriptor { }
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package org.jenkinsci.plugins.parallel_test_executor;

import hudson.Extension;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import hudson.model.FreeStyleProject;
import jenkins.branch.BranchBuildStrategy;
import jenkins.branch.BranchBuildStrategyDescriptor;
import jenkins.branch.BranchSource;
import jenkins.branch.MultiBranchProject;
import jenkins.plugins.git.GitSCMSource;
import jenkins.plugins.git.GitSampleRepoRule;
import jenkins.scm.api.SCMHead;
import jenkins.scm.api.SCMSource;
import jenkins.scm.api.SCMSourceDescriptor;
import net.sf.json.JSONObject;
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.cps.SnippetizerTester;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
Expand All @@ -21,17 +17,8 @@
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.recipes.LocalData;
import org.kohsuke.stapler.StaplerRequest;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;

import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;

public class ParallelTestExecutorTest {

Expand Down

0 comments on commit e6971eb

Please sign in to comment.