geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r467983 - in /geronimo/server/trunk/modules/geronimo-mail/src: main/java/org/apache/geronimo/mail/ProtocolGBean.java test/java/org/apache/geronimo/mail/MailGBeanTest.java test/java/org/apache/geronimo/mail/TestTransport.java
Date Thu, 26 Oct 2006 12:41:09 GMT
Author: rickmcguire
Date: Thu Oct 26 05:41:07 2006
New Revision: 467983

URL: http://svn.apache.org/viewvc?view=rev&rev=467983
Log:
GERONIMO-2519 ProtocolGBean ignoring the properties attribute.


Modified:
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java
    geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/MailGBeanTest.java
    geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/TestTransport.java

Modified: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java?view=diff&rev=467983&r1=467982&r2=467983
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java
Thu Oct 26 05:41:07 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.mail;
 
+import java.util.Enumeration;
 import java.util.Properties;
 
 import org.apache.commons.logging.Log;
@@ -169,6 +170,15 @@
      * Add the overrides from the member variables to the properties file.
      */
     public void addOverrides(Properties props) {
+        Enumeration keys = properties.propertyNames();
+
+        // copy the properties attribute into the over rides as well.  These are copied
+        // with the key names unchanged, so they must be specified fully qualified.
+        while (keys.hasMoreElements()) {
+            String key = (String)keys.nextElement();
+            props.put(key, properties.getProperty(key));
+        }
+
         if (host != null) props.put("mail." + protocol + ".host", host);
         if (user != null) props.put("mail." + protocol + ".user", user);
     }

Modified: geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/MailGBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/MailGBeanTest.java?view=diff&rev=467983&r1=467982&r2=467983
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/MailGBeanTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/MailGBeanTest.java
Thu Oct 26 05:41:07 2006
@@ -76,10 +76,16 @@
     }
 
     public void testSMTPOverrides() throws Exception {
+        // these are defaults, all to be overridden
         Properties properties = new Properties();
         properties.put("mail.store.protocol", "POOKIE");
         properties.put("mail.transport.protocol", "BEAR");
-        properties.put("mail.smtp.ehlo", "true");
+        properties.put("mail.smtp.ehlo", "false");
+
+        // this is done in the property bundle for the transport.
+        Properties bundle = new Properties();
+        bundle.put("mail.smtp.ehlo", "true");
+        bundle.put("mail.smtp.quitwait", "true");
 
         SMTPTransportGBean protocol = new SMTPTransportGBean("test:name=smtp", null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null);
         protocol.doStart();

Modified: geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/TestTransport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/TestTransport.java?view=diff&rev=467983&r1=467982&r2=467983
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/TestTransport.java
(original)
+++ geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/TestTransport.java
Thu Oct 26 05:41:07 2006
@@ -39,4 +39,8 @@
     public boolean isEHLO() {
         return "true".equals(session.getProperties().getProperty("mail.smtp.ehlo"));
     }
+
+    public boolean isQuitWait() {
+        return "true".equals(session.getProperties().getProperty("mail.smtp.quitwait"));
+    }
 }



Mime
View raw message