james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [8/9] james-project git commit: JAMES-2589 Some swift test were unstable
Date Wed, 28 Nov 2018 10:46:40 GMT
JAMES-2589 Some swift test were unstable

This is ver likely due to a timeout due to future handling


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/0999a0a3
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/0999a0a3
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/0999a0a3

Branch: refs/heads/master
Commit: 0999a0a3cab057182129c19e0ba5f7818f6389d8
Parents: f378162
Author: Benoit Tellier <btellier@linagora.com>
Authored: Wed Nov 28 15:31:28 2018 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Wed Nov 28 17:18:55 2018 +0700

----------------------------------------------------------------------
 .../ObjectStorageBlobsDAOContract.java            | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/0999a0a3/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
index 4c0a935..e113cb5 100644
--- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
+++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
@@ -24,25 +24,23 @@ import static org.assertj.core.api.Assertions.assertThat;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 
 import org.apache.james.blob.api.BlobId;
 
 
 public interface ObjectStorageBlobsDAOContract {
 
+    byte[] BYTES = "content".getBytes(StandardCharsets.UTF_8);
+
     ContainerName containerName();
 
-    default void assertBlobsDAOCanStoreAndRetrieve(ObjectStorageBlobsDAOBuilder.ReadyToBuild
builder)
-        throws InterruptedException, ExecutionException, TimeoutException {
+    default void assertBlobsDAOCanStoreAndRetrieve(ObjectStorageBlobsDAOBuilder.ReadyToBuild
builder) {
         ObjectStorageBlobsDAO dao = builder.build();
         dao.createContainer(containerName());
-        byte[] bytes = "content".getBytes(StandardCharsets.UTF_8);
-        CompletableFuture<BlobId> save = dao.save(bytes);
-        InputStream inputStream = save.thenApply(dao::read).get(10, TimeUnit.SECONDS);
-        assertThat(inputStream).hasSameContentAs(new ByteArrayInputStream(bytes));
+
+        BlobId blobId = dao.save(BYTES).join();
+
+        InputStream inputStream = dao.read(blobId);
+        assertThat(inputStream).hasSameContentAs(new ByteArrayInputStream(BYTES));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message