Example usage for com.amazonaws.services.devicefarm.model Job getDevice

List of usage examples for com.amazonaws.services.devicefarm.model Job getDevice

Introduction

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

Prototype


public Device getDevice() 

Source Link

Document

The device (phone or tablet).

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