james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Fondermann <bf_...@brainlounge.de>
Subject Latest commits & Unit Tests
Date Sat, 25 Mar 2006 12:29:37 GMT
Hi Stefano,

since your last commits, some unit tests are no longer succeeding on my 
local trunk. two are easy fixes, but with the first one i am not so
sure...

   Bernd


### MimeMessage*Test

"expected:<...Cp1252...> but was:<...ISO-8859-1...>"

impl seems to be platform specific and does fail on my unix env.

is there a generic solution to this?

this failure occurs in all of these:
MimeMessageCopyOnWriteProxyTest
MimeMessageFromSharedStreamTest
MimeMessageFromStreamTest
MimeMessageTest
MimeMessageFromMimeMessageTest
MimeMessageWrapperTest

### org.apache.james.core.MailImplTest

getSize() behavior has been changed in MailImpl, so we have to adjust here:

Index: src/test/org/apache/james/core/MailImplTest.java
===================================================================
--- src/test/org/apache/james/core/MailImplTest.java    (revision 388495)
+++ src/test/org/apache/james/core/MailImplTest.java    (working copy)
@@ -68,7 +68,7 @@
          MailImpl mail = new MailImpl(name, senderMailAddress, 
recepients, mimeMessage);

          helperTestInitialState(mail);
-        helperTestMessageSize(mail, mimeMessage.getSize()); // 
MockMimeMessage default is -1 (accord. to javax.mail javadoc)
+        helperTestMessageSize(mail, 0);
          assertEquals("initial message", mimeMessage.getMessageID(), 
mail.getMessage().getMessageID());
          assertEquals("sender", sender, mail.getSender().toString());
          assertEquals("name", name, mail.getName());


### org.apache.james.remotemanager.RemoteManagerTest

I propose the following change to become platform independent:

Index: src/test/org/apache/james/remotemanager/RemoteManagerTest.java
===================================================================
--- src/test/org/apache/james/remotemanager/RemoteManagerTest.java 
(revision 388495)
+++ src/test/org/apache/james/remotemanager/RemoteManagerTest.java 
(working copy)
@@ -54,6 +54,8 @@

  public class RemoteManagerTest extends TestCase {

+    public static final String LINE_SEPARATOR = 
System.getProperties().getProperty("line.separator");
+
      protected int m_remoteManagerListenerPort = 
Util.getRandomNonPrivilegedPort();
      protected RemoteManager m_remoteManager;
      protected RemoteManagerTestConfiguration m_testConfiguration;
@@ -118,13 +120,13 @@
              fail("reading remote manager answer failed");
          }

- 
allAnswerLines.addAll(Arrays.asList(stringBuffer.toString().split("\r\n")));
+ 
allAnswerLines.addAll(Arrays.asList(stringBuffer.toString().split(LINE_SEPARATOR)));
          if ("".equals(getLastLine(allAnswerLines))) 
allAnswerLines.remove(allAnswerLines.size()-1);
          return allAnswerLines;
      }

      protected void sendCommand(String command) throws IOException {
-        m_writer.write(command + "\r\n");
+        m_writer.write(command + LINE_SEPARATOR);
          m_writer.flush();
      }




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