Trying again to pass the antispam filter.

I and Rick had some off-list conversation about failures in our testsuite when using geronimo javamail.

He already fixed the first NPEs I found, now I opened a few more issue on the basic use of MimeMessage and our MimeMessageWrapper object:

GERONIMO-4127 - Problems generating a new simple/basic mail (both from API and from InputStream)
https://issues.apache.org/jira/browse/GERONIMO-4127
GERONIMO-4129 - genorimo MimeMessage extensibility internal behaviour vs sun implementation OOM issue.
https://issues.apache.org/jira/browse/GERONIMO-4129
GERONIMO-4128 - geronimo javamail uses Message-Id instead of Message-ID
https://issues.apache.org/jira/browse/GERONIMO-4128

I also see some infinite loops when our MimeMessageCopyOnWriteProxy try to clone a message because of a write and it tries to clone a message using MimeMessageWrapper and a sharedInputStream as the source of the message, but this is not easy to isolate in a simple test.

If you want to give it a try you will need the classes from our "core-library" module in the org.apache.james.core package and the tests from "phoenix-deployment" module in the org.apache.james.core package.

Stefano

Rick McGuire ha scritto:
Stefano Bagnara wrote:
Rick McGuire ha scritto:
Stefano Bagnara wrote:
(this previously bounced as spam, I post it again with few changes, but I'll take care to open JIRA issues in the geronimo project for them)

Rick McGuire ha scritto:
Ok, the permission problem should be fixed now. I also forgot that you'll probably want to use the matching Geronimo activation jar as well. I placed that one in the same location.

I gave it a first try, but it didn't run tests because you compiled to
java 1.5 and james is 1.4.

I changed our JVM specification and run the tests again. Many of them
fails, just the first:
Stefano, I don't think I can fix any/most of these just by eye-balling the exceptions. If you can give me a set of instructions for how to build James and run the tests with the geronimo javamail in use, I'll just start working through the problems until things run cleanly.

Sure, sorry. The problem is I didn't have much time now, so I anyway tried to give you some feedback.

To use geronimo I had to run a search/replace in poms, to replace CRLFOutputStream with commons-net ToNetASCIIOutputStream, to change the package for SMTPTransport/and its implementation exceptions checks (I then used m2clipse and eclipse to import it as a single project in eclipse and to run unit tests).

I think I should extract our "core" tests (mainly aimed at checking our wrapper/extension of MimeMessage) and its constructors, copy, writeTo methods and create a test suite to attach to JIRA for you as a first step.

I'll see what I can do as soon as I find the time :-)
In the mean time let me know if you do some progress before I get there!
I believe I've fixed the Return-Path header name mismatch (and a problem with some other headers as well). I believe I know the problem with the NPEs in the InternetHeaders matchHeader() method...working on a fix to that one now. The big mystery one is the OOM exception in the MimeMessage parse() method. That one, I believe, will require hands on debugging.
Rick



Thank you!

Stefano

MimeMessageCopyOnWriteProxyTest

- testMessageCloning1 gets an OOM:
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2786)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
    at javax.mail.internet.MimeMessage.parse(MimeMessage.java:270)
    at
org.apache.james.core.MimeMessageWrapper.parse(MimeMessageWrapper.java:479)
    at
org.apache.james.core.MimeMessageWrapper.loadMessage(MimeMessageWrapper.java:207)
    at
org.apache.james.core.MimeMessageWrapper.getSize(MimeMessageWrapper.java:294)
    at
org.apache.james.core.MimeMessageWrapper.<init>(MimeMessageWrapper.java:136)
    at
org.apache.james.core.MimeMessageCopyOnWriteProxy.getWrappedMessageForWriting(MimeMessageCopyOnWriteProxy.java:165)
    at
org.apache.james.core.MimeMessageCopyOnWriteProxy.setText(MimeMessageCopyOnWriteProxy.java:642)
    at
org.apache.james.core.MimeMessageCopyOnWriteProxyTest.testMessageCloning1(MimeMessageCopyOnWriteProxyTest.java:64)

- testMessageCloning2 do the same
- testMessageAvoidCloning do the same
- testMessageCloningViaCoW3 die in an infinite loop
- testMessageCloningViaCow2 do the same (infinite loop)


MailHeadersTest
- testHeadersOrder fails:
junit.framework.AssertionFailedError: expected:<Return-path:
<[EMAIL PROTECTED]>> but was:<Return-Path: <[EMAIL PROTECTED]>>
    at junit.framework.Assert.fail(Assert.java:47)
    at junit.framework.Assert.failNotEquals(Assert.java:282)
    at junit.framework.Assert.assertEquals(Assert.java:64)
    at junit.framework.Assert.assertEquals(Assert.java:71)
    at
org.apache.james.core.MailHeadersTest.testHeadersOrder(MailHeadersTest.java:40)
(the problem is "Return-path" "Return-Path"

MimeMessageUtilTest
- testWriteMimeMessageMultipartWithMessageID fails:
java.lang.NullPointerException
    at
javax.mail.internet.InternetHeaders.matchHeader(InternetHeaders.java:464)
    at
javax.mail.internet.InternetHeaders.getNonMatchingHeaders(InternetHeaders.java:504)
    at
javax.mail.internet.InternetHeaders.getNonMatchingHeaderLines(InternetHeaders.java:562)
    at
javax.mail.internet.MimeMessage.getNonMatchingHeaderLines(MimeMessage.java:1285)
    at
org.apache.james.core.MimeMessageUtil.writeHeadersTo(MimeMessageUtil.java:213)
    at
org.apache.james.core.MimeMessageUtil.writeToInternal(MimeMessageUtil.java:103) at org.apache.james.core.MimeMessageUtil.writeTo(MimeMessageUtil.java:85) at org.apache.james.core.MimeMessageUtil.writeTo(MimeMessageUtil.java:58)
    at
org.apache.james.core.MimeMessageUtilTest.testWriteMimeMessageMultipartWithMessageID(MimeMessageUtilTest.java:66)
I see this NPE in many other tests.

MimeMessageFromMimeMessageTest
- testSimpleMessage fails
junit.framework.ComparisonFailure: expected:<Subject: test
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
...> but was:<...>
    at junit.framework.Assert.assertEquals(Assert.java:81)
    at junit.framework.Assert.assertEquals(Assert.java:87)
    at
org.apache.james.core.MimeMessageTest.testSimpleMessage(MimeMessageTest.java:91)
(we expect an header, instead we find only "<CRLF>body".

- testMultiPartMessageChanges fails
the first assert fail because the resulting mail has no more a multipart
content type.

MimeMessageFromStreamTest fails almost on the same as
MimeMessageFromMimeMessageTest.

MimeMessageWrapperTest most tests fails with the OOM I already reported
above.


The result of running all the org.apache.james.core.* tests is 10
failures, 24 errors, 2 infinite loops (for a total 72 tests)

I didn't even try the 8bitmime, because there is for sure something to
fix, first ;-)

Maybe we was "abusing" sun javamail bugs, I don't know.

Stefano













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

Reply via email to