Package nl.topicus.onderwijs.dashboard.datatypes.hudson

Examples of nl.topicus.onderwijs.dashboard.datatypes.hudson.Build


  public List<Dot> getValue() {
    List<Build> builds = service.getBuilds(project);

    ArrayList<Dot> result = new ArrayList<Dot>();
    for (int i = 0; i < Math.min(5, builds.size()); i++) {
      Build build = builds.get(i);
      if (build.isBuilding()) {
        result.add(new Dot(DotColor.GRAY, build.getJob().getCode()));
      } else {
        switch (build.getResult()) {
        case SUCCESS:
          result
              .add(new Dot(DotColor.GREEN, build.getJob()
                  .getCode()));
          break;
        case UNSTABLE:
          result.add(new Dot(DotColor.YELLOW, build.getJob()
              .getCode()));
          break;
        case FAILURE:
          result.add(new Dot(DotColor.RED, build.getJob().getCode()));
          break;
        }
      }
    }
    return result;
View Full Code Here


    List<Build> builds = new ArrayList<Build>();
    for (Job job : jobs) {
      for (int i = 0; i < Math.min(5, job.getBuilds().size()); i++) {
        BuildReference buildReference = job.getBuilds().get(i);
        Build build = getBuild(project, buildReference, job);
        builds.add(build);
      }
    }
    Collections.sort(builds, new BuildsComparator());
    return builds;
View Full Code Here

      StatusPageResponse response = RetrieverUtils
          .getStatuspage(reference.getUrl() + "api/json");
      if (response.getHttpStatusCode() != 200) {
        return null;
      }
      Build build = mapper.readValue(response.getPageContent(),
          Build.class);
      build.setJob(job);
      if (!build.isBuilding()) {
        // don't store the build result in the cache when it's still
        // building.
        buildsCache.put(HudsonKey.of(project, reference), build);
      }
      return build;
View Full Code Here

    Map<String, Build> builds = new HashMap<String, Build>();
    for (Job job : jobs) {
      for (int i = 0; i < Math.min(1, job.getBuilds().size()); i++) {
        BuildReference buildReference = job.getBuilds().get(i);
        Build build = getBuild(project, buildReference, job);
        builds.put(job.getName(), build);
      }
    }

    List<Alert> ret = new ArrayList<Alert>();
    for (Job curJob : jobs) {
      Build curBuild = builds.get(curJob.getName());
      if (curBuild == null)
        continue;

      if (Result.UNSTABLE.equals(curBuild.getResult())) {
        Alert alert = new Alert(alertsCache.get(curJob.getName()),
            DotColor.YELLOW, project, "Build "
                + curBuild.getNumber() + " is unstable");
        alert.setOverlayVisible((System.currentTimeMillis() - curBuild
            .getTimestamp().getTime()) < 90 * 1000);
        alertsCache.put(curJob.getName(), alert);
        ret.add(alert);
      } else if (Result.FAILURE.equals(curBuild.getResult())) {
        Alert alert = new Alert(alertsCache.get(curJob.getName()),
            DotColor.RED, project, "Build " + curBuild.getNumber()
                + " failed");
        alert.setOverlayVisible((System.currentTimeMillis() - curBuild
            .getTimestamp().getTime()) < 90 * 1000);
        alertsCache.put(curJob.getName(), alert);
        ret.add(alert);
      } else
        alertsCache.remove(curJob.getName());
View Full Code Here

    List<Build> builds = service.getBuilds(project);

    if (builds.isEmpty())
      return null;

    Build buildWithMaxUnitTests = Collections.max(builds,
        new UnitTestComparator());

    Action testReport = getTestReport(buildWithMaxUnitTests);
    return testReport == null ? null : testReport.getTotalCount();
  }
View Full Code Here

TOP

Related Classes of nl.topicus.onderwijs.dashboard.datatypes.hudson.Build

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.