james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [04/22] james-project git commit: MAILBOX-350 Avoid closing an already closed CassandraCluster
Date Wed, 21 Nov 2018 10:07:14 GMT
MAILBOX-350 Avoid closing an already closed CassandraCluster

Nested tests resulted in close being called two times, the second one failing...


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

Branch: refs/heads/master
Commit: 20a7ac447094dcc97aaa454eb41d180616836e4c
Parents: 1c62cfc
Author: Benoit Tellier <btellier@linagora.com>
Authored: Tue Nov 20 15:37:45 2018 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Wed Nov 21 16:40:36 2018 +0700

----------------------------------------------------------------------
 .../org/apache/james/backends/cassandra/CassandraCluster.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/20a7ac44/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
----------------------------------------------------------------------
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
index 2db3b16..b6e833f 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
@@ -78,8 +78,10 @@ public final class CassandraCluster implements AutoCloseable {
 
     @Override
     public void close() {
-        clearTables();
-        closeCluster();
+        if (!cluster.isClosed()) {
+            clearTables();
+            closeCluster();
+        }
     }
 
     public void closeCluster() {


---------------------------------------------------------------------
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