Package hudson.model

Examples of hudson.model.Result


                        // ignore persistence failure
                        if (!x.getMessage().contains("Failed to persist"))
                            throw x;
                    }

                Result r = b.getResult();
                String log = JenkinsRule.getLog(b);

                assert r == Result.FAILURE: "Result is "+r+"\n"+ log;
                assert log.contains("java.lang.RuntimeException: testing the forced persistence failure behaviour"): "Result is "+r+"\n"+ log;
            }
        });
        story.addStep(new Statement() {
            @Override
            public void evaluate() throws Throwable {
                rebuildContext(story.j);

                Result r = b.getResult();
                assert r == Result.FAILURE: "Result is "+r+"\n"+JenkinsRule.getLog(b);
            }
        });
    }
View Full Code Here


                while (reader.hasMoreChildren()) {
                    reader.moveDown();

                    String nodeName = reader.getNodeName();
                    if (nodeName.equals("result")) {
                        Result r = readChild(reader, context, Result.class, result);
                        setField(result, "result", r);
                    } else
                    if (nodeName.equals("script")) {
                        String script = readChild(reader, context, String.class, result);
                        setField(result, "script", script);
View Full Code Here

    super.result = result;
  }

  @Override
  public Result getResult() {
    Result result = this.masterResult.getOverallResult();
    setResult(result);
    return result;
  }
View Full Code Here

  public AbstractBuild getLatestBuild() {
    return buildFinder.findBuild(getProjectName(), buildNumbers.last());
  }

  public Result getResult() {
    Result result = Result.NOT_BUILT;

    if (buildNumbers.isEmpty()) {
      return result;
    }
View Full Code Here

    }
    return builds;
  }

  public Result getOverallResult() {
    Result endResult = (results.isEmpty()) ? Result.FAILURE : Result.SUCCESS;
    for (SubResult subResult : results.values()) {
      Result result = subResult.getResult();
      if (result == null) {
        result = Result.NOT_BUILT;
      }
      endResult = endResult.combine(result);
    }
View Full Code Here

                      project.getDisplayName(),
                      hudson.getRootUrl(),
                      build.getUrl(),
                      "console");
              } else if (!completed.contains(project)) {
                Result result = build.getResult();
                String page = "testReport";
                if (result.isWorseThan(Result.UNSTABLE)) {
                    page = "console";
                }
                logger.printf("[%s] %s (%s%s%s)\n",
                    result,
                    project.getDisplayName(),
                    hudson.getRootUrl(),
                    build.getUrl(),
                    page);
                MasterBuildCause currentCause =
                    (MasterBuildCause) build.getCause(MasterBuildCause.class);
                int rebuildNumber = currentCause.getRebuildNumber();
                if (result.isWorseThan(Result.SUCCESS)
                    && rebuildNumber < maxRetries) {
                  Cause newCause =
                      new MasterBuildCause(masterBuild, rebuildNumber + 1);
                  this.masterBuild.rebuild(project, newCause);
                  projectBuildMap.remove(project);
View Full Code Here

        LOG.finer("jenkow_build_parent = "+jobName);
       
        Object buildNumber = exec.getVariable("jenkow_build_number");
        LOG.finer("jenkow_build_number = "+buildNumber);
       
        Result buildResult = Result.SUCCESS;
        Object forcedBuildResult = exec.getVariable(Consts.BUILD_RESULT_NAME);
        LOG.finer(Consts.BUILD_RESULT_NAME+" = "+forcedBuildResult);
        if (forcedBuildResult != null){
            buildResult = Result.fromString(forcedBuildResult.toString());
        }
View Full Code Here

    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
        try {
            updateCommitStatus(build, listener);
            return true;
        } catch (IOException error) {
            final Result buildResult = getEffectiveResultOnFailure();
            if (buildResult.equals(Result.FAILURE)) {
                throw error;
            } else {
                listener.error("[GitHub Commit Notifier] - " + error.getMessage());
                if (buildResult.isWorseThan(build.getResult())) {
                    listener.getLogger().println("[GitHub Commit Notifier] - Build result will be set to " + buildResult);
                    build.setResult(buildResult);
                }
            }
        }
View Full Code Here

                String msg;

                // We do not use `build.getDurationString()` because it appends 'and counting' (build is still running)
                final String duration = Util.getTimeSpanString(System.currentTimeMillis() - build.getTimeInMillis());

                Result result = build.getResult();
                if (result == null) { // Build is ongoing
                    state = GHCommitState.PENDING;
                    msg = Messages.CommitNotifier_Pending(build.getDisplayName());
                } else if (result.isBetterOrEqualTo(SUCCESS)) {
                    state = GHCommitState.SUCCESS;
                    msg = Messages.CommitNotifier_Success(build.getDisplayName(), duration);
                } else if (result.isBetterOrEqualTo(UNSTABLE)) {
                    state = GHCommitState.FAILURE;
                    msg = Messages.CommitNotifier_Unstable(build.getDisplayName(), duration);
                } else {
                    state = GHCommitState.ERROR;
                    msg = Messages.CommitNotifier_Failed(build.getDisplayName(), duration);
View Full Code Here

    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
        try {
            updateCommitStatus(build, listener);
            return true;
        } catch (IOException error) {
            final Result buildResult = getEffectiveResultOnFailure();
            if (buildResult.equals(Result.FAILURE)) {
                throw error;
            } else {
                listener.error("[GitHub Commit Notifier] - " + error.getMessage());
                if (buildResult.isWorseThan(build.getResult())) {
                    listener.getLogger().println("[GitHub Commit Notifier] - Build result will be set to " + buildResult);
                    build.setResult(buildResult);
                }
            }
        }
View Full Code Here

TOP

Related Classes of hudson.model.Result

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.