Skip to content

Commit 204e940

Browse files
authored
Merge pull request #258 from arangodb/bug-fix/added-server-license-method-for-tests
added getLicense method, fixed enterprise only test
2 parents 5b83371 + 4018c55 commit 204e940

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1313

1414
### Added
1515

16-
- add smartJoinAttribute and shardingStrategy
16+
- added smartJoinAttribute and shardingStrategy collection attributes
1717

1818
## [5.0.4] - 2019-18-01
1919

src/main/java/com/arangodb/ArangoDB.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ public synchronized ArangoDB build() {
711711
* @throws ArangoDBException
712712
*/
713713
ServerRole getRole() throws ArangoDBException;
714-
714+
715715
/**
716716
* Create a new user. This user will not have access to any database. You need permission to the _system database in
717717
* order to execute this call.

src/main/java/com/arangodb/internal/ArangoDBImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
/**
6262
* @author Mark Vollmary
63+
* @author Heiko Kernbach
6364
*
6465
*/
6566
public class ArangoDBImpl extends InternalArangoDB<ArangoExecutorSync> implements ArangoDB {
@@ -193,7 +194,7 @@ public ArangoDBVersion getVersion() throws ArangoDBException {
193194
public ServerRole getRole() throws ArangoDBException {
194195
return executor.execute(getRoleRequest(), getRoleResponseDeserializer());
195196
}
196-
197+
197198
@Override
198199
public UserEntity createUser(final String user, final String passwd) throws ArangoDBException {
199200
return executor.execute(createUserRequest(db().name(), user, passwd, new UserCreateOptions()),

src/main/java/com/arangodb/internal/InternalArangoDB.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,16 @@
4646

4747
/**
4848
* @author Mark Vollmary
49+
* @author Heiko Kernbach
4950
*
5051
*/
5152
public abstract class InternalArangoDB<E extends ArangoExecutor> extends ArangoExecuteable<E> {
5253

53-
private static final String PATH_API_ADMIN_LOG = "/_admin/log";
54-
private static final String PATH_API_ADMIN_LOG_LEVEL = "/_admin/log/level";
55-
private static final String PATH_API_ROLE = "/_admin/server/role";
56-
protected static final String PATH_ENDPOINTS = "/_api/cluster/endpoints";
57-
private static final String PATH_API_USER = "/_api/user";
54+
private static final String PATH_API_ADMIN_LOG = "/_admin/log";
55+
private static final String PATH_API_ADMIN_LOG_LEVEL = "/_admin/log/level";
56+
private static final String PATH_API_ROLE = "/_admin/server/role";
57+
protected static final String PATH_ENDPOINTS = "/_api/cluster/endpoints";
58+
private static final String PATH_API_USER = "/_api/user";
5859

5960
protected InternalArangoDB(final E executor, final ArangoSerializationFactory util, final ArangoContext context) {
6061
super(executor, util, context);
@@ -72,7 +73,7 @@ public ServerRole deserialize(final Response response) throws VPackException {
7273
}
7374
};
7475
}
75-
76+
7677
protected Request createDatabaseRequest(final String name) {
7778
final Request request = request(ArangoRequestParam.SYSTEM, RequestType.POST,
7879
InternalArangoDatabase.PATH_API_DATABASE);

src/test/java/com/arangodb/ArangoDatabaseTest.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,26 @@ public void createCollectionWithReplicationFactor() {
172172

173173
@Test
174174
public void createSatelliteCollection() {
175+
176+
if (arangoDB.getVersion().getLicense() == ArangoDBVersion.License.COMMUNITY) {
177+
LOG.info("Skip Test on COMMUNITY VERSION");
178+
return;
179+
}
180+
175181
if (arangoDB.getRole() == ServerRole.SINGLE) {
182+
LOG.info("Skip Test on SINGLE SERVER");
176183
return;
177184
}
185+
178186
try {
179-
final CollectionEntity result = db.createCollection(COLLECTION_NAME,
180-
new CollectionCreateOptions().satellite(true));
187+
188+
final CollectionEntity result = db.createCollection(COLLECTION_NAME, new CollectionCreateOptions().satellite(true));
189+
181190
assertThat(result, is(notNullValue()));
182191
assertThat(result.getId(), is(notNullValue()));
183192
assertThat(db.collection(COLLECTION_NAME).getProperties().getReplicationFactor(), is(nullValue()));
184193
assertThat(db.collection(COLLECTION_NAME).getProperties().getSatellite(), is(true));
194+
185195
} finally {
186196
db.collection(COLLECTION_NAME).drop();
187197
}

0 commit comments

Comments
 (0)