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

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

Introduction

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

Prototype


public String getName() 

Source Link

Document

The run's name.

Usage

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  ww .java  2  s.c o 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;
        }
    }
}