Skip to content

Commit

Permalink
Merge pull request #331 from szprutamich/master
Browse files Browse the repository at this point in the history
Version 2.54
  • Loading branch information
snieguu authored Feb 19, 2018
2 parents 06f11f4 + eacbd3b commit 5fda727
Show file tree
Hide file tree
Showing 30 changed files with 180 additions and 74 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.testdroid</groupId>
<artifactId>testdroid-api</artifactId>
<version>2.53</version>
<version>2.54</version>
<packaging>jar</packaging>
<name>Testdroid API v2</name>
<url>https://github.com/bitbar/testdroid-api</url>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/testdroid/api/APIEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.fasterxml.jackson.annotation.JsonView;
import com.testdroid.api.model.*;
import com.testdroid.api.model.jrjc.*;
import com.testdroid.api.model.APIFileConfig;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/testdroid/api/APIFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public String serialize() {

public static class APIFilterItem {

public static enum Operand {
public enum Operand {
GT,
AFTER,
LT,
Expand All @@ -48,7 +48,7 @@ public static enum Operand {
AFTERORNULL
}

public static enum Type {
public enum Type {
N,
D,
S,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/testdroid/api/APISort.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
*/
public class APISort {

public static enum Type {
public enum Type {
ASC("a"),
DESC("d");

private String urlValue;

private Type(String urlValue) {
Type(String urlValue) {
this.urlValue = urlValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class APIAccountService extends APIEntity {

@XmlType(namespace = "APIAccountService")
public static enum DeactivateReason {
public enum DeactivateReason {
INITIAL_FAILURE,
CHARGE_FAILURE,
CANCEL,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/model/APIActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class APIActivity extends APIEntity {

@XmlType(namespace = "APIActivity")
public static enum HttpMethod {
public enum HttpMethod {
GET,
HEAD,
POST,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/testdroid/api/model/APIAdminDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
public class APIAdminDevice extends APIEntity {

@XmlType(namespace = "APIAdminDevice")
public static enum InitStep {
public enum InitStep {
SKIP,
REBOOT,
REBOOT_WITH_UNLOCK,
UNLOCK_ONLY
}

@XmlType(namespace = "APIAdminDevice")
public static enum State {
public enum State {
ONLINE,
OFFLINE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class APIAdminDeviceProblemPair extends APIEntity {

@XmlType(namespace = "APIAdminDeviceProblemPair", name = "APIAdminDeviceProblemPairType")
public static enum Type {
public enum Type {
OFFLINE,
LOW_BATTERY,
HIGH_FAIL_RATE,
Expand Down
18 changes: 13 additions & 5 deletions src/main/java/com/testdroid/api/model/APIAdminTestRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ public APIAdminTestRun() {

public APIAdminTestRun(
Long id, Date createTime, Date startTime, Date endTime, APITestRun.State state, Long startedById,
String userName, String projectName, String testRunName, Boolean appCrawlerRun, Float successRatio,
Integer priority, Long projectId, Long duration, APITestRunConfig.Scheduler scheduler, Long frameworkId,
String frameworkName) {
String userName, String projectName, String testRunName, Float successRatio, Integer priority,
Long projectId, Long duration, Long frameworkId, String frameworkName) {
super(id);
this.createTime = createTime;
this.startTime = startTime;
Expand All @@ -60,16 +59,25 @@ public APIAdminTestRun(
this.userName = userName;
this.projectName = projectName;
this.testRunName = testRunName;
this.appCrawlerRun = appCrawlerRun;
this.successRatio = successRatio;
this.priority = priority;
this.projectId = projectId;
this.duration = duration;
this.scheduler = scheduler;
this.frameworkId = frameworkId;
this.frameworkName = frameworkName;
}

public APIAdminTestRun(
Long id, Date createTime, Date startTime, Date endTime, APITestRun.State state, Long startedById,
String userName, String projectName, String testRunName, Boolean appCrawlerRun, Float successRatio,
Integer priority, Long projectId, Long duration, APITestRunConfig.Scheduler scheduler, Long frameworkId,
String frameworkName) {
this(id, createTime, startTime, endTime, state, startedById, userName, projectName, testRunName,
successRatio, priority, projectId, duration, frameworkId, frameworkName);
this.appCrawlerRun = appCrawlerRun;
this.scheduler = scheduler;
}

public Date getEndTime() {
return endTime;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/model/APICluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class APICluster extends APIEntity {

@XmlType(namespace = "APICluster", name = "APIClusterState")
public static enum State {
public enum State {
OFFLINE,
ONLINE
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/testdroid/api/model/APIDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ public class APIDevice extends APIEntity {

@XmlType
@Deprecated
public static enum DeviceFilter {
public enum DeviceFilter {
FREE,
RECOMMENDED,
NEW
}

@XmlType
public static enum DeviceGroupOrigin {
public enum DeviceGroupOrigin {
STATIC,
DYNAMIC,
HYBRID
}

@XmlType(namespace = "APIDevice")
public static enum OsType {
public enum OsType {
IOS("iOS"),
ANDROID("Android"),
UNDEFINED("Undefined");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class APIDeviceModelCriterion extends APIEntity {

@XmlType(namespace = "APIDeviceModelCriterion")
public static enum Field {
public enum Field {
NAME,
FINGERPRINT,
SERIAL_ID,
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/testdroid/api/model/APIDeviceSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
public class APIDeviceSession extends APIEntity {

@XmlType(namespace = "APIDeviceSession")
public static enum Type {
public enum Type {
MANUAL,
AUTOMATIC
}

@XmlType(namespace = "APIDeviceSession")
public static enum RetryState {
public enum RetryState {
NONE,
MANUAL,
AUTO
}

@XmlType(namespace = "APIDeviceSession")
public static enum State {
public enum State {
ABORTED,
EXCLUDED,
FAILED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public class APIDeviceSessionDataAvailability extends APIEntity {
public APIDeviceSessionDataAvailability() {
}

public APIDeviceSessionDataAvailability(Long deviceRunId) {
this.deviceRunId = deviceRunId;
}

public APIDeviceSessionDataAvailability(
Long deviceRunId, boolean logs, boolean performance, boolean screenshots,
boolean buildLogs, boolean resultsDataZip) {
Expand Down
24 changes: 16 additions & 8 deletions src/main/java/com/testdroid/api/model/APIFileConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
* @author Michał Szpruta <[email protected]>
*/
@XmlRootElement
public class APIFileConfig extends APIEntity {
public class APIFileConfig extends APIEntity implements Serializable {

private static final long serialVersionUID = 1L;

@XmlType(namespace = "APIFileConfig")
public static enum Action {
public enum Action {
COPY_TO_DEVICE,
INSTALL,
RUN_TEST
Expand All @@ -25,11 +28,16 @@ public static enum Action {

private List<Action> availableActions = Arrays.asList(Action.values());

private List<APIUserFileTag> tags;
private APIUserFile file;

public APIFileConfig() {
}

public APIFileConfig(Long id, Action action) {
super(id);
this.action = action;
}

public Action getAction() {
return action;
}
Expand All @@ -46,12 +54,12 @@ public void setAvailableActions(List<Action> availableActions) {
this.availableActions = availableActions;
}

public List<APIUserFileTag> getTags() {
return tags;
public APIUserFile getFile() {
return file;
}

public void setTags(List<APIUserFileTag> tags) {
this.tags = tags;
public void setFile(APIUserFile file) {
this.file = file;
}

@Override
Expand All @@ -60,7 +68,7 @@ protected <T extends APIEntity> void clone(T from) {
APIFileConfig original = (APIFileConfig) from;
cloneBase(original);
this.action = original.action;
this.tags = original.tags;
this.availableActions = original.availableActions;
this.file = original.file;
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/model/APILicense.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class APILicense extends APIEntity {


@XmlType(namespace = "APILicense")
public static enum Status {
public enum Status {
ACTIVE,
EXPIRED,
INACTIVE
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/model/APIMarketShare.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class APIMarketShare extends APIEntity {

@XmlType(namespace = "APIMarketShare")
public static enum Type {
public enum Type {
ANDROID_VERSION,
IOS_VERSION,
OPEN_GL_VERSION
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/testdroid/api/model/APIProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
public class APIProject extends APIEntity {

@XmlType(namespace = "APIProject")
public static enum APIArchivingStrategy {
public enum APIArchivingStrategy {
NEVER,
DAYS,
RUNS
}

@XmlType(namespace = "APIProject")
public static enum Type {
public enum Type {
ANDROID(OsType.ANDROID, APIProjectJobConfig.Type.DEFAULT, "Android Instrumentation"),
IOS(OsType.IOS, APIProjectJobConfig.Type.APPCRAWLER_IOS, "AppCrawler iOS"),
UIAUTOMATOR(OsType.ANDROID, APIProjectJobConfig.Type.UIAUTOMATOR, "Android UIAutomator"),
Expand All @@ -50,7 +50,7 @@ public static enum Type {

private String title;

private Type(OsType osType, APIProjectJobConfig.Type jobConfigType, String title) {
Type(OsType osType, APIProjectJobConfig.Type jobConfigType, String title) {
this.osType = osType;
this.jobConfigType = jobConfigType;
this.title = title;
Expand Down Expand Up @@ -420,7 +420,7 @@ public APITestRun runWithConfig(
Long dataFileId) throws APIException {
Map<String, Object> body = new HashMap<>();
body.put("scheduler", config.getScheduler() != null ? config.getScheduler().name() : null);
body.put("appCrawlerRun", config.getAppCrawlerRun());
body.put("appCrawlerRun", config.isAppCrawlerRun());
body.put("autoScreenshots", config.isAutoScreenshots());
body.put("screenshotDir", config.getScreenshotDir());
body.put("limitationType", config.getLimitationType() != null ? config.getLimitationType().name() : null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class APIProjectJobConfig extends APIEntity {

@XmlType(namespace = "APIProjectJobConfig")
public static enum Type {
public enum Type {
DEFAULT(APIDevice.OsType.ANDROID, "Android instrumentation"),
INSTATEST(APIDevice.OsType.ANDROID, "Android App Crawler"),
INTERACTIVE(APIDevice.OsType.ANDROID, "Testdroid Interactive"),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/model/APIScreenshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class APIScreenshot extends APIEntity {

@XmlType(namespace = "APIScreenshot")
public static enum Type {
public enum Type {
LANDSCAPE,
PORTRAIT
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class APIServicePaymentStatus {

@XmlType(name = "APIServicePaymentStatus")
public static enum Status {
public enum Status {
SUCCEEDED,
FAILED,
REDIRECTED
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/model/APITestCaseRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class APITestCaseRun extends APIEntity {

@XmlType(namespace = "APITestCaseRun")
public static enum Result {
public enum Result {
PASSED,
FAILED,
SKIPPED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class APITestCaseRunStep extends APIEntity {

@XmlType(namespace = "APITestCaseRunStep")
public static enum Type {
public enum Type {
ASSERTION,
CLICK,
CONFIG,
Expand Down
Loading

0 comments on commit 5fda727

Please sign in to comment.