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

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

Introduction

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

Prototype


public ScheduleRunRequest withConfiguration(ScheduleRunConfiguration configuration) 

Source Link

Document

Information about the settings for the run to be scheduled.

Usage

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

License:Open Source License

/**
 * Schedule a test run on Device Farm./*  ww  w  .  j ava2  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);
}