Skip to content

Commit c02859c

Browse files
author
mpv1989
committed
Add enterprise test
1 parent 2e3724c commit c02859c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@
3636
import org.junit.Before;
3737
import org.junit.Test;
3838

39+
import com.arangodb.entity.ArangoDBVersion.License;
3940
import com.arangodb.entity.CollectionType;
4041
import com.arangodb.entity.EdgeDefinition;
4142
import com.arangodb.entity.GraphEntity;
4243
import com.arangodb.model.CollectionCreateOptions;
44+
import com.arangodb.model.GraphCreateOptions;
4345

4446
/**
4547
* @author Mark - mark at arangodb.com
@@ -192,4 +194,21 @@ public void removeEdgeDefinition() throws InterruptedException, ExecutionExcepti
192194
assertThat(edgeDefinitions.size(), is(1));
193195
assertThat(edgeDefinitions.iterator().next().getCollection(), is(EDGE_COL_2));
194196
}
197+
198+
@Test
199+
public void smartGraph() throws InterruptedException, ExecutionException {
200+
if (arangoDB.getVersion().get().getLicense() == License.ENTERPRISE) {
201+
teardown();
202+
final Collection<EdgeDefinition> edgeDefinitions = new ArrayList<>();
203+
edgeDefinitions.add(new EdgeDefinition().collection(EDGE_COL_1).from(VERTEX_COL_1).to(VERTEX_COL_2));
204+
edgeDefinitions
205+
.add(new EdgeDefinition().collection(EDGE_COL_2).from(VERTEX_COL_2).to(VERTEX_COL_1, VERTEX_COL_3));
206+
final GraphEntity graph = db.createGraph(GRAPH_NAME, edgeDefinitions,
207+
new GraphCreateOptions().isSmart(true).smartGraphAttribute("test").numberOfShards(2)).get();
208+
assertThat(graph, is(notNullValue()));
209+
assertThat(graph.getIsSmart(), is(true));
210+
assertThat(graph.getSmartGraphAttribute(), is("test"));
211+
assertThat(graph.getNumberOfShards(), is(2));
212+
}
213+
}
195214
}

0 commit comments

Comments
 (0)