|
38 | 38 | import java.util.Iterator;
|
39 | 39 | import java.util.Map;
|
40 | 40 | import java.util.concurrent.ExecutionException;
|
| 41 | +import java.util.concurrent.TimeUnit; |
41 | 42 | import java.util.concurrent.atomic.AtomicInteger;
|
42 | 43 |
|
43 | 44 | import org.junit.Ignore;
|
@@ -173,7 +174,7 @@ public void createCollectionWithReplicationFactor() {
|
173 | 174 | @Test
|
174 | 175 | public void createSatelliteCollection() {
|
175 | 176 |
|
176 |
| - if (arangoDB.getVersion().getLicense() == ArangoDBVersion.License.COMMUNITY) { |
| 177 | + if (arangoDB.getVersion().getLicense() == License.COMMUNITY) { |
177 | 178 | LOG.info("Skip Test on COMMUNITY VERSION");
|
178 | 179 | return;
|
179 | 180 | }
|
@@ -247,18 +248,45 @@ public void createCollectionWithSmartJoinAttribute() {
|
247 | 248 | }
|
248 | 249 |
|
249 | 250 | try {
|
250 |
| - |
251 |
| - final CollectionEntity result = db.createCollection(COLLECTION_NAME, new CollectionCreateOptions().smartJoinAttribute("test123")); |
| 251 | + final CollectionEntity result = db.createCollection(COLLECTION_NAME, new CollectionCreateOptions().smartJoinAttribute("test123").shardKeys("_key:")); |
252 | 252 |
|
253 | 253 | assertThat(result, is(notNullValue()));
|
254 | 254 | assertThat(result.getId(), is(notNullValue()));
|
255 | 255 | assertThat(db.collection(COLLECTION_NAME).getProperties().getSmartJoinAttribute(), is("test123"));
|
256 | 256 |
|
| 257 | + } catch (Exception e) { |
| 258 | + System.out.println(e); |
| 259 | + assertTrue(false); |
257 | 260 | } finally {
|
258 |
| - db.collection(COLLECTION_NAME).drop(); |
| 261 | + try { |
| 262 | + db.collection(COLLECTION_NAME).drop(); |
| 263 | + } catch (Exception e) { |
| 264 | + System.out.println(e); |
| 265 | + } |
259 | 266 | }
|
260 | 267 | }
|
261 | 268 |
|
| 269 | + @Test |
| 270 | + public void createCollectionWithSmartJoinAttributeWrong() { |
| 271 | + if (arangoDB.getVersion().getLicense() == License.COMMUNITY) { |
| 272 | + LOG.info("Skip Test on COMMUNITY SERVER"); |
| 273 | + return; |
| 274 | + } |
| 275 | + |
| 276 | + try { |
| 277 | + db.createCollection(COLLECTION_NAME, new CollectionCreateOptions().smartJoinAttribute("test123")); |
| 278 | + } catch (ArangoDBException e) { |
| 279 | + assertThat(e.getErrorNum(), is(4006)); |
| 280 | + assertThat(e.getResponseCode(), is(500)); |
| 281 | + } finally { |
| 282 | + try { |
| 283 | + db.collection(COLLECTION_NAME).drop(); |
| 284 | + assertTrue(false); |
| 285 | + } catch (Exception e) { |
| 286 | + System.out.println(e); |
| 287 | + } |
| 288 | + } |
| 289 | + } |
262 | 290 |
|
263 | 291 | @Test
|
264 | 292 | public void createCollectionWithNumberOfShardsAndShardKey() {
|
|
0 commit comments