2007-02-05 Adar Wesley <adarw@mainsoft.com>
authorAdar Wesley <adar@mono-cvs.ximian.com>
Mon, 5 Feb 2007 09:00:04 +0000 (09:00 -0000)
committerAdar Wesley <adar@mono-cvs.ximian.com>
Mon, 5 Feb 2007 09:00:04 +0000 (09:00 -0000)
        * PasswordRecoveryTest.cs: Fixed tests.  This fix required adding
        the section mailSettings to Web.config.  This in turn requires the
        section handler be registered in the active machine.config.

svn path=/trunk/mcs/; revision=72288

mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/Test/System.Web.UI.WebControls/PasswordRecoveryTest.cs
mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.config
mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config

index 53331d45939e15002d338b905755aa80b04d654f..581f77eb26bec7e3bc5540f8be1768abcd4a2c0e 100644 (file)
@@ -1,3 +1,9 @@
+2007-02-05 Adar Wesley <adarw@mainsoft.com>
+
+        * PasswordRecoveryTest.cs: Fixed tests.  This fix required adding
+        the section mailSettings to Web.config.  This in turn requires the
+        section handler be registered in the active machine.config.
+
 2007-02-04  yonik <yonik@mainsoft.com>
 
      * SqlDataSourceTest.cs: Add new tests  
index 40992d737c377b1a124ecfa526a11a4a5a2d6bc0..55cbfda00fdeb3efb28e0df5796da9730ff15af9 100644 (file)
@@ -125,18 +125,9 @@ namespace MonoTests.System.Web.UI.WebControls
 
        [Serializable]
        [TestFixture]
-       [Category("NotWorking")]
-       //
-       // This  uses CopyResource to Web.config, and until WebTest is not fixed to create
-       // per-test domains, this will break.
-       //
        public class PasswordRecoveryTest
        {
-               [TestFixtureSetUp]
-               public void CopyTestResources ()
-               {
-                       WebTest.CopyResource (GetType (), "WebControl.config", "Web.config");
-               }
+               // Merged required Web.config settings into NunitWeb/Resources/Web.config
 
                [SetUp]
                public void TestSetup ()
@@ -153,7 +144,6 @@ namespace MonoTests.System.Web.UI.WebControls
 
                        Assert.AreEqual ("Answer:", w.AnswerLabelText, "AnswerLabelText");
                        Assert.AreEqual ("Answer is required.", w.AnswerRequiredErrorMessage, "AnswerRequiredErrorMessage");
-                       //Assert.IsFalse (w.AutoGeneratePassword, "AutoGeneratePassword");
                        Assert.AreEqual ("Your attempt to retrieve your password was not successful. Please try again.", w.GeneralFailureText, "CompleteSuccessText");
                        Assert.AreEqual (string.Empty, w.HelpPageIconUrl, "HelpPageIconUrl");
                        Assert.AreEqual (string.Empty, w.HelpPageText, "HelpPageText");
@@ -450,13 +440,11 @@ namespace MonoTests.System.Web.UI.WebControls
                        e.Handled = true;
                }
 
-               // TODO:
-               // ValidatorTextStyle
-               // ErrorMessageStyle
+               // TODO: ValidatorTextStyle, ErrorMessageStyle
+
                [Test]
-               [Category ("NotDotNet")]
+               [Category ("NotDotNet")]  // MS does not call GetPassword on the FakeProvider
                [Category ("NunitWeb")]
-               [Category ("NotWorking")]
                public void GetPasswordTest ()
                {
                        PageInvoker pi = PageInvoker.CreateOnLoad (new PageDelegate (StylesRenderTestInit));
@@ -477,25 +465,6 @@ namespace MonoTests.System.Web.UI.WebControls
                        test.Request = fr;
                        html = test.Run ();
 
-//6) MonoTests.System.Web.UI.WebControls.PasswordRecoveryTest.GetPasswordTest : System.Xml.XmlException : comments cannot contain '--'  Line 40, position 33.^M
-//  at Mono.Xml2.XmlTextReader.ReadComment () [0x000b4] in /home/cvs/mcs/class/System.XML/System.Xml/XmlTextReader.cs:2279
-//  at Mono.Xml2.XmlTextReader.ReadDeclaration () [0x00031] in /home/cvs/mcs/class/System.XML/System.Xml/XmlTextReader.cs:2223
-//  at Mono.Xml2.XmlTextReader.ReadContent () [0x0012f] in /home/cvs/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1273
-//  at Mono.Xml2.XmlTextReader.ReadContent () [0x00155] in /home/cvs/mcs/class/System.XML/System.Xml/XmlTextReader.cs:1286
-//  at Mono.Xml2.XmlTextReader.Read () [0x00125] in /home/cvs/mcs/class/System.XML/System.Xml/XmlTextReader.cs:605
-//  at System.Xml.XmlTextReader.Read () [0x0006d] in /home/cvs/mcs/class/System.XML/System.Xml/XmlTextReader2.cs:551
-//  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00364] in /home/cvs/mcs/class/System.XML/System.Xml/XmlDocument.cs:976
-//  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader) [0x00195] in /home/cvs/mcs/class/System.XML/System.Xml/XmlDocument.cs:904
-//  at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00033] in /home/cvs/mcs/class/System.XML/System.Xml/XmlDocument.cs:823
-//  at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00019] in /home/cvs/mcs/class/System.XML/System.Xml/XmlDocument.cs:693
-//  at System.Xml.XmlDocument.LoadXml (System.String xml) [0x00023] in /home/cvs/mcs/class/System.XML/System.Xml/XmlDocument.cs:716
-//  at MonoTests.SystemWeb.Framework.FormRequest.ExtractFormAndHiddenControls (MonoTests.SystemWeb.Framework.Response response, System.String formId) [0x00033] in /home/cvs/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/FormRequest.cs:55
-//  at MonoTests.SystemWeb.Framework.FormRequest..ctor (MonoTests.SystemWeb.Framework.Response response, System.String formId) [0x00011] in /home/cvs/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/FormRequest.cs:31
-//  at MonoTests.System.Web.UI.WebControls.PasswordRecoveryTest.GetPasswordTest () [0x000c8] in /home/cvs/mcs/class/System.Web/Test/System.Web.UI.WebControls/PasswordRecoveryTest.cs:474
-//  at <0x00000> <unknown method>
-//  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[])
-//  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00056] in /home/cvs/mcs/class/corlib/System.Reflection/MonoMethod.cs:143
-//
                        FormRequest fr2 = new FormRequest (test.Response, "form1");
 
                        fr2.Controls.Add (new BaseControl (GetDecoratedId (html, "Answer"), "heh"));
index 00d316ae6827d556e95d58b2c8880762eb7853f9..e5fc22ae913db9e9712f7b7275c9f75aea7c1378 100644 (file)
 \r
     <httpHandlers>\r
       <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />\r
+      <add path="page.fake" verb ="GET" type="MonoTests.SystemWeb.Framework.MyHandler"/>\r
     </httpHandlers>\r
-    <membership>\r
+    <pages enableSessionState="False" />\r
+    <membership defaultProvider="FakeProvider">\r
       <providers>\r
         <add name="FakeProvider" type="MonoTests.SystemWeb.Framework.FakeMembershipProvider"\r
              enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true"\r
       </providers>\r
     </membership>\r
   </system.web>\r
+  <system.net>\r
+    <mailSettings>\r
+      <smtp from="heh@heh.com">\r
+        <network host="localhost" port="125"/>\r
+      </smtp>\r
+    </mailSettings>\r
+  </system.net>\r
 </configuration>\r
index 4ef47abae4463f15862ca4a059e96feccfa3f178..b8107623c7a458142f9fa99d9b885d7e8d85625e 100755 (executable)
@@ -9,8 +9,9 @@
 \r
     <httpHandlers>\r
       <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true" />\r
+      <add path="page.fake" verb ="GET" type="MonoTests.SystemWeb.Framework.MyHandler"/>\r
     </httpHandlers>\r
-    <pages EnableSessionState="False" />\r
+    <pages enableSessionState="False" />\r
     <membership>\r
       <providers>\r
         <add name="FakeProvider" type="MonoTests.SystemWeb.Framework.FakeMembershipProvider"\r
       </providers>\r
     </membership>\r
   </system.web>\r
+  <system.net>\r
+    <mailSettings>\r
+      <smtp from="heh@heh.com">\r
+        <network host="localhost" port="125"/>\r
+      </smtp>\r
+    </mailSettings>\r
+  </system.net>\r
 </configuration>\r