User: johnsimons
Date: 2010/01/15 05:53 PM

Added:
 /MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/Configuration/
  SmptConfigTestCase.cs

Modified:
 /MonoRail/trunk/lib/net-3.5/
  Castle.ActiveRecord.Linq.dll, Castle.ActiveRecord.dll, 
Castle.ActiveRecord.xml, 
Castle.Components.Common.TemplateEngine.NVelocityTemplateEngine.dll, 
Castle.Components.Common.TemplateEngine.NVelocityTemplateEngine.pdb, 
Castle.Components.Common.TemplateEngine.dll, 
Castle.Components.Common.TemplateEngine.pdb
 /MonoRail/trunk/src/
  Castle.MonoRail-vs2008.4.5.resharper, Changes.txt
 /MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/
  Castle.MonoRail.Framework.Tests-vs2008.csproj
 /MonoRail/trunk/src/Castle.MonoRail.Framework/Configuration/
  SmtpConfig.cs
 /MonoRail/trunk/src/Castle.MonoRail.Framework/Services/
  MonoRailSmtpSender.cs

Log:
 Updated ActiveRecord + TemplateEngine to release versions
 Applied MR-ISSUE-557 - SmtpUseSsl="true" can be specified in monorail config 
file

File Changes:

Directory: /MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/
===============================================================

File [modified]: Castle.MonoRail.Framework.Tests-vs2008.csproj
Delta lines: +120 -0
===================================================================

--- 
MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/Configuration/SmptConfigTestCase.cs
                              (rev 0)
+++ 
MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/Configuration/SmptConfigTestCase.cs
      2010-01-16 00:53:01 UTC (rev 6696)
@@ -0,0 +1,121 @@
+// Copyright 2004-2009 Castle Project - http://www.castleproject.org/
+// 
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// 
+//     http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Castle.MonoRail.Framework.Tests.Configuration
+{
+       using System;
+       using System.Collections.Generic;
+       using System.IO;
+       using System.Xml;
+       using Castle.MonoRail.Framework.Configuration;
+       using NUnit.Framework;
+
+       [TestFixture]
+       public class SmtpConfigTestCase
+       {
+               private SmtpConfig DeserializeSmtpConfigFromXml(string 
configXml)
+               {
+                       XmlDocument doc = new XmlDocument();
+                       doc.LoadXml(configXml);
+                       SmtpConfig config = new SmtpConfig();
+                       config.Deserialize(doc.DocumentElement);
+                       return config;
+               }
+
+               [Test]
+               public void WhenConfigIsEmpty_DefaultValuesGetUsed()
+               {
+                       string configXml = @"<monorail></monorail>";
+
+                       SmtpConfig config = 
DeserializeSmtpConfigFromXml(configXml);
+
+                       Assert.AreEqual("localhost", config.Host, "Host should 
be 'localhost' by when not speficied.");
+                       Assert.AreEqual(25, config.Port, "Port should be 25 by 
when not speficied.");
+                       Assert.IsNull(config.Username, "Username should be null 
by when not speficied.");
+                       Assert.IsNull(config.Password, "Password should be null 
by when not speficied.");
+                       Assert.IsFalse(config.UseSsl, "UseSsl should be false 
by when not speficied.");
+               }
+
+               [Test]
+               public void WhenSpecifyingHostAndPort_TheyGetDeserialized()
+               {
+                       string configXml = @"
+<monorail 
+       smtpHost=""[email protected]"" 
+       smtpPort=""112233"" 
+       >
+</monorail>";
+
+                       SmtpConfig config = 
DeserializeSmtpConfigFromXml(configXml);
+
+                       Assert.AreEqual("[email protected]", config.Host);
+                       Assert.AreEqual(112233, config.Port);
+               }
+
+               [Test]
+               public void 
WhenSpecifyingUsernameAndPassword_TheyGetDeserialized()
+               {
+                       string configXml = @"
+<monorail 
+       smtpHost=""host"" 
+       smtpPort=""123112233"" 
+       smtpUsername=""[email protected]"" 
+       smtpPassword=""MySecretPassword22"" 
+       >
+</monorail>";
+
+                       SmtpConfig config = 
DeserializeSmtpConfigFromXml(configXml);
+
+                       Assert.AreEqual("[email protected]", 
config.Username);
+                       Assert.AreEqual("MySecretPassword22", config.Password);
+               }
+
+               [Test]
+               public void WhenSslIsFalseInXml_UseSslIsFalse()
+               {
+                       string configXml = @"
+<monorail 
+       smtpHost=""host"" 
+       smtpPort=""123"" 
+       smtpUsername=""username"" 
+       smtpPassword=""password"" 
+       smtpUseSsl=""false""
+       >
+</monorail>";
+
+                       SmtpConfig config = 
DeserializeSmtpConfigFromXml(configXml);
+
+                       Assert.IsFalse(config.UseSsl);
+               }
+
+               [Test]
+               public void WhenSslIsTrueInXml_UseSslIsTrue()
+               {
+                       string configXml = @"
+<monorail 
+       smtpHost=""host"" 
+       smtpPort=""123"" 
+       smtpUsername=""username"" 
+       smtpPassword=""password"" 
+       smtpUseSsl=""true""
+       >
+</monorail>";
+
+                       SmtpConfig config = 
DeserializeSmtpConfigFromXml(configXml);
+
+                       Assert.IsTrue(config.UseSsl);
+               }
+
+       }

Directory: /MonoRail/trunk/src/Castle.MonoRail.Framework/Configuration/
=======================================================================

File [modified]: SmtpConfig.cs
Delta lines: +1 -0
===================================================================

--- MonoRail/trunk/src/Castle.MonoRail.Framework/Services/MonoRailSmtpSender.cs 
2010-01-15 21:38:22 UTC (rev 6695)
+++ MonoRail/trunk/src/Castle.MonoRail.Framework/Services/MonoRailSmtpSender.cs 
2010-01-16 00:53:01 UTC (rev 6696)
@@ -40,6 +40,7 @@
 
                        sender = new DefaultSmtpSender(config.SmtpConfig.Host);
                        sender.Port = config.SmtpConfig.Port;
+                       sender.UseSsl = config.SmtpConfig.UseSsl;
                        
                        if (!String.IsNullOrEmpty(config.SmtpConfig.Username))

Directory: /MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/Configuration/
=============================================================================

File [added]: SmptConfigTestCase.cs
Delta lines: +5 -0
===================================================================

--- MonoRail/trunk/src/Changes.txt      2010-01-15 21:38:22 UTC (rev 6695)
+++ MonoRail/trunk/src/Changes.txt      2010-01-16 00:53:01 UTC (rev 6696)
@@ -1,5 +1,10 @@
 Unreleased
 ==========
+- Updated ActiveRecord + TemplateEngine to release versions
+
+- Applied Alwin's patchfixing MR-ISSUE-557
+  "SmtpUseSsl="true" can be specified in monorail config file"
+
 - Updated dependecies to latest released versions
 

Directory: /MonoRail/trunk/src/Castle.MonoRail.Framework/Services/
==================================================================

File [modified]: MonoRailSmtpSender.cs
Delta lines: +3 -2
===================================================================

--- 
MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/Castle.MonoRail.Framework.Tests-vs2008.csproj
    2010-01-15 21:38:22 UTC (rev 6695)
+++ 
MonoRail/trunk/src/Castle.MonoRail.Framework.Tests/Castle.MonoRail.Framework.Tests-vs2008.csproj
    2010-01-16 00:53:01 UTC (rev 6696)
@@ -93,9 +93,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\lib\net-3.5\Castle.Core.dll</HintPath>
     </Reference>
-    <Reference Include="Castle.DynamicProxy2, Version=2.0.3.0, 
Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+    <Reference Include="Castle.DynamicProxy2, Version=2.2.0.0, 
Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\build\net-3.5\debug\Castle.DynamicProxy2.dll</HintPath>
+      <HintPath>..\..\lib\net-3.5\Castle.DynamicProxy2.dll</HintPath>
     </Reference>
     <Reference Include="Castle.MicroKernel, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -173,6 +173,7 @@
     <Compile Include="Bugs\MR-ISSUE-518.cs" />
     <Compile Include="Bugs\MR-ISSUE-535.cs" />
     <Compile Include="Bugs\MR-ISSUE-476.cs" />
+    <Compile Include="Configuration\SmptConfigTestCase.cs" />
     <Compile Include="Configuration\ViewEngineConfigTestCase.cs" />
     <Compile Include="Controllers\AccessibleThroughTestCase.cs" />

Directory: /MonoRail/trunk/lib/net-3.5/
=======================================

File [modified]: Castle.ActiveRecord.Linq.dll
Delta lines: None
None
File [modified]: Castle.ActiveRecord.dll
Delta lines: None
None
File [modified]: Castle.ActiveRecord.xml
Delta lines: +2 -4
===================================================================

--- MonoRail/trunk/src/Castle.MonoRail-vs2008.4.5.resharper     2010-01-15 
21:38:22 UTC (rev 6695)
+++ MonoRail/trunk/src/Castle.MonoRail-vs2008.4.5.resharper     2010-01-16 
00:53:01 UTC (rev 6696)
@@ -1,7 +1,6 @@
 <Configuration>
   <CodeStyleSettings>
-    <ExternalPath IsNull="False">
-    </ExternalPath>
+    <ExternalPath IsNull="False" />
     <Sharing>SOLUTION</Sharing>
     <CSharp>
       <FormatSettings>
@@ -82,8 +81,7 @@
 ]]></FileHeader>
     <GenerateMemberBody />
     <Naming2>
-      <ExceptionName IsNull="False">
-      </ExceptionName>
+      <ExceptionName IsNull="False" />
       <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" 
ElementKind="MethodPropertyEvent" />
       <PredefinedRule Inspect="True" Prefix="" Suffix="" Style="AaBb" 
ElementKind="TypesAndNamespaces" />

File [modified]: 
Castle.Components.Common.TemplateEngine.NVelocityTemplateEngine.dll
Delta lines: None
None
File [modified]: 
Castle.Components.Common.TemplateEngine.NVelocityTemplateEngine.pdb
Delta lines: None
None
File [modified]: Castle.Components.Common.TemplateEngine.dll
Delta lines: None
None
File [modified]: Castle.Components.Common.TemplateEngine.pdb
Delta lines: None
None
Directory: /MonoRail/trunk/src/
===============================

File [modified]: Castle.MonoRail-vs2008.4.5.resharper
Delta lines: +15 -0
===================================================================

--- MonoRail/trunk/src/Castle.MonoRail.Framework/Configuration/SmtpConfig.cs    
2010-01-15 21:38:22 UTC (rev 6695)
+++ MonoRail/trunk/src/Castle.MonoRail.Framework/Configuration/SmtpConfig.cs    
2010-01-16 00:53:01 UTC (rev 6696)
@@ -27,6 +27,7 @@
                private int port = 25;
                private String username;
                private String password;
+               private bool useSsl;
 
                /// <summary>
                /// Deserializes the specified smtp section.
@@ -38,6 +39,7 @@
                        XmlAttribute smtpPortAtt = 
section.Attributes["smtpPort"];
                        XmlAttribute smtpUserAtt = 
section.Attributes["smtpUsername"];
                        XmlAttribute smtpPwdAtt = 
section.Attributes["smtpPassword"];
+                       XmlAttribute smtpSslAtt = 
section.Attributes["smtpUseSsl"];
 
                        if (smtpHostAtt != null && smtpHostAtt.Value != 
String.Empty)
                        {
@@ -55,6 +57,10 @@
                        {
                                password = smtpPwdAtt.Value;
                        }
+                       if (smtpSslAtt != null && smtpSslAtt.Value != 
String.Empty)
+                       {
+                               useSsl = bool.Parse(smtpSslAtt.Value);
+                       }
                }
 
                /// <summary>
@@ -96,5 +102,14 @@
                        get { return password; }
                        set { password = value; }
                }
+
+               /// <summary>
+               /// Gets or sets whether to enable SSL.
+               /// </summary>
+               public bool UseSsl
+               {
+                       get { return useSsl; }
+                       set { useSsl = value; }
+               }
        }

File [modified]: Changes.txt
Delta lines: +0 -0
===================================================================

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-commits?hl=en.


Reply via email to