Skip to content

Commit 32716a9

Browse files
author
Mark
committed
fixed tests
1 parent af98ae6 commit 32716a9

File tree

3 files changed

+16
-278
lines changed

3 files changed

+16
-278
lines changed

src/test/java/com/arangodb/A.java

Lines changed: 0 additions & 269 deletions
This file was deleted.

src/test/java/com/arangodb/example/document/AqlQueryWithSpecialReturnTypesExample.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private static void createExamples() throws InterruptedException, ExecutionExcep
6666
}
6767

6868
@Test
69-
public void aqlWithLimitQueryAsVPackObject() {
69+
public void aqlWithLimitQueryAsVPackObject() throws InterruptedException, ExecutionException {
7070
final String query = "FOR t IN " + COLLECTION_NAME
7171
+ " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN t";
7272
final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
@@ -83,10 +83,11 @@ public void aqlWithLimitQueryAsVPackObject() {
8383
}
8484
});
8585
});
86+
f.get();
8687
}
8788

8889
@Test
89-
public void aqlWithLimitQueryAsVPackArray() {
90+
public void aqlWithLimitQueryAsVPackArray() throws InterruptedException, ExecutionException {
9091
final String query = "FOR t IN " + COLLECTION_NAME
9192
+ " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN [t.name, t.gender, t.age]";
9293
final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
@@ -100,12 +101,12 @@ public void aqlWithLimitQueryAsVPackArray() {
100101
assertThat(vpack.get(2).getAsInt(), isOneOf(21, 23, 25, 27, 29));
101102
});
102103
});
103-
104+
f.get();
104105
}
105106

106107
@Test
107108
@SuppressWarnings("rawtypes")
108-
public void aqlWithLimitQueryAsMap() {
109+
public void aqlWithLimitQueryAsMap() throws InterruptedException, ExecutionException {
109110
final String query = "FOR t IN " + COLLECTION_NAME
110111
+ " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN t";
111112
final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
@@ -122,11 +123,12 @@ public void aqlWithLimitQueryAsMap() {
122123
assertThat(Long.valueOf(map.get("age").toString()), isOneOf(21L, 23L, 25L, 27L, 29L));
123124
});
124125
});
126+
f.get();
125127
}
126128

127129
@Test
128130
@SuppressWarnings("rawtypes")
129-
public void aqlWithLimitQueryAsList() {
131+
public void aqlWithLimitQueryAsList() throws InterruptedException, ExecutionException {
130132
final String query = "FOR t IN " + COLLECTION_NAME
131133
+ " FILTER t.age >= 20 && t.age < 30 && t.gender == @gender RETURN [t.name, t.gender, t.age]";
132134
final Map<String, Object> bindVars = new MapBuilder().put("gender", Gender.FEMALE).get();
@@ -143,5 +145,6 @@ public void aqlWithLimitQueryAsList() {
143145
assertThat(Long.valueOf(String.valueOf(list.get(2))), isOneOf(21L, 23L, 25L, 27L, 29L));
144146
});
145147
});
148+
f.get();
146149
}
147150
}

src/test/java/com/arangodb/example/document/GetDocumentExample.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,42 +53,46 @@ public static void before() throws InterruptedException, ExecutionException {
5353
}
5454

5555
@Test
56-
public void getAsBean() {
56+
public void getAsBean() throws InterruptedException, ExecutionException {
5757
final CompletableFuture<TestEntity> f = collection.getDocument(key, TestEntity.class);
5858
f.whenComplete((doc, ex) -> {
5959
assertThat(doc, is(notNullValue()));
6060
assertThat(doc.getFoo(), is("bar"));
6161
});
62+
f.get();
6263
}
6364

6465
@Test
65-
public void getAsBaseDocument() {
66+
public void getAsBaseDocument() throws InterruptedException, ExecutionException {
6667
final CompletableFuture<BaseDocument> f = collection.getDocument(key, BaseDocument.class);
6768
f.whenComplete((doc, ex) -> {
6869
assertThat(doc, is(notNullValue()));
6970
assertThat(doc.getAttribute("foo"), is(notNullValue()));
7071
assertThat(String.valueOf(doc.getAttribute("foo")), is("bar"));
7172
});
73+
f.get();
7274
}
7375

7476
@Test
75-
public void getAsVPack() {
77+
public void getAsVPack() throws InterruptedException, ExecutionException {
7678
final CompletableFuture<VPackSlice> f = collection.getDocument(key, VPackSlice.class);
7779
f.whenComplete((doc, ex) -> {
7880
assertThat(doc, is(notNullValue()));
7981
assertThat(doc.get("foo").isString(), is(true));
8082
assertThat(doc.get("foo").getAsString(), is("bar"));
8183
});
84+
f.get();
8285
}
8386

8487
@Test
85-
public void getAsJson() throws ParseException {
88+
public void getAsJson() throws ParseException, InterruptedException, ExecutionException {
8689
final CompletableFuture<String> f = collection.getDocument(key, String.class);
8790
f.whenComplete((doc, ex) -> {
8891
assertThat(doc, is(notNullValue()));
8992
assertThat(doc.contains("foo"), is(true));
9093
assertThat(doc.contains("bar"), is(true));
9194
});
95+
f.get();
9296
}
9397

9498
}

0 commit comments

Comments
 (0)