Skip to content

Commit 840f234

Browse files
committed
reduced test logs
1 parent e1b9661 commit 840f234

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

src/test/java/com/arangodb/StreamTransactionConflictsTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
import com.arangodb.model.DocumentCreateOptions;
2727
import com.arangodb.model.StreamTransactionOptions;
2828
import org.junit.BeforeClass;
29-
import org.junit.Ignore;
3029
import org.junit.Test;
3130
import org.junit.runner.RunWith;
3231
import org.junit.runners.Parameterized;
3332

3433
import java.util.UUID;
3534

35+
import static org.hamcrest.MatcherAssert.assertThat;
36+
import static org.hamcrest.Matchers.is;
3637
import static org.junit.Assert.fail;
3738
import static org.junit.Assume.assumeTrue;
3839

@@ -42,7 +43,7 @@
4243
@RunWith(Parameterized.class)
4344
public class StreamTransactionConflictsTest extends BaseTest {
4445

45-
private static final String COLLECTION_NAME = "db_concurrent_stream_transactions_test";
46+
private static final String COLLECTION_NAME = "db_concurrent_stream_transactions_test-" + UUID.randomUUID();
4647

4748
@BeforeClass
4849
public static void init() {
@@ -78,7 +79,8 @@ public void conflictOnInsertDocumentWithNotYetCommittedTx() {
7879

7980
fail();
8081
} catch (ArangoDBException e) {
81-
e.printStackTrace();
82+
assertThat(e.getResponseCode(), is(409));
83+
assertThat(e.getErrorNum(), is(1200));
8284
}
8385

8486
db.abortStreamTransaction(tx1.getId());
@@ -113,7 +115,8 @@ public void conflictOnInsertDocumentWithAlreadyCommittedTx() {
113115

114116
fail();
115117
} catch (ArangoDBException e) {
116-
e.printStackTrace();
118+
assertThat(e.getResponseCode(), is(409));
119+
assertThat(e.getErrorNum(), is(1200));
117120
}
118121

119122
db.abortStreamTransaction(tx2.getId());

src/test/java/com/arangodb/async/ArangoCollectionTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ public void createGeo2Index() throws ExecutionException, InterruptedException {
916916
}
917917
} catch (InterruptedException | ExecutionException e) {
918918
e.printStackTrace();
919+
fail();
919920
}
920921
}).get();
921922
}

src/test/java/com/arangodb/async/ConcurrencyTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import java.util.stream.Collectors;
3434
import java.util.stream.IntStream;
3535

36+
import static org.junit.Assert.fail;
37+
3638
/**
3739
* @author Michele Rastelli
3840
*/
@@ -69,6 +71,7 @@ public void executorLimit() {
6971
future.get();
7072
} catch (InterruptedException | ExecutionException e) {
7173
e.printStackTrace();
74+
fail();
7275
}
7376
});
7477
}

src/test/java/com/arangodb/async/example/document/ImportDocumentExample.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import java.util.stream.IntStream;
3535
import java.util.stream.Stream;
3636

37+
import static org.junit.Assert.fail;
38+
3739
/**
3840
* @author Michele Rastelli
3941
*/
@@ -76,6 +78,7 @@ public void importDocument() {
7678
cf.get();
7779
} catch (InterruptedException | ExecutionException e) {
7880
e.printStackTrace();
81+
fail();
7982
}
8083
});
8184

0 commit comments

Comments
 (0)