Skip to content

Commit

Permalink
Merge pull request #467 from szprutamich/master
Browse files Browse the repository at this point in the history
Version 3.10
  • Loading branch information
szprutamich committed Dec 6, 2022
2 parents 58a1fcc + 2bcbeee commit fe13c93
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 188 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.testdroid</groupId>
<artifactId>testdroid-api</artifactId>
<version>3.9</version>
<version>3.10</version>
<packaging>jar</packaging>
<name>Bitbar API v2</name>
<url>https://github.com/bitbar/testdroid-api</url>
Expand All @@ -12,7 +12,7 @@
<jacoco-maven-plugin.skip>true</jacoco-maven-plugin.skip>
<!-- disable default deployment -->
<maven.deploy.skip>true</maven.deploy.skip>
<org.springframework.boot.spring-boot-dependencies>2.7.4</org.springframework.boot.spring-boot-dependencies>
<org.springframework.boot.spring-boot-dependencies>2.7.5</org.springframework.boot.spring-boot-dependencies>
<org.apache.commons.collections4.version>4.4</org.apache.commons.collections4.version>
<org.apache.commons.io.version>2.11.0</org.apache.commons.io.version>
<commons-text.version>1.10.0</commons-text.version>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/testdroid/api/filter/FilterEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Collection;
import java.util.Objects;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -125,7 +125,8 @@ private String valueToString(Object value) {
return singleToString(value);
case Integer.MAX_VALUE:
default:
return ((List<?>) value).stream().map(this::singleToString).collect(Collectors.joining(ARG_DELIMITER));
return ((Collection<?>) value).stream().map(this::singleToString)
.collect(Collectors.joining(ARG_DELIMITER));
}
}

Expand All @@ -134,7 +135,7 @@ private void validate() {
throw new IllegalArgumentException("Operand does not accept any value");
}
if (StringUtils.isBlank(rawValue) && operand.getArity().equals(Integer.MAX_VALUE)) {
throw new IllegalArgumentException("Operand requires a list of values");
throw new IllegalArgumentException("Operand requires a collection of values");
}
}

Expand Down
18 changes: 3 additions & 15 deletions src/main/java/com/testdroid/api/model/APIAdminTestRun.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ public class APIAdminTestRun extends APIEntity {

private Date endTime;

private Boolean appCrawlerRun;

private APITestRun.State state;

private Float successRatio;
Expand Down Expand Up @@ -71,12 +69,11 @@ public APIAdminTestRun(

public APIAdminTestRun(
Long id, LocalDateTime createTime, LocalDateTime startTime, LocalDateTime 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) {
Long startedById, String userName, String projectName, String testRunName, 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;
}

Expand Down Expand Up @@ -128,14 +125,6 @@ public void setCreateTime(Date createTime) {
this.createTime = createTime;
}

public Boolean getAppCrawlerRun() {
return appCrawlerRun;
}

public void setAppCrawlerRun(Boolean appCrawlerRun) {
this.appCrawlerRun = appCrawlerRun;
}

public String getUserName() {
return userName;
}
Expand Down Expand Up @@ -228,7 +217,6 @@ protected <T extends APIEntity> void clone(T from) {
this.state = apiAdminTestRun.state;
this.projectName = apiAdminTestRun.projectName;
this.testRunName = apiAdminTestRun.testRunName;
this.appCrawlerRun = apiAdminTestRun.appCrawlerRun;
this.successRatio = apiAdminTestRun.successRatio;
this.priority = apiAdminTestRun.priority;
this.projectId = apiAdminTestRun.projectId;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/testdroid/api/model/APIFramework.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class APIFramework extends APIEntity {

@XmlType(namespace = "APIFramework")
public enum Type {
APP_CRAWLER,
@Deprecated APP_CRAWLER,
CLIENT_SIDE,
MANUAL,
REMOTE
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/com/testdroid/api/model/APITestRunConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public enum Scheduler {
ALL_INSTANCES
}

private boolean appCrawlerRun;

private String appiumBrokerAddress;

private String appiumBrokerQueueName;
Expand Down Expand Up @@ -151,14 +149,6 @@ public void setScheduler(Scheduler scheduler) {
this.scheduler = scheduler;
}

public boolean isAppCrawlerRun() {
return appCrawlerRun;
}

public void setAppCrawlerRun(boolean appCrawlerRun) {
this.appCrawlerRun = appCrawlerRun;
}

public LimitationType getLimitationType() {
return limitationType;
}
Expand Down Expand Up @@ -524,7 +514,6 @@ public void setTunnelSettings(APITunnelSettings tunnelSettings) {
protected <T extends APIEntity> void clone(T from) {
APITestRunConfig apiTestRunConfig = (APITestRunConfig) from;
cloneBase(from);
this.appCrawlerRun = apiTestRunConfig.appCrawlerRun;
this.appiumBrokerAddress = apiTestRunConfig.appiumBrokerAddress;
this.appiumBrokerQueueName = apiTestRunConfig.appiumBrokerQueueName;
this.applicationPassword = apiTestRunConfig.applicationPassword;
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions src/main/java/com/testdroid/api/util/TimeConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ public static Date toDate(LocalDateTime localDateTime) {
return localDateTime == null ? null : Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
}

public static long toTimestamp(LocalDateTime localDateTime) {
return localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() / 1000L;
}

public static long toMilli(LocalDateTime localDateTime) {
return localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.testdroid.api.model.devicetime.APIDeviceTimeCountSessionReportEntry;
import com.testdroid.api.model.devicetime.APIDeviceTimeStepTimeReportEntry;
import com.testdroid.api.model.notification.APINotification;
import com.testdroid.api.model.notification.APINotificationPlan;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -61,7 +60,6 @@ public class TypeReferenceFactory {
LIST_MAP.put(APILabelGroup.class, new TypeReference<APIList<APILabelGroup>>() {});
LIST_MAP.put(APILicense.class, new TypeReference<APIList<APILicense>>() {});
LIST_MAP.put(APINotification.class, new TypeReference<APIList<APINotification>>() {});
LIST_MAP.put(APINotificationPlan.class, new TypeReference<APIList<APINotificationPlan>>() {});
LIST_MAP.put(APIProject.class, new TypeReference<APIList<APIProject>>() {});
LIST_MAP.put(APIProjectJobConfig.class, new TypeReference<APIList<APIProjectJobConfig>>() {});
LIST_MAP.put(APIProperty.class, new TypeReference<APIList<APIProperty>>() {});
Expand Down Expand Up @@ -134,7 +132,6 @@ public class TypeReferenceFactory {
MAP.put(APIMaintenance.class, new TypeReference<APIMaintenance>() {});
MAP.put(APIMessage.class, new TypeReference<APIMessage>() {});
MAP.put(APINotification.class, new TypeReference<APINotification>() {});
MAP.put(APINotificationPlan.class, new TypeReference<APINotificationPlan>() {});
MAP.put(APIProject.class, new TypeReference<APIProject>() {});
MAP.put(APIProjectJobConfig.class, new TypeReference<APIProjectJobConfig>() {});
MAP.put(APIProperty.class, new TypeReference<APIProperty>() {});
Expand Down

0 comments on commit fe13c93

Please sign in to comment.