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 er...@apache.org on 2010/12/21 09:02:32 UTC

svn commit: r1051407 - in /james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox: MailboxManagerTest.java mock/MockMail.java

Author: eric
Date: Tue Dec 21 08:02:32 2010
New Revision: 1051407

URL: http://svn.apache.org/viewvc?rev=1051407&view=rev
Log:
Use MockMail to avoid parsing warnings.

Added:
    james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/mock/MockMail.java
Modified:
    james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java

Modified: james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java?rev=1051407&r1=1051406&r2=1051407&view=diff
==============================================================================
--- james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java (original)
+++ james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java Tue Dec 21 08:02:32 2010
@@ -32,6 +32,7 @@ import org.apache.james.mailbox.MailboxM
 import org.apache.james.mailbox.MailboxPath;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageManager;
+import org.apache.james.mailbox.mock.MockMail;
 import org.junit.Test;
 
 /**
@@ -97,7 +98,7 @@ public abstract class MailboxManagerTest
             getMailboxManager().createMailbox(mailboxPath, mailboxSession);
             messageManager = getMailboxManager().getMailbox(mailboxPath, mailboxSession);
             for (int j=0; j < MESSAGE_PER_MAILBOX_COUNT; j++) {
-                messageManager.appendMessage(new ByteArrayInputStream(new String("fake message" + i).getBytes("UTF-8")), 
+                messageManager.appendMessage(new ByteArrayInputStream(MockMail.MAIL_TEXT_PLAIN.getBytes("UTF-8")), 
                         Calendar.getInstance().getTime(), 
                         mailboxSession, 
                         true, 

Added: james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/mock/MockMail.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/mock/MockMail.java?rev=1051407&view=auto
==============================================================================
--- james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/mock/MockMail.java (added)
+++ james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/mock/MockMail.java Tue Dec 21 08:02:32 2010
@@ -0,0 +1,33 @@
+/****************************************************************
+ * 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.mailbox.mock;
+
+public class MockMail {
+    
+    public static final String MAIL_TEXT_PLAIN = "Date: Mon, 7 Feb 1994 21:52:25 -0800 (PST)\n" +
+                                "From: Fred Foobar <fo...@Blurdybloop.COM>\n" +
+                                "Subject: Test 03\n" +
+                                "To: mooch@owatagu.siam.edu\n" +
+                                "Message-Id: <B2...@Blurdybloop.COM>\n" +
+                                "MIME-Version: 1.0\n" +
+                                "Content-Type: TEXT/PLAIN; CHARSET=US-ASCII\n" +
+                                "\n" +
+                                "Mock Mail\n";
+
+}



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