Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from coldy77/master
[FIXED JENKINS-26029] Add FAILURE_OR_BETTER Trigger Threshold.
- Loading branch information
Showing
3 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/test/java/hudson/plugins/parameterizedtrigger/test/AbortedBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package hudson.plugins.parameterizedtrigger.test; | ||
|
||
import hudson.Extension; | ||
import hudson.Launcher; | ||
import hudson.model.AbstractBuild; | ||
import hudson.model.BuildListener; | ||
import hudson.model.Descriptor; | ||
import hudson.model.Result; | ||
import hudson.tasks.Builder; | ||
import net.sf.json.JSONObject; | ||
import org.kohsuke.stapler.StaplerRequest; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* A Builder which simulates an aborted build. | ||
* To use for testing behaviour of Build Results. | ||
*/ | ||
public class AbortedBuilder extends Builder { | ||
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { | ||
listener.getLogger().println("Simulating an aborted build"); | ||
build.setResult(Result.ABORTED); | ||
return true; | ||
} | ||
|
||
@Extension | ||
public static final class DescriptorImpl extends Descriptor<Builder> { | ||
public DescriptorImpl() { | ||
} | ||
|
||
public String getDisplayName() { | ||
return "Make build aborted"; | ||
} | ||
|
||
public AbortedBuilder newInstance(StaplerRequest req, JSONObject data) { | ||
return new AbortedBuilder(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters