You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2015/09/22 12:45:23 UTC

svn commit: r1704571 - in /james/mpt/trunk/impl/imap-mailbox: cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/ core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ core/src/main/resources/org/apache/james/imap/scripts/ inmemory...

Author: btellier
Date: Tue Sep 22 10:45:16 2015
New Revision: 1704571

URL: http://svn.apache.org/viewvc?rev=1704571&view=rev
Log:
MPT-26 Running QUOTA commands using MPT on inMemory and cassandra implementation

Added:
    james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java
    james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test
Modified:
    james/mpt/trunk/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java
    james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java

Modified: james/mpt/trunk/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java?rev=1704571&r1=1704570&r2=1704571&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/cassandra/src/test/java/org/apache/james/mpt/imapmailbox/cassandra/CassandraMailboxTest.java Tue Sep 22 10:45:16 2015
@@ -30,6 +30,7 @@ import org.apache.james.mpt.imapmailbox.
 import org.apache.james.mpt.imapmailbox.suite.Listing;
 import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
 import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
+import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
 import org.apache.james.mpt.imapmailbox.suite.Rename;
 import org.apache.james.mpt.imapmailbox.suite.Search;
 import org.apache.james.mpt.imapmailbox.suite.Security;
@@ -63,7 +64,8 @@ import org.junit.runners.Suite;
     SelectedInbox.class,
     SelectedState.class,
     UidSearch.class,
-    UserFlagsSupport.class
+    UserFlagsSupport.class,
+    QuotaTest.class
 })
 @GuiceModules({ CassandraMailboxTestModule.class })
 public class CassandraMailboxTest {

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java?rev=1704571&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java (added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/QuotaTest.java Tue Sep 22 10:45:16 2015
@@ -0,0 +1,42 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mpt.imapmailbox.suite;
+
+import org.apache.james.mpt.api.ImapHostSystem;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseSelectedState;
+import org.junit.Test;
+
+import javax.inject.Inject;
+import java.util.Locale;
+
+public class QuotaTest extends BaseSelectedState {
+
+    @Inject
+    private static ImapHostSystem system;
+
+    public QuotaTest() throws Exception {
+        super(system);
+    }
+
+    @Test
+    public void testQuotaScript() throws Exception {
+        scriptTest("Quota", Locale.CANADA);
+    }
+}

Added: james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test?rev=1704571&view=auto
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test (added)
+++ james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/Quota.test Tue Sep 22 10:45:16 2015
@@ -0,0 +1,97 @@
+################################################################
+# Licensed to the Apache Software Foundation (ASF) under one   #
+# or more contributor license agreements.  See the NOTICE file #
+# distributed with this work for additional information        #
+# regarding copyright ownership.  The ASF licenses this file   #
+# to you under the Apache License, Version 2.0 (the            #
+# "License"); you may not use this file except in compliance   #
+# with the License.  You may obtain a copy of the License at   #
+#                                                              #
+#   http://www.apache.org/licenses/LICENSE-2.0                 #
+#                                                              #
+# Unless required by applicable law or agreed to in writing,   #
+# software distributed under the License is distributed on an  #
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       #
+# KIND, either express or implied.  See the License for the    #
+# specific language governing permissions and limitations      #
+# under the License.                                           #
+################################################################
+
+C: 10 CREATE #private.imapuser.test
+S: 10 OK CREATE completed.
+
+C: A002 SELECT #private.imapuser.test
+S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* OK \[UIDVALIDITY .*\] UIDs valid
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen.*\)\] Limited
+S: \* OK \[HIGHESTMODSEQ \d+\].*
+S: \* OK \[UIDNEXT 1\] Predicted next UID
+S: A002 OK \[READ-WRITE\] SELECT completed\.
+
+C: A003 APPEND #private.imapuser.test {310}
+# Use command continuation request
+S: \+
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <fo...@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B2...@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: A003 OK (\[.+\] )?APPEND completed.
+
+C: A004 APPEND #private.imapuser.test (\Seen) "17-Jul-1996 02:44:25 -0700" {310+}
+# use synchronising literal
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <fo...@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B2...@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 2 EXISTS
+S: \* 2 RECENT
+S: A004 OK (\[.+\] )?APPEND completed.
+
+C: A005 APPEND #private.imapuser.test (\Seen \Draft) "09-Apr-2008 15:17:51 +0200" {310+}
+C: Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)
+C: From: Fred Foobar <fo...@Blurdybloop.COM>
+C: Subject: afternoon meeting 2
+C: To: mooch@owatagu.siam.edu
+C: Message-Id: <B2...@Blurdybloop.COM>
+C: MIME-Version: 1.0
+C: Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
+C:
+C: Hello Joe, could we change that to 4:00pm tomorrow?
+C:
+S: \* 3 EXISTS
+S: \* 3 RECENT
+S: A005 OK (\[.+\] )?APPEND completed.
+
+LOG INFO awaiting commands
+
+C: A006 GETQUOTAROOT #private.imapuser.test
+S: \* QUOTAROOT "#private\.imapuser\.test" #private&imapuser
+S: \* QUOTA #private&imapuser \(MESSAGE 7 4096\)
+S: \* QUOTA #private&imapuser \(STORAGE 1 5242880\)
+S: A006 OK GETQUOTAROOT completed.
+
+C: A007 GETQUOTA #private&imapuser
+# seven because of pre inserted messages for imapuser
+S: \* QUOTA #private&imapuser \(MESSAGE 7 4096\)
+# 1 = 1KB : 254 * 4 + 3 * 310 = 1946 so shrinked to 1KB
+S: \* QUOTA #private&imapuser \(STORAGE 1 5242880\)
+S: A007 OK GETQUOTA completed.
+
+C: A007 SETQUOTA #private&imapuser (MESSAGE 4096) (STORAGE 5242880)
+S: A007 NO SETQUOTA You need the Full admin rights right to perform command SETQUOTA on mailbox Can not perform SETQUOTA commands.
\ No newline at end of file

Modified: james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java?rev=1704571&r1=1704570&r2=1704571&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java (original)
+++ james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/InMemoryMailboxTest.java Tue Sep 22 10:45:16 2015
@@ -18,10 +18,53 @@
  ****************************************************************/
 package org.apache.james.mpt.imapmailbox.inmemory;
 
-import org.apache.james.mpt.imapmailbox.AbstractMailboxTest;
+import org.apache.james.mpt.imapmailbox.suite.AuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.ConcurrentSessions;
+import org.apache.james.mpt.imapmailbox.suite.Events;
+import org.apache.james.mpt.imapmailbox.suite.Expunge;
+import org.apache.james.mpt.imapmailbox.suite.Fetch;
+import org.apache.james.mpt.imapmailbox.suite.FetchBodySection;
+import org.apache.james.mpt.imapmailbox.suite.FetchBodyStructure;
+import org.apache.james.mpt.imapmailbox.suite.FetchHeaders;
+import org.apache.james.mpt.imapmailbox.suite.Listing;
+import org.apache.james.mpt.imapmailbox.suite.NonAuthenticatedState;
+import org.apache.james.mpt.imapmailbox.suite.PartialFetch;
+import org.apache.james.mpt.imapmailbox.suite.QuotaTest;
+import org.apache.james.mpt.imapmailbox.suite.Rename;
+import org.apache.james.mpt.imapmailbox.suite.Search;
+import org.apache.james.mpt.imapmailbox.suite.Security;
+import org.apache.james.mpt.imapmailbox.suite.Select;
+import org.apache.james.mpt.imapmailbox.suite.SelectedInbox;
+import org.apache.james.mpt.imapmailbox.suite.SelectedState;
+import org.apache.james.mpt.imapmailbox.suite.UidSearch;
+import org.apache.onami.test.OnamiSuite;
 import org.apache.onami.test.annotation.GuiceModules;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
 
+@RunWith(OnamiSuite.class)
+@Suite.SuiteClasses({
+    AuthenticatedState.class,
+    ConcurrentSessions.class,
+    Events.class,
+    Expunge.class,
+    Fetch.class,
+    FetchBodySection.class,
+    FetchBodyStructure.class,
+    FetchHeaders.class,
+    Listing.class,
+    NonAuthenticatedState.class,
+    PartialFetch.class,
+    Rename.class,
+    Search.class,
+    Security.class,
+    Select.class,
+    SelectedInbox.class,
+    SelectedState.class,
+    UidSearch.class,
+    QuotaTest.class
+})
 @GuiceModules({ InMemoryMailboxTestModule.class })
-public class InMemoryMailboxTest extends AbstractMailboxTest {
+public class InMemoryMailboxTest {
 
 }



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