james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r682038 [1/2] - in /james/server/trunk/experimental-seda-imap-function/src/test: java/org/apache/james/test/functional/ resources/org/apache/james/test/functional/imap/scripts/
Date Sat, 02 Aug 2008 19:29:39 GMT
Author: rdonkin
Date: Sat Aug  2 12:29:38 2008
New Revision: 682038

URL: http://svn.apache.org/viewvc?rev=682038&view=rev
Log:
More tests for RFC FETCH

Added:
    james/server/trunk/experimental-seda-imap-function/src/test/resources/org/apache/james/test/functional/imap/scripts/FetchRfcMixed.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=682038&r1=682037&r2=682038&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 Aug  2 12:29:38 2008
@@ -35,7 +35,42 @@
 
     public static final void main(String[] args) throws Exception {
         ScriptBuilder builder = ScriptBuilder.open("localhost", 143);
-        bodyStructureEmbedded(builder);
+        rfcFetch(builder);
+    }
+    
+    public static void rfcFetch(ScriptBuilder builder) throws Exception {
+        try {
+            setup(builder);
+            builder.append();
+            builder.setFile("wild-example.mail");
+            builder.append();
+            builder.setFile("multipart-alt.mail");
+            builder.append();
+            builder.setFile("multipart-mixed-complex.mail");
+            builder.append();
+            builder.setFile("rfc822-hello-world.mail");
+            builder.append();
+            builder.setFile("wild-mixed-alt.mail");
+            builder.append();
+            builder.setFile("wild-mixed.mail");
+            builder.append();
+            builder.setFile("rfc822-resent.mail");
+            builder.append();
+            builder.setFile("rfc822-trace.mail");
+            builder.append();
+            builder.setFile("wild-alt-reply4.mail");
+            builder.append();
+            builder.resetFetch().setRfc822Size(true);
+            builder.fetchAllMessages();
+            builder.resetFetch().setRfc(true);
+            builder.fetchAllMessages();
+            builder.resetFetch().setRfcHeaders(true);
+            builder.fetchAllMessages();
+            builder.resetFetch().setRfcText(true);
+            builder.fetchAllMessages();
+        } finally {
+            builder.quit();
+        }
     }
     
     public static void bodyStructureEmbedded(ScriptBuilder builder) throws Exception {

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=682038&r1=682037&r2=682038&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 Aug  2 12:29:38 2008
@@ -866,6 +866,9 @@
         
         private boolean flagsFetch = false;
         private boolean rfc822Size = false;
+        private boolean rfc = false;
+        private boolean rfcText = false;
+        private boolean rfcHeaders = false;
         private boolean internalDate = false;
         private boolean uid = false;
         private String body = null;
@@ -925,6 +928,33 @@
             return this;
         }
         
+        public final boolean isRfc() {
+            return rfc;
+        }
+
+        public final Fetch setRfc(boolean rfc) {
+            this.rfc = rfc;
+            return this;
+        }
+
+        public final boolean isRfcHeaders() {
+            return rfcHeaders;
+        }
+
+        public final Fetch setRfcHeaders(boolean rfcHeaders) {
+            this.rfcHeaders = rfcHeaders;
+            return this;
+        }
+
+        public final boolean isRfcText() {
+            return rfcText;
+        }
+
+        public final Fetch setRfcText(boolean rfcText) {
+            this.rfcText = rfcText;
+            return this;
+        }
+
         public final boolean isInternalDate() {
             return internalDate;
         }
@@ -992,6 +1022,15 @@
             if (rfc822Size) {
                 first = add(buffer, first, "RFC822.SIZE");
             }
+            if (rfc) {
+                first = add(buffer, first, "RFC822");
+            }
+            if (rfcHeaders) {
+                first = add(buffer, first, "RFC822.HEADER");
+            }
+            if (rfcText) {
+                first = add(buffer, first, "RFC822.TEXT");
+            }
             if (internalDate) {
                 first = add(buffer, first, "INTERNALDATE");
             }
@@ -1255,7 +1294,7 @@
                                         "OK Logged in",
                                         "LOGOUT"};
         
-        private final CharBuffer lineBuffer = CharBuffer.allocate(65536);
+        private final CharBuffer lineBuffer = CharBuffer.allocate(131072);
         private boolean isClient = false;
         public void client() {
             lineBuffer.put("C: ");



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