diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-12-08 08:53:02 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-12-08 08:53:02 +0300 |
commit | c2029b413fb6d6a690a34331cdc7b07a5a3015a8 (patch) | |
tree | be89d3f4eb5127bfe4ba7d431a6bd9de883c9e65 /mcs/class/System.XML | |
parent | e87e54f481ad5952e7586f88ec2170d6be596f1f (diff) |
2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
* XmlReaderSettings.cs :
set_Schemas() is fixed in 2.0 RTM (it just works).
* XmlResolver.cs : throw ArgumentNullException instead of
ArgumentException when both base and relative urls are null.
* XmlReaderSettingsTests.cs : SetSchemas() should not cause an error.
Added SetSchemasNull() as well.
* XmlUrlResolverTests.cs : (ResolveUriWithNullArgs)
expect ArgumentNullException instead of ArgumentException.
This is a fix in .NET 2.0.
svn path=/trunk/mcs/; revision=54093
Diffstat (limited to 'mcs/class/System.XML')
6 files changed, 28 insertions, 7 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index de7516aab36..ddd585fe542 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,5 +1,12 @@ 2005-12-08 Atsushi Enomoto <atsushi@ximian.com> + * XmlReaderSettings.cs : + set_Schemas() is fixed in 2.0 RTM (it just works). + * XmlResolver.cs : throw ArgumentNullException instead of + ArgumentException when both base and relative urls are null. + +2005-12-08 Atsushi Enomoto <atsushi@ximian.com> + * XmlReaderSettings.cs : ProhibitDtd is set as default. * XmlWriterSettings.cs : no set_OutputMethod. diff --git a/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs b/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs index 5a34775568f..cbf5691d2ad 100644 --- a/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs +++ b/mcs/class/System.XML/System.Xml/XmlReaderSettings.cs @@ -158,12 +158,9 @@ namespace System.Xml set { nameTable = value; } } - // LAMESPEC: Apparently, this property should not have a setter. public XmlSchemaSet Schemas { get { return schemas; } - set { - throw new XmlException ("XmlReaderSettings.Schemas is read-only and cannot be set."); - } + set { schemas = value; } } internal void SetSchemas (XmlSchemaSet schemas) diff --git a/mcs/class/System.XML/System.Xml/XmlResolver.cs b/mcs/class/System.XML/System.Xml/XmlResolver.cs index c985c0d9094..2635bdd1e30 100644 --- a/mcs/class/System.XML/System.Xml/XmlResolver.cs +++ b/mcs/class/System.XML/System.Xml/XmlResolver.cs @@ -50,7 +50,7 @@ namespace System.Xml { if (baseUri == null) { if (relativeUri == null) - throw new ArgumentException ("Either baseUri or relativeUri are required."); + throw new ArgumentNullException ("Either baseUri or relativeUri are required."); // Don't ignore such case that relativeUri is in fact absolute uri (e.g. ResolveUri (null, "http://foo.com")). if (relativeUri.StartsWith ("http:") || relativeUri.StartsWith ("https:") || diff --git a/mcs/class/System.XML/Test/System.Xml/ChangeLog b/mcs/class/System.XML/Test/System.Xml/ChangeLog index d8a6c63fba1..f89b48d0d68 100644 --- a/mcs/class/System.XML/Test/System.Xml/ChangeLog +++ b/mcs/class/System.XML/Test/System.Xml/ChangeLog @@ -1,5 +1,13 @@ 2005-12-08 Atsushi Enomoto <atsushi@ximian.com> + * XmlReaderSettingsTests.cs : SetSchemas() should not cause an error. + Added SetSchemasNull() as well. + * XmlUrlResolverTests.cs : (ResolveUriWithNullArgs) + expect ArgumentNullException instead of ArgumentException. + This is a fix in .NET 2.0. + +2005-12-08 Atsushi Enomoto <atsushi@ximian.com> + * XsdParticleValidationTests.cs : ValidateRootElementOnlyInvalid() does not throw validation exception under MS 2.0, this NotDotNet. diff --git a/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs index 2c73cf67cc2..dace6789e22 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlReaderSettingsTests.cs @@ -56,7 +56,6 @@ namespace MonoTests.System.Xml } [Test] - [ExpectedException (typeof (XmlException))] public void SetSchemas () { XmlReaderSettings s = new XmlReaderSettings (); @@ -64,6 +63,13 @@ namespace MonoTests.System.Xml } [Test] + public void SetSchemasNull () + { + XmlReaderSettings s = new XmlReaderSettings (); + s.Schemas = null; + } + + [Test] public void CloseInput () { StringReader sr = new StringReader ("<root/><root/>"); diff --git a/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs index b36b1f20e24..35f606c624a 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlUrlResolverTests.cs @@ -56,7 +56,10 @@ namespace MonoTests.System.Xml }
[Test]
- [ExpectedException (typeof (ArgumentException))]
+#if !NET_2_0
+ [Category ("NotDotNet")] // It should throw ArgumentNullException.
+#endif
+ [ExpectedException (typeof (ArgumentNullException))]
public void ResolveUriWithNullArgs ()
{
resolver.ResolveUri (null, null);
|