james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [02/13] james-project git commit: JAMES-1874 MailboxId should be returned upon mailbox creation
Date Mon, 20 Feb 2017 09:08:46 GMT
JAMES-1874 MailboxId should be returned upon mailbox creation


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

Branch: refs/heads/master
Commit: 45dfd9084172ccb1cfcc9e9fc52e2c59e1ff71f0
Parents: 1fa1cd8
Author: Benoit Tellier <btellier@linagora.com>
Authored: Mon Feb 13 09:46:07 2017 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Mon Feb 20 16:05:39 2017 +0700

----------------------------------------------------------------------
 .../org/apache/james/mailbox/MailboxManager.java   |  6 +++++-
 .../apache/james/mailbox/MailboxManagerTest.java   | 17 ++++++++++++++++-
 .../mailbox/caching/CachingMailboxMapper.java      |  4 ++--
 .../cassandra/mail/CassandraMailboxMapper.java     |  3 ++-
 .../mailbox/hbase/mail/HBaseMailboxMapper.java     |  3 ++-
 .../james/mailbox/jcr/mail/JCRMailboxMapper.java   |  3 ++-
 .../james/mailbox/jpa/mail/JPAMailboxMapper.java   |  3 ++-
 .../jpa/mail/TransactionalMailboxMapper.java       | 10 +++++-----
 .../mailbox/maildir/mail/MaildirMailboxMapper.java |  5 +++--
 .../inmemory/mail/InMemoryMailboxMapper.java       |  3 ++-
 .../james/mailbox/store/StoreMailboxManager.java   |  9 +++++++--
 .../james/mailbox/store/mail/MailboxMapper.java    |  2 +-
 .../store/TestMailboxSessionMapperFactory.java     |  2 +-
 .../processor/base/MailboxEventAnalyserTest.java   |  3 ++-
 ...faultMailboxesProvisioningFilterThreadTest.java |  6 +++++-
 15 files changed, 57 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
index 0cf3e1a..3fcd03e 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/MailboxManager.java
@@ -42,6 +42,8 @@ import org.apache.james.mailbox.model.MultimailboxesSearchQuery;
 import org.apache.james.mailbox.model.SimpleMailboxACL;
 import org.slf4j.Logger;
 
+import com.google.common.base.Optional;
+
 /**
  * <p>
  * Central MailboxManager which creates, lists, provides, renames and deletes
@@ -152,8 +154,10 @@ public interface MailboxManager extends RequestAware, MailboxListenerSupport
{
      *            the context for this call, not null
      * @throws MailboxException
      *             when creation fails
+     * @return Empty optional when the name is empty. If mailbox is created, the id of the
mailboxPath specified as
+     *  parameter is returned (and not potential mailboxIds of parent mailboxes created in
the process will be omitted)
      */
-    void createMailbox(MailboxPath mailboxPath, MailboxSession mailboxSession) throws MailboxException;
+    Optional<MailboxId> createMailbox(MailboxPath mailboxPath, MailboxSession mailboxSession)
throws MailboxException;
 
     /**
      * Delete the mailbox with the name

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
index 9986712..8024f26 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
@@ -35,6 +35,7 @@ import org.apache.james.mailbox.mock.MockMailboxManager;
 import org.apache.james.mailbox.model.MailboxAnnotation;
 import org.apache.james.mailbox.model.MailboxAnnotationKey;
 import org.apache.james.mailbox.model.MailboxConstants;
+import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxMetaData;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.model.MailboxQuery;
@@ -47,6 +48,7 @@ import org.xenei.junit.contract.Contract;
 import org.xenei.junit.contract.ContractTest;
 import org.xenei.junit.contract.IProducer;
 
+import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 
@@ -114,7 +116,20 @@ public class MailboxManagerTest<T extends MailboxManager> {
         MailboxPath inbox = MailboxPath.inbox(session);
         assertThat(mailboxManager.mailboxExists(inbox, session)).isFalse();
     }
-    
+
+    @ContractTest
+    public void createMailboxShouldReturnRightId() throws MailboxException, UnsupportedEncodingException
{
+        session = mailboxManager.createSystemSession(USER_1, LoggerFactory.getLogger("Mock"));
+        mailboxManager.startProcessingRequest(session);
+
+        MailboxPath mailboxPath = new MailboxPath(MailboxConstants.USER_NAMESPACE, USER_1,
"name.subfolder");
+        Optional<MailboxId> mailboxId = mailboxManager.createMailbox(mailboxPath, session);
+        MessageManager retrievedMailbox = mailboxManager.getMailbox(mailboxPath, session);
+
+        assertThat(mailboxId.isPresent()).isTrue();
+        assertThat(mailboxId.get()).isEqualTo(retrievedMailbox.getId());
+    }
+
     @ContractTest
     public void user1ShouldBeAbleToCreateInbox() throws MailboxException, UnsupportedEncodingException
{
         session = mailboxManager.createSystemSession(USER_1, LoggerFactory.getLogger("Mock"));

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
index c311b1d..2c326c4 100644
--- a/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
+++ b/mailbox/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java
@@ -55,9 +55,9 @@ public class CachingMailboxMapper implements MailboxMapper {
 	}
 
 	@Override
-	public void save(Mailbox mailbox) throws MailboxException {
+	public MailboxId save(Mailbox mailbox) throws MailboxException {
 		invalidate(mailbox);
-		underlying.save(mailbox);
+		return underlying.save(mailbox);
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
index 6662aef..6850dcb 100644
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
+++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java
@@ -122,7 +122,7 @@ public class CassandraMailboxMapper implements MailboxMapper {
     }
 
     @Override
-    public void save(Mailbox mailbox) throws MailboxException {
+    public MailboxId save(Mailbox mailbox) throws MailboxException {
         Preconditions.checkArgument(mailbox instanceof SimpleMailbox);
         SimpleMailbox cassandraMailbox = (SimpleMailbox) mailbox;
 
@@ -164,6 +164,7 @@ public class CassandraMailboxMapper implements MailboxMapper {
             }
             throw e;
         }
+        return cassandraId;
     }
 
     private CassandraId retrieveId(SimpleMailbox cassandraMailbox) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
index 8c89e9d..874175d 100644
--- a/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
+++ b/mailbox/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java
@@ -252,7 +252,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements
M
     }
     
     @Override
-    public void save(Mailbox mlbx) throws MailboxException {
+    public MailboxId save(Mailbox mlbx) throws MailboxException {
         //TODO: maybe switch to checkAndPut for transactions
         HTable mailboxes = null;
         try {
@@ -262,6 +262,7 @@ public class HBaseMailboxMapper extends HBaseNonTransactionalMapper implements
M
              */
             Put put = toPut((HBaseMailbox) mlbx);
             mailboxes.put(put);
+            return mlbx.getMailboxId();
         } catch (IOException ex) {
             throw new MailboxException("IOExeption", ex);
         } finally {

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
index c546a8c..761a2ac 100644
--- a/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
+++ b/mailbox/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRMailboxMapper.java
@@ -159,7 +159,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements
Mailbo
      * org.apache.james.mailbox.store.mail.MailboxMapper#save(org.apache.james.
      * imap.store.mail.model.Mailbox)
      */
-    public void save(Mailbox mailbox) throws MailboxException {
+    public MailboxId save(Mailbox mailbox) throws MailboxException {
         
         try {
             final JCRMailbox jcrMailbox = (JCRMailbox)mailbox;
@@ -191,6 +191,7 @@ public class JCRMailboxMapper extends AbstractJCRScalingMapper implements
Mailbo
            } else {
                jcrMailbox.merge(node);
            }
+           return jcrMailbox.getMailboxId();
             
         } catch (RepositoryException e) {
             throw new MailboxException("Unable to save mailbox " + mailbox, e);

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
index 7fe207a..0183789 100644
--- a/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
+++ b/mailbox/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAMailboxMapper.java
@@ -74,7 +74,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements
MailboxM
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#save(Mailbox)
      */
-    public void save(Mailbox mailbox) throws MailboxException {
+    public MailboxId save(Mailbox mailbox) throws MailboxException {
         try {
             this.lastMailboxName = mailbox.getName();
             JPAMailbox persistedMailbox = JPAMailbox.from(mailbox);
@@ -82,6 +82,7 @@ public class JPAMailboxMapper extends JPATransactionalMapper implements
MailboxM
             if (!(mailbox instanceof JPAMailbox)) {
                 mailbox.setMailboxId(persistedMailbox.getMailboxId());
             }
+            return mailbox.getMailboxId();
         } catch (PersistenceException e) {
             throw new MailboxException("Save of mailbox " + mailbox.getName() +" failed",
e);
         } 

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
b/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
index 2d2e366..c01a4f2 100644
--- a/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
+++ b/mailbox/jpa/src/test/java/org/apache/james/mailbox/jpa/mail/TransactionalMailboxMapper.java
@@ -50,16 +50,16 @@ public class TransactionalMailboxMapper implements MailboxMapper {
     }
 
     @Override
-    public void save(final Mailbox mailbox) throws MailboxException {
+    public MailboxId save(final Mailbox mailbox) throws MailboxException {
         try {
-            wrapped.execute(new VoidTransaction() {
+            return wrapped.execute(new Transaction<MailboxId>() {
                 @Override
-                public void runVoid() throws MailboxException {
-                    wrapped.save(mailbox);
+                public MailboxId run() throws MailboxException {
+                    return wrapped.save(mailbox);
                 }
             });
         } catch (MailboxException e) {
-            Throwables.propagate(e);
+            throw Throwables.propagate(e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
index 73c02d3..a59ab1f 100644
--- a/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
+++ b/mailbox/maildir/src/main/java/org/apache/james/mailbox/maildir/mail/MaildirMailboxMapper.java
@@ -160,7 +160,7 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements
Mail
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#save(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
     @Override
-    public void save(Mailbox mailbox) throws MailboxException {
+    public MailboxId save(Mailbox mailbox) throws MailboxException {
         try {
             Mailbox originalMailbox = getCachedMailbox((MaildirId) mailbox.getMailboxId());
             MaildirFolder folder = maildirStore.createMaildirFolder(mailbox);
@@ -229,7 +229,8 @@ public class MaildirMailboxMapper extends NonTransactionalMapper implements
Mail
             }
             folder.setACL(session, mailbox.getACL());
         }
-        
+        cacheMailbox(mailbox);
+        return mailbox.getMailboxId();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
index 3862b68..7372975 100644
--- a/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
+++ b/mailbox/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryMailboxMapper.java
@@ -109,13 +109,14 @@ public class InMemoryMailboxMapper implements MailboxMapper {
     /**
      * @see org.apache.james.mailbox.store.mail.MailboxMapper#save(org.apache.james.mailbox.store.mail.model.Mailbox)
      */
-    public void save(Mailbox mailbox) throws MailboxException {
+    public MailboxId save(Mailbox mailbox) throws MailboxException {
         InMemoryId id = (InMemoryId) mailbox.getMailboxId();
         if (id == null) {
             id = InMemoryId.of(mailboxIdGenerator.incrementAndGet());
             ((SimpleMailbox) mailbox).setMailboxId(id);
         }
         mailboxesById.put(id, mailbox);
+        return mailbox.getMailboxId();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
index e426ebb..87c3cfa 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
@@ -84,8 +84,10 @@ import org.apache.james.mailbox.store.transaction.Mapper;
 import org.apache.james.mailbox.store.transaction.TransactionalMapper;
 import org.slf4j.Logger;
 
+import com.google.common.base.Optional;
 import com.google.common.base.Predicate;
 import com.google.common.collect.FluentIterable;
+import com.google.common.collect.Iterables;
 
 /**
  * This base class of an {@link MailboxManager} implementation provides a high-level api
for writing your own
@@ -523,7 +525,7 @@ public class StoreMailboxManager implements MailboxManager {
     }
 
     @Override
-    public void createMailbox(MailboxPath mailboxPath, final MailboxSession mailboxSession)
+    public Optional<MailboxId> createMailbox(MailboxPath mailboxPath, final MailboxSession
mailboxSession)
             throws MailboxException {
         mailboxSession.getLog().debug("createMailbox " + mailboxPath);
         final int length = mailboxPath.getName().length();
@@ -537,6 +539,7 @@ public class StoreMailboxManager implements MailboxManager {
             // Create parents first
             // If any creation fails then the mailbox will not be created
             // TODO: transaction
+            final List<MailboxId> mailboxIds = new ArrayList<MailboxId>();
             for (final MailboxPath mailbox : mailboxPath.getHierarchyLevels(getDelimiter()))
 
                 locker.executeWithLock(mailboxSession, mailbox, new LockAwareExecution<Void>()
{
@@ -548,7 +551,7 @@ public class StoreMailboxManager implements MailboxManager {
                             mapper.execute(new TransactionalMapper.VoidTransaction() {
 
                                 public void runVoid() throws MailboxException {
-                                    mapper.save(m);
+                                    mailboxIds.add(mapper.save(m));
                                 }
 
                             });
@@ -561,7 +564,9 @@ public class StoreMailboxManager implements MailboxManager {
                     }
                 }, true);
 
+            return Optional.fromNullable(Iterables.getLast(mailboxIds));
         }
+        return Optional.absent();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
index f46a2f8..f737328 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/MailboxMapper.java
@@ -41,7 +41,7 @@ public interface MailboxMapper extends Mapper {
      * @param mailbox
      * @throws MailboxException
      */
-    void save(Mailbox mailbox) throws MailboxException;
+    MailboxId save(Mailbox mailbox) throws MailboxException;
     
     /**
      * Delete the given {@link Mailbox} from the underlying storage

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
index 98e51f4..d7e70bd 100644
--- a/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
+++ b/mailbox/store/src/test/java/org/apache/james/mailbox/store/TestMailboxSessionMapperFactory.java
@@ -86,7 +86,7 @@ public class TestMailboxSessionMapperFactory extends MailboxSessionMapperFactory
 
         mailboxMapper = new MailboxMapper() {
             @Override
-            public void save(Mailbox mailbox) throws MailboxException {
+            public MailboxId save(Mailbox mailbox) throws MailboxException {
                 throw new NotImplementedException();
             }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
index 74a5b27..5c53a8f 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
@@ -78,6 +78,7 @@ import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
 import org.junit.Test;
 import org.slf4j.Logger;
 
+import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableList;
 
 public class MailboxEventAnalyserTest {
@@ -340,7 +341,7 @@ public class MailboxEventAnalyserTest {
             throw new UnsupportedOperationException("Not implemented");
         }
         
-        public void createMailbox(MailboxPath mailboxPath, MailboxSession mailboxSession)
throws MailboxException {
+        public Optional<MailboxId> createMailbox(MailboxPath mailboxPath, MailboxSession
mailboxSession) throws MailboxException {
             throw new UnsupportedOperationException("Not implemented");
         }
         

http://git-wip-us.apache.org/repos/asf/james-project/blob/45dfd908/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java
b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java
index abcd91c..c486baa 100644
--- a/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java
+++ b/server/protocols/jmap/src/test/java/org/apache/james/jmap/DefaultMailboxesProvisioningFilterThreadTest.java
@@ -22,6 +22,7 @@ import java.util.EnumSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.commons.lang.NotImplementedException;
 import org.apache.james.mailbox.MailboxListener;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
@@ -42,9 +43,11 @@ import org.apache.james.mailbox.model.MailboxQuery;
 import org.apache.james.mailbox.model.MessageId;
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.MultimailboxesSearchQuery;
+import org.apache.james.mailbox.model.TestId;
 import org.junit.Test;
 import org.slf4j.Logger;
 
+import com.google.common.base.Optional;
 import com.google.testing.threadtester.AnnotatedTestRunner;
 import com.google.testing.threadtester.ThreadedAfter;
 import com.google.testing.threadtester.ThreadedBefore;
@@ -137,7 +140,8 @@ public class DefaultMailboxesProvisioningFilterThreadTest {
         }
 
         @Override
-        public void createMailbox(MailboxPath mailboxPath, MailboxSession mailboxSession)
throws MailboxException {
+        public Optional<MailboxId> createMailbox(MailboxPath mailboxPath, MailboxSession
mailboxSession) throws MailboxException {
+            return Optional.of(TestId.of(18L));
         }
 
         @Override


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