Author: rdonkin
Date: Sat Feb 16 06:50:31 2008
New Revision: 628317

URL: http://svn.apache.org/viewvc?rev=628317&view=rev
Log:
Functional test for recent. Recent flag should be retained for the duration of 
the session.

Added:
    
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/Recent.test
Modified:
    
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
    
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java

Modified: 
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java?rev=628317&r1=628316&r2=628317&view=diff
==============================================================================
--- 
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
 (original)
+++ 
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/CreateScript.java
 Sat Feb 16 06:50:31 2008
@@ -23,9 +23,21 @@
 
     public static final void main(String[] args) throws Exception {
         ScriptBuilder builder = ScriptBuilder.open("localhost", 143);
-        multipartMixedMessagesPeek(builder);
+        recent(builder);
     }
     
+    
+    public static void recent(ScriptBuilder builder) throws Exception {
+        builder.login();
+        builder.create();
+        builder.select();
+        builder.append();
+        builder.select();
+        builder.fetchFlags();
+        builder.fetchSection("");
+        builder.fetchFlags();
+        builder.quit();
+    }
 
     public static void multipartMixedMessagesPeek(ScriptBuilder builder) 
throws Exception {
         builder.setPeek(true);

Modified: 
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java?rev=628317&r1=628316&r2=628317&view=diff
==============================================================================
--- 
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
 (original)
+++ 
james/server/trunk/experimental-seda-imap-function/src/test/java/org/apache/james/test/functional/ScriptBuilder.java
 Sat Feb 16 06:50:31 2008
@@ -157,6 +157,12 @@
         command(command);
     }
     
+
+    public void fetchFlags() throws Exception {
+        final String command = "FETCH " + messageNumber + " (FLAGS)";
+        command(command);
+    }
+    
     public void append() throws Exception {
         tag();
         write("APPEND " + mailbox);
@@ -191,7 +197,7 @@
     }
     
     public void logout() throws Exception {
-        
+        command("LOGOUT");
     }
     
     public void quit() throws Exception {

Added: 
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/Recent.test
URL: 
http://svn.apache.org/viewvc/james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/Recent.test?rev=628317&view=auto
==============================================================================
--- 
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/Recent.test
 (added)
+++ 
james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/Recent.test
 Sat Feb 16 06:50:31 2008
@@ -0,0 +1,66 @@
+################################################################
+# 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: A2 CREATE testmailbox
+S: A2 OK Create completed\.
+C: A3 SELECT testmailbox
+S: \* FLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft\)
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft 
\\\*\)\] Flags permitted\.
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* OK \[UIDVALIDITY 1203172345\] UIDs valid
+S: \* OK \[UIDNEXT 1\] Predicted next UID
+S: A3 OK \[READ-WRITE\] SELECT completed\.
+C: A4 APPEND testmailbox {185+}
+C: From: Timothy Tayler <[EMAIL PROTECTED]>
+C: To: Samual Smith <[EMAIL PROTECTED]>
+C: Date: Thu, 14 Feb 2008 12:00:00 +0000 (GMT)
+C: Subject: A Simple Email
+C: 
+C: This is a very simple email.
+C: 
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: A4 OK Append completed\.
+C: A5 SELECT testmailbox
+S: \* FLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft\)
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Flagged \\Deleted \\Seen \\Draft 
\\\*\)\] Flags permitted\.
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: \* OK \[UNSEEN 1\] First unseen\.
+S: \* OK \[UIDVALIDITY 1203172345\] UIDs valid
+S: \* OK \[UIDNEXT 2\] Predicted next UID
+S: A5 OK \[READ-WRITE\] Select completed\.
+C: A6 FETCH 1 (FLAGS)
+S: \* 1 FETCH \(FLAGS \(\\Recent\)\)
+S: A6 OK Fetch completed\.
+C: A7 FETCH 1 (BODY[])
+S: \* 1 FETCH \(FLAGS \(\\Seen \\Recent\) BODY\[\] {185}
+S: From: Timothy Tayler <[EMAIL PROTECTED]>
+S: To: Samual Smith <[EMAIL PROTECTED]>
+S: Date: Thu, 14 Feb 2008 12:00:00 \+0000 \(GMT\)
+S: Subject: A Simple Email
+S: 
+S: This is a very simple email\.
+S: \)
+S: A7 OK Fetch completed\.
+C: A8 FETCH 1 (FLAGS)
+S: \* 1 FETCH \(FLAGS \(\\Seen \\Recent\)\)
+S: A8 OK Fetch completed\.
+C: A9 DELETE testmailbox
+S: A9 OK Delete completed\..
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to