Example usage for com.amazonaws.services.devicefarm.model ListJobsResult getJobs

List of usage examples for com.amazonaws.services.devicefarm.model ListJobsResult getJobs

Introduction

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

Prototype


public java.util.List<Job> getJobs() 

Source Link

Document

Information about the jobs.

Usage

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

License:Open Source License

private Map<String, FilePath> getJobs(AWSDeviceFarm adf, ScheduleRunResult run, FilePath resultsDir)
        throws IOException, InterruptedException {
    Map<String, FilePath> jobs = new HashMap<String, FilePath>();
    ListJobsResult result = adf.listJobs(run.getRun().getArn());
    for (Job job : result.getJobs()) {
        String arn = job.getArn().split(":")[6];
        String jobId = arn.substring(arn.lastIndexOf("/") + 1);
        // Two jobs can have same name. Appending Os version information to job name
        String osVersion = null;/*from   w ww  . ja  va2 s  .co  m*/
        if (job.getDevice() != null) {
            osVersion = job.getDevice().getOs();
        }
        jobs.put(arn, new FilePath(resultsDir, job.getName() + "-" + (osVersion != null ? osVersion : jobId)));
        jobs.get(arn).mkdirs();
    }
    return jobs;
}