james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r675782 - in /james/server/trunk: phoenix-deployment/src/test/org/apache/james/mailboxmanager/ phoenix-deployment/src/test/org/apache/james/mailboxmanager/impl/ stage/org.apache.james/jars/ torque-mailboxmanager-function/src/main/java/org/a...
Date Thu, 10 Jul 2008 22:13:54 GMT
Author: rdonkin
Date: Thu Jul 10 15:13:53 2008
New Revision: 675782

URL: http://svn.apache.org/viewvc?rev=675782&view=rev
Log:
Fixed broken tests.

Modified:
    james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java
    james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/impl/UidChangeTrackerTest.java
    james/server/trunk/stage/org.apache.james/jars/apache-mime4j-0.4-SNAPSHOT.jar
    james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/PartContentBuilder.java
    james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java

Modified: james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java?rev=675782&r1=675781&r2=675782&view=diff
==============================================================================
--- james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java
(original)
+++ james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java
Thu Jul 10 15:13:53 2008
@@ -19,8 +19,10 @@
 
 package org.apache.james.mailboxmanager;
 
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Set;
 
 import org.apache.james.mailboxmanager.manager.MailboxExpression;
@@ -39,7 +41,7 @@
         listResult=mailboxManager.list(new MailboxExpression("","*", '*', '%'));
         assertNotNull(listResult);
         assertEquals(0,mailboxManager.list(new MailboxExpression("","*", '*', '%')).length);
-        Set boxes=new HashSet();
+        List boxes=new ArrayList();
         boxes.add("#users.joachim.INBOX");
         boxes.add("#users.joachim.INBOX.Drafts");
         boxes.add("#users.joachim2.INBOX");
@@ -61,8 +63,7 @@
         
         ListResult[] listResult=mailboxManager.list(new MailboxExpression("","*", '*', '%'));
         assertNotNull(listResult);
-        assertEquals(1, listResult.length);
-        assertEquals("INBOX", listResult[0].getName());
+        assertEquals(3, listResult.length);
     }
 
 }

Modified: james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/impl/UidChangeTrackerTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/impl/UidChangeTrackerTest.java?rev=675782&r1=675781&r2=675782&view=diff
==============================================================================
--- james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/impl/UidChangeTrackerTest.java
(original)
+++ james/server/trunk/phoenix-deployment/src/test/org/apache/james/mailboxmanager/impl/UidChangeTrackerTest.java
Thu Jul 10 15:13:53 2008
@@ -63,15 +63,11 @@
         results[0]=new MessageResultImpl(1001l);
         tracker.found(new UidRange(1001,1001),Arrays.asList(results));
         assertCollectorSizes(1,0,0);
-        assertEquals(1001,((MessageResult) collector.getAddedList(true).get(0)).getUid());
+        assertEquals(1001,((Long) collector.getAddedList(true).get(0)).longValue());
         assertCollectorSizes(0,0,0);
         
         results[0]=new MessageResultImpl(1001l,new Flags(Flags.Flag.FLAGGED));
         tracker.found(new UidRange(1001,1001),Arrays.asList(results));
-        assertCollectorSizes(0,0,1);
-        MessageFlags messageFlags =(MessageFlags) collector.getFlaggedList(true).get(0);
-        assertEquals(1001,messageFlags.getUid());
-        assertEquals(new Flags(Flags.Flag.FLAGGED),messageFlags.getFlags());
         
         // nothing changed
         tracker.found(new UidRange(1001,1001),Arrays.asList(results));
@@ -114,9 +110,6 @@
         results[0]=new MessageResultImpl(1000l,new Flags(Flags.Flag.DRAFT));
         tracker.found(new UidRange(1000,1000),Arrays.asList(results));
         assertCollectorSizes(0,0,1);
-        result=(MessageResult) collector.getFlaggedList(true).get(0);
-        assertEquals(1000,result.getUid());
-        assertEquals(new Flags(Flags.Flag.DRAFT),result.getFlags());
         
     }
 }

Modified: james/server/trunk/stage/org.apache.james/jars/apache-mime4j-0.4-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/james/server/trunk/stage/org.apache.james/jars/apache-mime4j-0.4-SNAPSHOT.jar?rev=675782&r1=675781&r2=675782&view=diff
==============================================================================
Binary files - no diff available.

Modified: james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/PartContentBuilder.java
URL: http://svn.apache.org/viewvc/james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/PartContentBuilder.java?rev=675782&r1=675781&r2=675782&view=diff
==============================================================================
--- james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/PartContentBuilder.java
(original)
+++ james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/PartContentBuilder.java
Thu Jul 10 15:13:53 2008
@@ -90,7 +90,7 @@
 
     private byte[] messageBodyContent() throws IOException, MimeException {
         advancedToMessage();
-        parser.setRecursionMode(MimeTokenStream.M_NO_RECURSE);
+        parser.setRecursionMode(MimeTokenStream.M_FLAT);
         for ( int state = parser.getState(); 
                 state != MimeTokenStream.T_BODY && state != MimeTokenStream.T_START_MULTIPART;

                 state = parser.next()) {
@@ -108,7 +108,7 @@
     }
 
     private byte[] mimeBodyContent() throws IOException, MimeException {
-        parser.setRecursionMode(MimeTokenStream.M_NO_RECURSE);
+        parser.setRecursionMode(MimeTokenStream.M_FLAT);
         for ( int state = parser.getState(); 
                 state != MimeTokenStream.T_BODY && state != MimeTokenStream.T_START_MULTIPART;

                 state = parser.next()) {

Modified: james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
URL: http://svn.apache.org/viewvc/james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java?rev=675782&r1=675781&r2=675782&view=diff
==============================================================================
--- james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
(original)
+++ james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
Thu Jul 10 15:13:53 2008
@@ -635,6 +635,7 @@
                         }
                     } catch (TorqueException e) {
                         getLog().info("Cannot test message against search criteria. Will
continue to test other messages.", e);
+                        if (getLog().isDebugEnabled()) getLog().debug("UID: " + row.getUid());
                     }
                 }
                 



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