Example usage for com.amazonaws.services.devicefarm.model ScheduleRunRequest withExecutionConfiguration

List of usage examples for com.amazonaws.services.devicefarm.model ScheduleRunRequest withExecutionConfiguration

Introduction

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

Prototype


public ScheduleRunRequest withExecutionConfiguration(ExecutionConfiguration executionConfiguration) 

Source Link

Document

Specifies configuration information about a test run, such as the execution timeout (in minutes).

Usage

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

License:Open Source License

/**
 * Schedule a test run on Device Farm.//from w w w.ja  v  a 2  s .  c  o m
 *
 * @param projectArn    The ARN of the Device Farm project to run the test on.
 * @param name          The name of the test run.
 * @param appArn        The ARN of the app to test.
 * @param devicePoolArn The ARN of the device pool to test against.
 * @param test          The run test.
 * @param configuration The run configuration.
 * @return The result of the schedle run.
 */
public ScheduleRunResult scheduleRun(String projectArn, String name, String appArn, String devicePoolArn,
        ScheduleRunTest test, Integer jobTimeoutMinutes, ScheduleRunConfiguration configuration) {
    ScheduleRunRequest request = new ScheduleRunRequest().withProjectArn(projectArn).withName(name)
            .withDevicePoolArn(devicePoolArn).withTest(test);

    ExecutionConfiguration exeConfiguration = new ExecutionConfiguration();
    if (!jobTimeoutMinutes.equals(DEFAULT_JOB_TIMEOUT_MINUTE)) {
        exeConfiguration.setJobTimeoutMinutes(jobTimeoutMinutes);
        request.withExecutionConfiguration(exeConfiguration);
    }

    if (configuration != null) {
        request.withConfiguration(configuration);
    }

    if (appArn != null) {
        request.withAppArn(appArn);
    }

    return api.scheduleRun(request);
}