Skip to content

Commit fe4aa00

Browse files
committed
refactor: some dependencies updated included in README. Remove unused code
1 parent 482daaa commit fe4aa00

File tree

4 files changed

+27
-48
lines changed

4 files changed

+27
-48
lines changed

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ The script `executeTests` will launch the tests. The following environment varia
7676
If Appium Server is not specified, will be used "localhost:4723"
7777
$UDID_DEVICE (optional): ID of the device/simulator to execute the tests onto.
7878
This ID could be get by executing `adb devices`
79+
$BACKEND (optional): oCIS or oC10. If not specified, will be used oCIS.
7980

8081
The script needs some parameters. Check help `executeTests -h`
8182

@@ -85,6 +86,7 @@ To execute all tests but the ignored ones (or any other tagged ones):
8586
export UDID_DEVICE=emulator-5554
8687
export OC_SERVER_URL=https://my.owncloud.server
8788
export APPIUM_URL=localhost:4723
89+
export BACKEND=oCIS
8890
./executeTests -t "not @ignore"
8991

9092
The execution will display step by step how the scenario is being executed.
@@ -123,14 +125,14 @@ Also, add in `cucumber.properties` file the following key-values (disabled by de
123125

124126
## Versioning
125127

126-
Up to date: 04/Feb/2025
128+
Up to date: 07/May/2025
127129

128-
|||
129-
|:-- |:-: |
130-
| [Cucumber version](https://cucumber.io/docs/installation/java/) | 7.21.0 |
131-
| [Appium version](https://github.com/appium/appium/releases)| 2.15.0|
132-
| [Appium uiautomator2 driver version](https://github.com/appium/appium-uiautomator2-driver/releases)| 3.10.0|
133-
| [Java client version](https://github.com/appium/java-client/releases) | 9.4.0 |
130+
|| |
131+
|:-- |:------:|
132+
| [Cucumber version](https://cucumber.io/docs/installation/java/) | 7.21.1 |
133+
| [Appium version](https://github.com/appium/appium/releases)| 2.18.0 |
134+
| [Appium uiautomator2 driver version](https://github.com/appium/appium-uiautomator2-driver/releases)| 4.2.3 |
135+
| [Java client version](https://github.com/appium/java-client/releases) | 9.4.0 |
134136

135137
**Note**: This repository was forked from [Cucumber-java
136138
skeleton](https://github.com/cucumber/cucumber-java-skeleton)

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defaultTasks 'clean','test'
22

33
project.ext {
4-
cucumberVersion = '7.21.0'
4+
cucumberVersion = '7.21.1'
55
apacheCommonsExecVersion = '1.3'
66
apacheCommonsLangVersion = '3.9'
77
apacheCommonsTextVersion = '1.9'

src/main/java/android/CommonPage.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -286,5 +286,4 @@ public static void stopRecording(String filename) {
286286
e.printStackTrace();
287287
}
288288
}
289-
290-
}
289+
}

src/main/java/utils/api/GraphAPI.java

+16-38
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import okhttp3.Request;
1313
import okhttp3.RequestBody;
1414
import okhttp3.Response;
15-
import utils.LocProperties;
1615
import utils.entities.OCSpace;
1716
import utils.log.Log;
1817

@@ -50,7 +49,22 @@ public OCSpace getPersonal() throws IOException {
5049
String url = urlServer + graphPath + myDrives;
5150
Request request = getRequest(url);
5251
Response response = httpClient.newCall(request).execute();
53-
return getPersonal(response);
52+
String json = response.body().string();
53+
OCSpace personal = new OCSpace();
54+
JSONObject obj = new JSONObject(json);
55+
JSONArray value = obj.getJSONArray("value");
56+
for (int i = 0; i < value.length(); i++) {
57+
JSONObject jsonObject = value.getJSONObject(i);
58+
String type = jsonObject.getString("driveType");
59+
if (type.equals("personal")) { //Just for user created spaces
60+
personal.setType(jsonObject.getString("driveType"));
61+
personal.setId(jsonObject.getString("id"));
62+
personal.setName(jsonObject.getString("name"));
63+
Log.log(Level.FINE, "Space id returned: " +
64+
personal.getId() + " " + personal.getName());
65+
}
66+
}
67+
return personal;
5468
}
5569

5670
private RequestBody createBodySpace(String name, String description) {
@@ -110,22 +124,6 @@ private Request deleteSpaceRequest(String url) {
110124
return request;
111125
}
112126

113-
private String getUserId(String user) throws IOException {
114-
Log.log(Level.FINE, "GET id OF: " + user);
115-
String url = urlServer + graphPath + "me";
116-
Request request = getRequest(url);
117-
Response response = httpClient.newCall(request).execute();
118-
return getIdFromResponse(response);
119-
}
120-
121-
private String getIdFromResponse(Response httpResponse) throws IOException {
122-
String json = httpResponse.body().string();
123-
JSONObject obj = new JSONObject(json);
124-
String id = obj.getString("id");
125-
Log.log(Level.FINE, "ID of user: " + id);
126-
return id;
127-
}
128-
129127
private String getSpaceIdFromName(String name, String description) throws IOException {
130128
List<OCSpace> mySpaces = getMySpaces();
131129
for (OCSpace space : mySpaces) {
@@ -161,24 +159,4 @@ private List<OCSpace> getSpacesFromResponse(Response httpResponse) throws IOExce
161159
}
162160
return spaces;
163161
}
164-
165-
//Returns personal space. Assuming that there is only one personal space
166-
private OCSpace getPersonal(Response httpResponse) throws IOException {
167-
String json = httpResponse.body().string();
168-
OCSpace personal = new OCSpace();
169-
JSONObject obj = new JSONObject(json);
170-
JSONArray value = obj.getJSONArray("value");
171-
for (int i = 0; i < value.length(); i++) {
172-
JSONObject jsonObject = value.getJSONObject(i);
173-
String type = jsonObject.getString("driveType");
174-
if (type.equals("personal")) { //Just for user created spaces
175-
personal.setType(jsonObject.getString("driveType"));
176-
personal.setId(jsonObject.getString("id"));
177-
personal.setName(jsonObject.getString("name"));
178-
Log.log(Level.FINE, "Space id returned: " +
179-
personal.getId() + " " + personal.getName());
180-
}
181-
}
182-
return personal;
183-
}
184162
}

0 commit comments

Comments
 (0)