Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2007-03-22 18:29:11 +0300
committerAtsushi Eno <atsushieno@gmail.com>2007-03-22 18:29:11 +0300
commitbacad2cd34d1d11c414a26daba2612ce5e3f1275 (patch)
tree6572ff7455d88ffbcff7815a68a44110183e6847 /mcs/class/System.Security/Test
parent599544682e480db881517cd90f236b0f3e285472 (diff)
2007-03-22 Atsushi Enomoto <atsushi@ximian.com>
* XmlCanonicalizer.cs : fill prefixes which should be actually written. It must be actually done before canonicalization (so that node list filtering still takes spec-conformant effect). * Transform.cs, XmlDsigC14NTransform.cs, XmlDsigExcC14NTransform.cs : handle PropagatedNamespaces. * XmlDsigC14NTransformTest.cs : added test for xmlns attribute completion for input nodes, as well as test for PropagatedNamespaces (ignored so far). svn path=/trunk/mcs/; revision=74812
Diffstat (limited to 'mcs/class/System.Security/Test')
-rw-r--r--mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog6
-rw-r--r--mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs33
2 files changed, 39 insertions, 0 deletions
diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
index 6952f3653d5..9ef3f335fdd 100644
--- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
+++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlDsigC14NTransformTest.cs : added test for xmlns attribute
+ completion for input nodes, as well as test for
+ PropagatedNamespaces (ignored so far).
+
2007-01-25 Atsushi Enomoto <atsushi@ximian.com>
* SignedXmlTest.cs : enable SignElementWithPrefixedNamespace().
diff --git a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
index 454f16c9bee..0543e462a0c 100644
--- a/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
+++ b/mcs/class/System.Security/Test/System.Security.Cryptography.Xml/XmlDsigC14NTransformTest.cs
@@ -486,5 +486,38 @@ namespace MonoTests.System.Security.Cryptography.Xml {
Stream s = t.GetOutput () as Stream;
AssertEquals (expected, new StreamReader (s, Encoding.UTF8).ReadToEnd ());
}
+
+#if NET_2_0
+ [Test]
+ public void PrefixlessNamespaceOutput ()
+ {
+ XmlDocument doc = new XmlDocument ();
+ doc.AppendChild (doc.CreateElement ("foo", "urn:foo"));
+ doc.DocumentElement.AppendChild (doc.CreateElement ("bar", "urn:bar"));
+ AssertEquals ("#1", String.Empty, doc.DocumentElement.GetAttribute ("xmlns"));
+ XmlDsigC14NTransform t = new XmlDsigC14NTransform ();
+ t.LoadInput (doc);
+ Stream s = t.GetOutput () as Stream;
+ AssertEquals ("<foo xmlns=\"urn:foo\"><bar xmlns=\"urn:bar\"></bar></foo>", new StreamReader (s, Encoding.UTF8).ReadToEnd ());
+ AssertEquals ("#2", "urn:foo", doc.DocumentElement.GetAttribute ("xmlns"));
+ }
+
+ [Test]
+ [Ignore ("find out how PropagatedNamespaces returns non-null instance on .NET")]
+ public void PropagatedNamespaces ()
+ {
+ XmlDocument doc = new XmlDocument ();
+ doc.AppendChild (doc.CreateElement ("foo", "urn:foo"));
+ doc.DocumentElement.AppendChild (doc.CreateElement ("bar", "urn:bar"));
+ AssertEquals ("#1", String.Empty, doc.DocumentElement.GetAttribute ("xmlns:f"));
+ XmlDsigExcC14NTransform t = new XmlDsigExcC14NTransform ();
+ t.LoadInput (doc);
+ t.PropagatedNamespaces.Add ("f", "urn:foo");
+ t.PropagatedNamespaces.Add ("b", "urn:bar");
+ Stream s = t.GetOutput () as Stream;
+ AssertEquals ("<f:foo xmlns:f=\"urn:foo\"><b:bar xmlns:b=\"urn:bar\"></b:bar></f:foo>", new StreamReader (s, Encoding.UTF8).ReadToEnd ());
+ AssertEquals ("#2", "urn:foo", doc.DocumentElement.GetAttribute ("xmlns:f"));
+ }
+#endif
}
}