Example usage for com.amazonaws.services.devicefarm.model Run getStatus

List of usage examples for com.amazonaws.services.devicefarm.model Run getStatus

Introduction

In this page you can find the example usage for com.amazonaws.services.devicefarm.model Run getStatus.

Prototype


public String getStatus() 

Source Link

Document

The run's status.

Usage

From source file:org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarmTestResult.java

License:Open Source License

public AWSDeviceFarmTestResult(AbstractBuild<?, ?> build, Run run) {
    this.build = build;

    if (run != null) {
        this.id = AWSDeviceFarmUtils.getRunIdFromArn(run.getArn());
        this.status = run.getStatus();
        this.result = ExecutionResult.fromValue(run.getResult());
        this.passCount = run.getCounters().getPassed();
        this.warnCount = run.getCounters().getWarned();
        this.failCount = run.getCounters().getFailed();
        this.totalCount = run.getCounters().getTotal();
        this.errorCount = run.getCounters().getErrored();
        this.skipCount = run.getCounters().getSkipped();

        //this.duration =

        try {//from  w ww . j a va2  s.  co m
            this.stopCount = run.getCounters().getStopped();
        } catch (NullPointerException e) {
            // Ignore this until the stopped bug is fixed.
        }

        this.url = AWSDeviceFarmUtils.getRunUrlFromArn(run.getArn());
    }
}

From source file:org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarmTestResultAction.java

License:Open Source License

/**
 * Blocking function which periodically polls the given AWS Device Farm run until its completed. During this waiting period,
 * we will grab the latest results reported by Device Farm and updated our internal result "snapshot" which will be used
 * to populate/inform the UI of test results/progress.
 *
 * @param runResult/*from   w  w  w.  jav  a 2  s  .co  m*/
 */
public void waitForRunCompletion(AWSDeviceFarm adf, ScheduleRunResult runResult) throws InterruptedException {
    while (true) {
        GetRunResult latestRunResult = adf.describeRun(runResult.getRun().getArn());
        Run run = latestRunResult.getRun();
        result = new AWSDeviceFarmTestResult(owner, run);
        writeToLog(String.format("Run %s status %s", run.getName(), run.getStatus()));
        if (result.isCompleted()) {
            break;
        }
        try {
            Thread.sleep(DefaultUpdateInterval);
        } catch (InterruptedException ex) {
            writeToLog(String.format("Thread interrupted while waiting for the Run to complete"));
            throw ex;
        }
    }
}