mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
bug fix.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21089 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
bcf1e1c6ed
commit
0b89c4742d
2 files changed
+7
-11
No files matched your search
@@ -1,17 +1,17 @@
|
||||
package org.jvnet.hudson.test;
|
||||
|
||||
import hudson.tasks.Builder;
|
||||
import hudson.Extension;
|
||||
import hudson.Launcher;
|
||||
import hudson.model.AbstractBuild;
|
||||
import hudson.model.BuildListener;
|
||||
import hudson.model.Result;
|
||||
import hudson.model.Descriptor;
|
||||
import hudson.Launcher;
|
||||
import hudson.Extension;
|
||||
import hudson.model.Result;
|
||||
import hudson.tasks.Builder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
|
||||
/**
|
||||
* Forces the build result to be some pre-configured value.
|
||||
@@ -28,7 +28,7 @@ public class MockBuilder extends Builder {
|
||||
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
|
||||
listener.getLogger().println("Simulating a specific result code "+result);
|
||||
build.setResult(result);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Extension
|
||||
|
||||
@@ -45,15 +45,11 @@ public class UnstableBuilder extends Builder {
|
||||
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
|
||||
listener.getLogger().println("Simulating an unstable build");
|
||||
build.setResult(Result.UNSTABLE);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Extension
|
||||
public static final class DescriptorImpl extends Descriptor<Builder> {
|
||||
public Builder newInstance(StaplerRequest req, JSONObject data) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return "Make build unstable";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user