Skip to content

Commit c2111a9

Browse files
author
mpv1989
committed
Fix tests
1 parent c69344c commit c2111a9

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/test/java/com/arangodb/ArangoGraphTest.java

+19-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ public ArangoGraphTest(final Builder builder) {
6666
}
6767

6868
public void setup() {
69+
try {
70+
db.graph(GRAPH_NAME).drop();
71+
} catch (final ArangoDBException e1) {
72+
}
6973
for (final String collection : new String[] { VERTEX_COL_1, VERTEX_COL_2, VERTEX_COL_2, VERTEX_COL_3,
7074
VERTEX_COL_4 }) {
7175
try {
@@ -141,6 +145,7 @@ public void addVertexCollection() {
141145
assertThat(graph, is(notNullValue()));
142146
final Collection<String> vertexCollections = db.graph(GRAPH_NAME).getVertexCollections();
143147
assertThat(vertexCollections, hasItems(VERTEX_COL_1, VERTEX_COL_2, VERTEX_COL_3, VERTEX_COL_4));
148+
setup();
144149
}
145150

146151
@Test
@@ -171,6 +176,7 @@ public void addEdgeDefinition() {
171176
assertThat(e.getTo(), hasItem(VERTEX_COL_2));
172177
}
173178
}
179+
setup();
174180
}
175181

176182
@Test
@@ -192,6 +198,7 @@ public void replaceEdgeDefinition() {
192198
assertThat(e.getTo(), hasItem(VERTEX_COL_4));
193199
}
194200
}
201+
setup();
195202
}
196203

197204
@Test
@@ -200,12 +207,23 @@ public void removeEdgeDefinition() {
200207
final Collection<EdgeDefinition> edgeDefinitions = graph.getEdgeDefinitions();
201208
assertThat(edgeDefinitions.size(), is(1));
202209
assertThat(edgeDefinitions.iterator().next().getCollection(), is(EDGE_COL_2));
210+
setup();
203211
}
204212

205213
@Test
206214
public void smartGraph() {
207215
if (arangoDB.getVersion().getLicense() == License.ENTERPRISE) {
208-
teardown();
216+
for (final String collection : new String[] { EDGE_COL_1, EDGE_COL_2, VERTEX_COL_1, VERTEX_COL_2,
217+
VERTEX_COL_3, VERTEX_COL_4 }) {
218+
try {
219+
db.collection(collection).drop();
220+
} catch (final ArangoDBException e) {
221+
}
222+
}
223+
try {
224+
db.graph(GRAPH_NAME).drop();
225+
} catch (final ArangoDBException e) {
226+
}
209227
final Collection<EdgeDefinition> edgeDefinitions = new ArrayList<EdgeDefinition>();
210228
edgeDefinitions.add(new EdgeDefinition().collection(EDGE_COL_1).from(VERTEX_COL_1).to(VERTEX_COL_2));
211229
edgeDefinitions

0 commit comments

Comments
 (0)