Skip to content

Commit 20bb618

Browse files
committed
Added project
1 parent 7a84106 commit 20bb618

30 files changed

+3141
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.class
2+
3+
target
4+
build
5+
6+
# IntelliJ
7+
*.iml
8+
.idea
9+
10+
# Package Files #
11+
*.jar
12+
*.war
13+
*.ear
14+
15+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
16+
hs_err_pid*

pom.xml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.browserstack</groupId>
8+
<artifactId>automate-client-java</artifactId>
9+
<name>automate-client</name>
10+
<version>0.1-SNAPSHOT</version>
11+
<packaging>jar</packaging>
12+
13+
<licenses>
14+
<license>
15+
<name>MIT</name>
16+
<url>https://opensource.org/licenses/MIT</url>
17+
</license>
18+
</licenses>
19+
20+
<developers>
21+
<developer>
22+
<name>BrowserStack</name>
23+
<email>[email protected]</email>
24+
<organization>BrowserStack</organization>
25+
<organizationUrl>https://www.browserstack.com</organizationUrl>
26+
</developer>
27+
</developers>
28+
29+
<distributionManagement>
30+
<snapshotRepository>
31+
<id>ossrh</id>
32+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
33+
</snapshotRepository>
34+
</distributionManagement>
35+
36+
<properties>
37+
<jackson.version>2.1.0</jackson.version>
38+
<junit.version>4.12</junit.version>
39+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
40+
<maven.compiler.source>1.5</maven.compiler.source>
41+
<maven.compiler.target>1.5</maven.compiler.target>
42+
</properties>
43+
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.apache.maven.plugins</groupId>
48+
<artifactId>maven-compiler-plugin</artifactId>
49+
<version>3.5.1</version>
50+
<configuration>
51+
<source>1.5</source>
52+
<target>1.5</target>
53+
</configuration>
54+
</plugin>
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-source-plugin</artifactId>
58+
<version>2.2.1</version>
59+
<executions>
60+
<execution>
61+
<id>attach-sources</id>
62+
<goals>
63+
<goal>jar-no-fork</goal>
64+
</goals>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-javadoc-plugin</artifactId>
71+
<version>2.10.3</version>
72+
<executions>
73+
<execution>
74+
<id>attach-javadocs</id>
75+
<goals>
76+
<goal>jar</goal>
77+
</goals>
78+
</execution>
79+
</executions>
80+
</plugin>
81+
<plugin>
82+
<groupId>org.sonatype.plugins</groupId>
83+
<artifactId>nexus-staging-maven-plugin</artifactId>
84+
<version>1.6.7</version>
85+
<extensions>true</extensions>
86+
<configuration>
87+
<serverId>ossrh</serverId>
88+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
89+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
90+
</configuration>
91+
</plugin>
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-gpg-plugin</artifactId>
95+
<version>1.6</version>
96+
<executions>
97+
<execution>
98+
<id>sign-artifacts</id>
99+
<phase>verify</phase>
100+
<goals>
101+
<goal>sign</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
</plugins>
107+
</build>
108+
109+
<dependencies>
110+
<dependency>
111+
<groupId>com.google.http-client</groupId>
112+
<artifactId>google-http-client</artifactId>
113+
<version>1.21.0</version>
114+
<exclusions>
115+
<exclusion>
116+
<groupId>org.apache.httpcomponents</groupId>
117+
<artifactId>httpclient</artifactId>
118+
</exclusion>
119+
</exclusions>
120+
</dependency>
121+
122+
<dependency>
123+
<groupId>org.json</groupId>
124+
<artifactId>json</artifactId>
125+
<version>20160212</version>
126+
</dependency>
127+
128+
<dependency>
129+
<groupId>com.fasterxml.jackson.core</groupId>
130+
<artifactId>jackson-core</artifactId>
131+
<version>${jackson.version}</version>
132+
</dependency>
133+
134+
<dependency>
135+
<groupId>com.fasterxml.jackson.core</groupId>
136+
<artifactId>jackson-databind</artifactId>
137+
<version>${jackson.version}</version>
138+
</dependency>
139+
140+
<dependency>
141+
<groupId>junit</groupId>
142+
<artifactId>junit</artifactId>
143+
<version>${junit.version}</version>
144+
<scope>test</scope>
145+
</dependency>
146+
</dependencies>
147+
148+
</project>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package com.browserstack.automate;
2+
3+
import com.browserstack.automate.exception.AutomateException;
4+
import com.browserstack.automate.exception.BuildNotFound;
5+
import com.browserstack.automate.exception.ProjectNotFound;
6+
import com.browserstack.automate.exception.SessionNotFound;
7+
import com.browserstack.automate.model.AccountUsage;
8+
import com.browserstack.automate.model.Build;
9+
import com.browserstack.automate.model.Project;
10+
import com.browserstack.automate.model.Session;
11+
import com.browserstack.client.model.Browser;
12+
13+
import java.util.List;
14+
import java.util.Map;
15+
16+
public interface Automate {
17+
18+
AccountUsage getAccountUsage() throws AutomateException;
19+
20+
List<Browser> getBrowsers() throws AutomateException;
21+
22+
List<Browser> getBrowsers(boolean cache) throws AutomateException;
23+
24+
List<Project> getProjects() throws AutomateException;
25+
26+
Project getProject(int projectId) throws ProjectNotFound, AutomateException;
27+
28+
boolean deleteProject(int projectId) throws AutomateException;
29+
30+
List<Build> getBuilds(BuildStatus status, int limit) throws AutomateException;
31+
32+
List<Build> getBuilds(int limit) throws AutomateException;
33+
34+
List<Build> getBuilds(BuildStatus status) throws AutomateException;
35+
36+
List<Build> getBuilds() throws AutomateException;
37+
38+
Build getBuild(String buildId) throws BuildNotFound, AutomateException;
39+
40+
boolean deleteBuild(String buildId) throws AutomateException;
41+
42+
List<Session> getSessions(String buildId, BuildStatus status,
43+
int limit) throws BuildNotFound, AutomateException;
44+
45+
List<Session> getSessions(String buildId) throws BuildNotFound, AutomateException;
46+
47+
List<Session> getSessions(String buildId, int limit) throws BuildNotFound, AutomateException;
48+
49+
List<Session> getSessions(String buildId, BuildStatus status) throws BuildNotFound, AutomateException;
50+
51+
Session getSession(String sessionId) throws SessionNotFound, AutomateException;
52+
53+
Session updateSessionStatus(String sessionId, Map<String, Object> data) throws AutomateException;
54+
55+
Session updateSessionStatus(String sessionId,
56+
SessionStatus sessionStatus,
57+
String reason) throws SessionNotFound, AutomateException;
58+
59+
Session updateSessionStatus(String sessionId,
60+
SessionStatus sessionStatus) throws SessionNotFound, AutomateException;
61+
62+
String getSessionLogs(String sessionId) throws SessionNotFound, AutomateException;
63+
64+
String getSessionLogs(Session session) throws AutomateException;
65+
66+
String getSessionVideo(String sessionId) throws SessionNotFound, AutomateException;
67+
68+
boolean deleteSession(String sessionId) throws SessionNotFound, AutomateException;
69+
70+
String recycleKey() throws AutomateException;
71+
72+
73+
enum BuildStatus {
74+
RUNNING, DONE, FAILED
75+
}
76+
77+
enum SessionStatus {
78+
DONE, ERROR
79+
}
80+
}

0 commit comments

Comments
 (0)