Author: veithen
Date: Sun Oct 5 03:39:53 2008
New Revision: 701772
URL: http://svn.apache.org/viewvc?rev=701772&view=rev
Log:
* Mail transport: The MailOutTransportInfo object was initialized incorrectly,
causing responses to have a wrong value (recipient instead of sender) for the
From header.
Modified:
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailMessageContextValidator.java
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailRequestResponseClient.java
Modified:
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java?rev=701772&r1=701771&r2=701772&view=diff
==============================================================================
---
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java
(original)
+++
webservices/commons/trunk/modules/transport/modules/mail/src/main/java/org/apache/axis2/transport/mail/MailTransportListener.java
Sun Oct 5 03:39:53 2008
@@ -318,12 +318,7 @@
}
}
- InternetAddress[] fromAddress = (InternetAddress[])
message.getReplyTo();
- if (fromAddress == null) {
- fromAddress = (InternetAddress[]) message.getFrom();
- }
-
- MailOutTransportInfo outInfo = new
MailOutTransportInfo(fromAddress[0]);
+ MailOutTransportInfo outInfo = new
MailOutTransportInfo(entry.getEmailAddress());
// determine reply address
if (message.getReplyTo() != null) {
Modified:
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailMessageContextValidator.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailMessageContextValidator.java?rev=701772&r1=701771&r2=701772&view=diff
==============================================================================
---
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailMessageContextValidator.java
(original)
+++
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailMessageContextValidator.java
Sun Oct 5 03:39:53 2008
@@ -43,7 +43,11 @@
String from = (String)trpHeaders.get(MailConstants.MAIL_HEADER_FROM);
String to = (String)trpHeaders.get(MailConstants.MAIL_HEADER_TO);
if (isResponse) {
- // TODO: enable this once the corresponding bug in the mail
transport is corrected
+ // TODO: The transport headers in the response message context are
not set correctly.
+ // There are two issues:
+ // * SynchronousCallback doesn't propagate the transport
headers
+ // * OutInAxisOperation#send(MessageContext) overwrites the
TRANSPORT_HEADERS
+ // property with the value from the request message
context.
// assertEquals(channel.getSender().getAddress(), to);
// assertEquals(channel.getRecipient().getAddress(), from);
} else {
Modified:
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailRequestResponseClient.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailRequestResponseClient.java?rev=701772&r1=701771&r2=701772&view=diff
==============================================================================
---
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailRequestResponseClient.java
(original)
+++
webservices/commons/trunk/modules/transport/modules/tests/src/test/java/org/apache/axis2/transport/mail/MailRequestResponseClient.java
Sun Oct 5 03:39:53 2008
@@ -71,9 +71,8 @@
Assert.assertNotNull("No response received", reply);
Assert.assertEquals(channel.getSender().getAddress(),
((InternetAddress)reply.getRecipients(Message.RecipientType.TO)[0]).getAddress());
- // TODO: enable this once the corresponding bug in the mail transport
is corrected
-// Assert.assertEquals(channel.getRecipient().getAddress(),
-//
((InternetAddress)reply.getFrom()[0]).getAddress());
+ Assert.assertEquals(channel.getRecipient().getAddress(),
+
((InternetAddress)reply.getFrom()[0]).getAddress());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
reply.getDataHandler().writeTo(baos);
return new IncomingMessage<byte[]>(new
ContentType(reply.getContentType()), baos.toByteArray());