|
41 | 41 | import java.util.concurrent.TimeUnit;
|
42 | 42 | import java.util.concurrent.atomic.AtomicInteger;
|
43 | 43 |
|
| 44 | +import org.junit.After; |
| 45 | +import org.junit.Before; |
44 | 46 | import org.junit.Ignore;
|
45 | 47 | import org.junit.Test;
|
46 | 48 | import org.junit.runner.RunWith;
|
@@ -104,6 +106,45 @@ public class ArangoDatabaseTest extends BaseTest {
|
104 | 106 | public ArangoDatabaseTest(final Builder builder) {
|
105 | 107 | super(builder);
|
106 | 108 | }
|
| 109 | + |
| 110 | + @Before |
| 111 | + public void setUp() { |
| 112 | + try { |
| 113 | + ArangoCollection c = db.collection(COLLECTION_NAME); |
| 114 | + c.drop(); |
| 115 | + } catch (final ArangoDBException e) { |
| 116 | + } |
| 117 | + |
| 118 | + try { |
| 119 | + ArangoCollection c = db.collection(COLLECTION_NAME + "1"); |
| 120 | + c.drop(); |
| 121 | + } catch (final ArangoDBException e) { |
| 122 | + } |
| 123 | + |
| 124 | + try { |
| 125 | + ArangoCollection c = db.collection(COLLECTION_NAME + "2"); |
| 126 | + c.drop(); |
| 127 | + } catch (final ArangoDBException e) { |
| 128 | + } |
| 129 | + |
| 130 | + try { |
| 131 | + ArangoCollection c = db.collection(COLLECTION_NAME + "edge"); |
| 132 | + c.drop(); |
| 133 | + } catch (final ArangoDBException e) { |
| 134 | + } |
| 135 | + |
| 136 | + try { |
| 137 | + ArangoCollection c = db.collection(COLLECTION_NAME + "from"); |
| 138 | + c.drop(); |
| 139 | + } catch (final ArangoDBException e) { |
| 140 | + } |
| 141 | + |
| 142 | + try { |
| 143 | + ArangoCollection c = db.collection(COLLECTION_NAME + "to"); |
| 144 | + c.drop(); |
| 145 | + } catch (final ArangoDBException e) { |
| 146 | + } |
| 147 | + } |
107 | 148 |
|
108 | 149 | @Test
|
109 | 150 | public void create() {
|
@@ -469,15 +510,21 @@ public void getCollectionsExcludeSystem() {
|
469 | 510 | try {
|
470 | 511 | final CollectionsReadOptions options = new CollectionsReadOptions().excludeSystem(true);
|
471 | 512 | final Collection<CollectionEntity> systemCollections = db.getCollections(options);
|
| 513 | + |
472 | 514 | assertThat(systemCollections.size(), is(0));
|
473 | 515 | db.createCollection(COLLECTION_NAME + "1", null);
|
474 | 516 | db.createCollection(COLLECTION_NAME + "2", null);
|
475 | 517 | final Collection<CollectionEntity> collections = db.getCollections(options);
|
476 | 518 | assertThat(collections.size(), is(2));
|
477 | 519 | assertThat(collections, is(notNullValue()));
|
| 520 | + } catch (final ArangoDBException e) { |
| 521 | + System.out.println(e.getErrorMessage()); |
478 | 522 | } finally {
|
479 |
| - db.collection(COLLECTION_NAME + "1").drop(); |
| 523 | + try { |
| 524 | + db.collection(COLLECTION_NAME + "1").drop(); |
480 | 525 | db.collection(COLLECTION_NAME + "2").drop();
|
| 526 | + } catch (final ArangoDBException e) { |
| 527 | + } |
481 | 528 | }
|
482 | 529 | }
|
483 | 530 |
|
@@ -684,7 +731,9 @@ public void queryWithBatchSize() {
|
684 | 731 | for (int i = 0; i < 10; i++, cursor.next()) {
|
685 | 732 | assertThat(cursor.hasNext(), is(i != 10));
|
686 | 733 | }
|
687 |
| - |
| 734 | + } catch (final ArangoDBException e) { |
| 735 | + System.out.println(e.getErrorMessage()); |
| 736 | + System.out.println(e.getErrorNum()); |
688 | 737 | } finally {
|
689 | 738 | db.collection(COLLECTION_NAME).drop();
|
690 | 739 | }
|
|
0 commit comments