diff options
author | Sepideh Khoshnood <sekho@microsoft.com> | 2016-12-29 20:42:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-29 20:42:39 +0300 |
commit | 005a4963c886c71d655be4571bc829c724845773 (patch) | |
tree | ce6008771280816b1a2a9790bbf997f1f78149b4 | |
parent | f8d084c1f46deaf2ad4b0e1938df705e7a6f774f (diff) | |
parent | 118962b93a6b51540e8c9b7f7d1df44c4a0c7f00 (diff) |
Merge pull request #14751 from sepidehMS/CleanupXmlTests
Clean up System.Private.Xml tests
103 files changed, 4870 insertions, 6362 deletions
diff --git a/src/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs b/src/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs index 29e61375f8..cc91c1e720 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs @@ -56,15 +56,15 @@ namespace System } } - private const string DontProhibitDefaultResolverName = "Switch.System.Xml.DontProhibitDefaultResolver"; - private static int s_dontProhibitDefaultResolver; + private const string AllowDefaultResolverName = "Switch.System.Xml.AllowDefaultResolver"; + private static int s_allowDefaultResolver; - public static bool DontProhibitDefaultResolver + public static bool AllowDefaultResolver { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - return LocalAppContext.GetCachedSwitchValue(DontProhibitDefaultResolverName, ref s_dontProhibitDefaultResolver); + return LocalAppContext.GetCachedSwitchValue(AllowDefaultResolverName, ref s_allowDefaultResolver); } } } diff --git a/src/System.Private.Xml/src/System/Xml/Core/XmlReaderSettings.cs b/src/System.Private.Xml/src/System/Xml/Core/XmlReaderSettings.cs index 2d634c9b5c..a45e87c7b8 100644 --- a/src/System.Private.Xml/src/System/Xml/Core/XmlReaderSettings.cs +++ b/src/System.Private.Xml/src/System/Xml/Core/XmlReaderSettings.cs @@ -125,7 +125,7 @@ namespace System.Xml //notice we must keep GetXmlResolver() to avoid dead lock when init System.Config.ConfigurationManager internal XmlResolver GetXmlResolver_CheckConfig() { - if (!IsXmlResolverSet) + if (!LocalAppContextSwitches.AllowDefaultResolver && !IsXmlResolverSet) return null; else return _xmlResolver; diff --git a/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs b/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs index 04a1fb122a..260f62882b 100644 --- a/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs +++ b/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs @@ -461,7 +461,7 @@ namespace System.Xml.Xsl private static XmlResolver CreateDefaultResolver() { - if (LocalAppContextSwitches.DontProhibitDefaultResolver) + if (LocalAppContextSwitches.AllowDefaultResolver) { return new XmlUrlResolver(); } diff --git a/src/System.Private.Xml/src/System/Xml/Xslt/XslTransform.cs b/src/System.Private.Xml/src/System/Xml/Xslt/XslTransform.cs index b30fe39184..996755c163 100644 --- a/src/System.Private.Xml/src/System/Xml/Xslt/XslTransform.cs +++ b/src/System.Private.Xml/src/System/Xml/Xslt/XslTransform.cs @@ -306,7 +306,7 @@ namespace System.Xml.Xsl private static XmlResolver CreateDefaultResolver() { - if (LocalAppContextSwitches.DontProhibitDefaultResolver) + if (LocalAppContextSwitches.AllowDefaultResolver) { return new XmlUrlResolver(); } diff --git a/src/System.Private.Xml/tests/Readers/NameTable/TestFiles.cs b/src/System.Private.Xml/tests/Readers/NameTable/TestFiles.cs index 91fa320f30..8e84024f07 100644 --- a/src/System.Private.Xml/tests/Readers/NameTable/TestFiles.cs +++ b/src/System.Private.Xml/tests/Readers/NameTable/TestFiles.cs @@ -146,11 +146,11 @@ namespace System.Xml.Tests tw.WriteLine("<ATTRIBUTE2 a1='a1value' />"); tw.WriteLine("<ATTRIBUTE3 a1='a1value' a2='a2value' a3='a3value' />"); tw.WriteLine("<ATTRIBUTE4 a1='' />"); - tw.WriteLine("<ATTRIBUTE5 CRLF='x\r\nx' CR='x\rx' LF='x\nx' MS='x x' TAB='x\tx' />"); - tw.WriteLine("<ENDOFLINE1>x\r\nx</ENDOFLINE1>"); - tw.WriteLine("<ENDOFLINE2>x\rx</ENDOFLINE2>"); + tw.WriteLine(string.Format("<ATTRIBUTE5 CRLF='x{0}x' CR='x{0}x' LF='x\nx' MS='x x' TAB='x\tx' />", Environment.NewLine)); + tw.WriteLine(string.Format("<ENDOFLINE1>x{0}x</ENDOFLINE1>", Environment.NewLine)); + tw.WriteLine(string.Format("<ENDOFLINE2>x{0}x</ENDOFLINE2>", Environment.NewLine)); tw.WriteLine("<ENDOFLINE3>x\nx</ENDOFLINE3>"); - tw.WriteLine("<WHITESPACE1>\r\n<ELEM />\r\n</WHITESPACE1>"); + tw.WriteLine(string.Format("<WHITESPACE1>{0}<ELEM />{0}</WHITESPACE1>", Environment.NewLine)); tw.WriteLine("<WHITESPACE2> <ELEM /> </WHITESPACE2>"); tw.WriteLine("<WHITESPACE3>\t<ELEM />\t</WHITESPACE3>"); tw.WriteLine("<SKIP1 /><AFTERSKIP1 />"); @@ -259,7 +259,7 @@ namespace System.Xml.Tests tw.WriteLine("<EMPTY4 val=\"abc\"></EMPTY4>"); tw.WriteLine("<COMPLEX>Text<!-- comment --><![CDATA[cdata]]></COMPLEX>"); tw.WriteLine("<DUMMY />"); - tw.WriteLine("<MULTISPACES att=' \r\n \t \r\r\n n1 \r\n \t \r\r\n n2 \r\n \t \r\r\n ' />"); + tw.WriteLine(string.Format("<MULTISPACES att=' {0} \t {0}{0} n1 {0} \t {0}{0} n2 {0} \t {0}{0} ' />", Environment.NewLine)); tw.WriteLine("<CAT>AB<![CDATA[CD]]> </CAT>"); tw.WriteLine("<CATMIXED>AB<![CDATA[CD]]> </CATMIXED>"); diff --git a/src/System.Private.Xml/tests/Readers/ReaderSettings/MaxSettings.cs b/src/System.Private.Xml/tests/Readers/ReaderSettings/MaxSettings.cs index a952bc5bab..f3813be69c 100644 --- a/src/System.Private.Xml/tests/Readers/ReaderSettings/MaxSettings.cs +++ b/src/System.Private.Xml/tests/Readers/ReaderSettings/MaxSettings.cs @@ -341,7 +341,7 @@ namespace System.Xml.Tests //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = bigVal, MaxDoc = bigVal", Params = new object[] { "" })] //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = bigVal, MaxDoc = bigVal", Params = new object[] { "<?xml version='1.0'?><!DOCTYPE test [ <!ELEMENT test ANY> <!ELEMENT a ANY> <!ELEMENT b ANY> <!ELEMENT c ANY> <!ENTITY a '<a>&</a>'>]><test>&a;<test>" })] //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = bigVal, MaxDoc = bigVal", Params = new object[] { "<q = 'a'/>" })] - //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = bigVal, MaxDoc = bigVal", Params = new object[] { "<!-- http://www.w3.org is bound to n1 and n2 -->\r\n<x xmlns:n1=\"http://www.w3.org\"\r\n xmlns:n2=\"http://www.w3.org\" >\r\n <bad n1:a=\"1\" n2:a=\"2\" /></x>" })] + //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = bigVal, MaxDoc = bigVal", Params = new object[] { string.Format("<!-- http://www.w3.org is bound to n1 and n2 -->{0}<x xmlns:n1=\"http://www.w3.org\"{0} xmlns:n2=\"http://www.w3.org\" >{0} <bad n1:a=\"1\" n2:a=\"2\" /></x>", Environment.NewLine) })] //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = bigVal, MaxDoc = bigVal", Params = new object[] { "<root><!--comment \uD812><!--comment \uD812>-->--></root>" })] public int v260() { @@ -371,7 +371,7 @@ namespace System.Xml.Tests //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = 1, MaxDoc = val", Params = new object[] { "<?xml version='1.0'?><!DOCTYPE test [ <!ELEMENT test ANY> <!ELEMENT a ANY> <!ELEMENT b ANY> <!ELEMENT c ANY> <!ENTITY a '<a>&a;</a>'>]><test>&a;</test>", 25 })] //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = 1, MaxDoc = val", Params = new object[] { "<?xml version='1.0'?><!DOCTYPE test [ <!ELEMENT test ANY> <!ELEMENT a ANY> <!ELEMENT b ANY> <!ELEMENT c ANY> <!ENTITY a '<a>&</a>'>]><test>&a;<test>", 26 })] //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = 1, MaxDoc = val", Params = new object[] { "<q = 'a'/>", 5 })] - //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = 1, MaxDoc = val", Params = new object[] { "<!-- http://www.w3.org is bound to n1 and n2 -->\r\n<x xmlns:n1=\"http://www.w3.org\"\r\n xmlns:n2=\"http://www.w3.org\" >\r\n <bad n1:a=\"1\" n2:a=\"2\" /></x>", 35 })] + //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = 1, MaxDoc = val", Params = new object[] { string.Format("<!-- http://www.w3.org is bound to n1 and n2 -->{0}<x xmlns:n1=\"http://www.w3.org\"{0} xmlns:n2=\"http://www.w3.org\" >{0} <bad n1:a=\"1\" n2:a=\"2\" /></x>", Environment.NewLine), 35 })] //[Variation(Pri = 2, Desc = "nwf xml: MaxEnt = 1, MaxDoc = val", Params = new object[] { "<root><!--comment \uD812><!--comment \uD812>-->--></root>", 18 })] public int v270() { diff --git a/src/System.Private.Xml/tests/Readers/ReaderSettings/TCMaxSettings.cs b/src/System.Private.Xml/tests/Readers/ReaderSettings/TCMaxSettings.cs index 7bf0c5117e..5491a9b14b 100644 --- a/src/System.Private.Xml/tests/Readers/ReaderSettings/TCMaxSettings.cs +++ b/src/System.Private.Xml/tests/Readers/ReaderSettings/TCMaxSettings.cs @@ -157,7 +157,7 @@ namespace System.Xml.Tests { this.AddChild(new CVariation(v260) { Attribute = new Variation("nwf xml: MaxEnt = bigVal, MaxDoc = bigVal") { Params = new object[] { "" }, Pri = 2 } }); this.AddChild(new CVariation(v260) { Attribute = new Variation("nwf xml: MaxEnt = bigVal, MaxDoc = bigVal") { Params = new object[] { "<root><!--comment \ufffd\ufffd><!--comment \ufffd\ufffd>-->--></root>" }, Pri = 2 } }); - this.AddChild(new CVariation(v260) { Attribute = new Variation("nwf xml: MaxEnt = bigVal, MaxDoc = bigVal") { Params = new object[] { "<!-- http://www.w3.org is bound to n1 and n2 -->\r\n<x xmlns:n1=\"http://www.w3.org\"\r\n xmlns:n2=\"http://www.w3.org\" >\r\n <bad n1:a=\"1\" n2:a=\"2\" /></x>" }, Pri = 2 } }); + this.AddChild(new CVariation(v260) { Attribute = new Variation("nwf xml: MaxEnt = bigVal, MaxDoc = bigVal") { Params = new object[] { string.Format("<!-- http://www.w3.org is bound to n1 and n2 -->{0}<x xmlns:n1=\"http://www.w3.org\"{0} xmlns:n2=\"http://www.w3.org\" >{0} <bad n1:a=\"1\" n2:a=\"2\" /></x>", Environment.NewLine) }, Pri = 2 } }); this.AddChild(new CVariation(v260) { Attribute = new Variation("nwf xml: MaxEnt = bigVal, MaxDoc = bigVal") { Params = new object[] { "<!DOCTYPE ROOT [<!ENTITY a '&a;'>]><ROOT att='&a;'/>" }, Pri = 2 } }); this.AddChild(new CVariation(v260) { Attribute = new Variation("nwf xml: MaxEnt = bigVal, MaxDoc = bigVal") { Params = new object[] { "<?xml version='1.0'?><!DOCTYPE test [ <!ELEMENT test ANY> <!ELEMENT a ANY> <!ELEMENT b ANY> <!ELEMENT c ANY> <!ENTITY a '<a>&a;</a>'>]><test>&a;</test>" }, Pri = 2 } }); this.AddChild(new CVariation(v260) { Attribute = new Variation("nwf xml: MaxEnt = bigVal, MaxDoc = bigVal") { Params = new object[] { "<?xml version='1.0'?><!DOCTYPE test [ <!ELEMENT test ANY> <!ELEMENT a ANY> <!ELEMENT b ANY> <!ELEMENT c ANY> <!ENTITY a '<a>&</a>'>]><test>&a;<test>" }, Pri = 2 } }); @@ -172,7 +172,7 @@ namespace System.Xml.Tests this.AddChild(new CVariation(v270) { Attribute = new Variation("nwf xml: MaxEnt = 1, MaxDoc = val") { Params = new object[] { "<?xml version='1.0'?><!DOCTYPE test [ <!ELEMENT test ANY> <!ELEMENT a ANY> <!ELEMENT b ANY> <!ELEMENT c ANY> <!ENTITY a '<a>&a;</a>'>]><test>&a;</test>", 25 }, Pri = 2 } }); this.AddChild(new CVariation(v270) { Attribute = new Variation("nwf xml: MaxEnt = 1, MaxDoc = val") { Params = new object[] { "<?xml version='1.0'?><!DOCTYPE test [ <!ELEMENT test ANY> <!ELEMENT a ANY> <!ELEMENT b ANY> <!ELEMENT c ANY> <!ENTITY a '<a>&</a>'>]><test>&a;<test>", 26 }, Pri = 2 } }); this.AddChild(new CVariation(v270) { Attribute = new Variation("nwf xml: MaxEnt = 1, MaxDoc = val") { Params = new object[] { "<root><!--comment \ufffd\ufffd><!--comment \ufffd\ufffd>-->--></root>", 18 }, Pri = 2 } }); - this.AddChild(new CVariation(v270) { Attribute = new Variation("nwf xml: MaxEnt = 1, MaxDoc = val") { Params = new object[] { "<!-- http://www.w3.org is bound to n1 and n2 -->\r\n<x xmlns:n1=\"http://www.w3.org\"\r\n xmlns:n2=\"http://www.w3.org\" >\r\n <bad n1:a=\"1\" n2:a=\"2\" /></x>", 35 }, Pri = 2 } }); + this.AddChild(new CVariation(v270) { Attribute = new Variation("nwf xml: MaxEnt = 1, MaxDoc = val") { Params = new object[] { string.Format("<!-- http://www.w3.org is bound to n1 and n2 -->{0}<x xmlns:n1=\"http://www.w3.org\"{0} xmlns:n2=\"http://www.w3.org\" >{0} <bad n1:a=\"1\" n2:a=\"2\" /></x>", Environment.NewLine), 35 }, Pri = 2 } }); } } } diff --git a/src/System.Private.Xml/tests/XmlSchema/TestFiles/TestData/xmlresolver_v4.xsd b/src/System.Private.Xml/tests/XmlSchema/TestFiles/TestData/xmlresolver_v4.xsd new file mode 100644 index 0000000000..6a0bb85743 --- /dev/null +++ b/src/System.Private.Xml/tests/XmlSchema/TestFiles/TestData/xmlresolver_v4.xsd @@ -0,0 +1,22 @@ +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="foo" xmlns="foo"> + + <xsd:import schemaLocation="include_v1_b.xsd"/> + + <xsd:complexType name="ct-A"> + <xsd:sequence minOccurs="1"> + <xsd:element name="a1" type="xsd:int" /> + <xsd:element name="a2" type="xsd:boolean" /> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="e1" type="ct-A" /> + + <xsd:element name="root"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:any namespace="##any" processContents="strict"/> + </xsd:choice> + </xsd:complexType> + </xsd:element> + +</xsd:schema>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/XmlSchema/TestFiles/TestData/xmlresolver_v5.xsd b/src/System.Private.Xml/tests/XmlSchema/TestFiles/TestData/xmlresolver_v5.xsd new file mode 100644 index 0000000000..7d2073f9e5 --- /dev/null +++ b/src/System.Private.Xml/tests/XmlSchema/TestFiles/TestData/xmlresolver_v5.xsd @@ -0,0 +1,3 @@ +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:import namespace="foo" schemaLocation="xmlresolver_v4.xsd"/> +</xsd:schema>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Reader.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Reader.cs index ba1a433c6d..f40cd2c248 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Reader.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Reader.cs @@ -2,9 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Schema.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Schema.cs index 5fd721fe7f..5269343039 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Schema.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_Schema.cs @@ -2,11 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections.Generic; using System.IO; -using System.Net; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_SchemaSet.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_SchemaSet.cs index 3c8a16ab2d..a69c1ab3f8 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_SchemaSet.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_SchemaSet.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.IO; using System.Xml.Schema; using Xunit; @@ -212,7 +211,6 @@ namespace System.Xml.Tests schemaSet1.Add(schema1); schemaSet1.Add(schema2); // added two schemas - //schemaSet1.Compile (); XmlSchemaElement elem = new XmlSchemaElement(); schema1.Items.Add(elem); // make the first schema dirty diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_URL.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_URL.cs index d945eaaab2..a68abb57b4 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_URL.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Add_URL.cs @@ -3,11 +3,7 @@ // See the LICENSE file in the project root for more information. using Xunit; -using Xunit.Abstractions; -using System; using System.IO; -using System.Net; -using System.Xml; using System.Xml.Schema; using System.Xml.XPath; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_AllowXmlAttributes.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_AllowXmlAttributes.cs index 6f6b96a35b..cbe994de71 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_AllowXmlAttributes.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_AllowXmlAttributes.cs @@ -5,7 +5,6 @@ using Xunit; using Xunit.Abstractions; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs index dac2f1e660..1f03419d69 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Compile.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Constructors.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Constructors.cs index c27f4e4e93..9ca4f8ec4f 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Constructors.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Constructors.cs @@ -4,8 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_ns.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_ns.cs index 4d2bc3a06f..174f876518 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_ns.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_ns.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_schema.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_schema.cs index b2f9e3fcd4..56eb8cb8c2 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_schema.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Contains_schema.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_CopyTo.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_CopyTo.cs index 367d63bd18..2e66417dc6 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_CopyTo.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_CopyTo.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; using System.Collections; using System.Xml.Schema; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_EnableUpaCheck.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_EnableUpaCheck.cs index 7e0ab445b2..3a25722959 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_EnableUpaCheck.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_EnableUpaCheck.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalAttributes.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalAttributes.cs index f57eaa5010..0b1b38577d 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalAttributes.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalAttributes.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalElements.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalElements.cs index d3f172ce11..30c1baac94 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalElements.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalElements.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalTypes.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalTypes.cs index ef5f93b07a..ff88bc46cc 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalTypes.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_GlobalTypes.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Imports.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Imports.cs index 7a064fae22..8e39e341cd 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Imports.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Imports.cs @@ -5,7 +5,6 @@ using Xunit; using Xunit.Abstractions; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests @@ -41,8 +40,8 @@ namespace System.Xml.Tests sc.Compile(); CError.Compare(sc.IsCompiled, true, "IsCompiled"); CError.Compare(sc.Count, param2, "Count"); - // check that schema is present in parent.Includes and its NS correct. + // check that schema is present in parent.Includes and its NS correct. foreach (XmlSchemaImport imp in parent.Includes) if (imp.SchemaLocation.Equals(param1.ToString()) && imp.Schema.TargetNamespace == (string)param3) return; @@ -104,6 +103,7 @@ namespace System.Xml.Tests CError.Compare(sc.IsCompiled, true, "Add2IsCompiled"); CError.Compare(sc.Count, 2, "Add2Count"); CError.Compare(orig.SourceUri.Contains("import_v4_b.xsd"), true, "Compare the schema object"); + // check that schema is present in parent.Includes and its NS correct. foreach (XmlSchemaImport imp in parent.Includes) if (imp.SchemaLocation.Equals("import_v4_b.xsd") && imp.Schema.TargetNamespace == null) @@ -197,6 +197,7 @@ namespace System.Xml.Tests if (imp.SchemaLocation.Equals("import_v9_b.xsd") && imp.Schema.TargetNamespace.Equals("ns-b")) found = true; if (!found) Assert.True(false); + // check that schema C in sch_b.Includes and its NS correct. foreach (XmlSchemaImport imp in sch_B.Includes) if (imp.SchemaLocation.Equals("import_v9_c.xsd") && imp.Schema.TargetNamespace.Equals("ns-c")) @@ -1526,6 +1527,7 @@ namespace System.Xml.Tests if (imp.SchemaLocation.Equals("import_v9_b.xsd") && imp.Schema.TargetNamespace.Equals("ns-b")) found = true; if (!found) Assert.True(false); + // check that schema C in sch_b.Includes and its NS correct. foreach (XmlSchemaImport imp in sch_B.Includes) if (imp.SchemaLocation.Equals("import_v9_c.xsd") && imp.Schema.TargetNamespace.Equals("ns-c")) diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Includes.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Includes.cs index c5775bd1cd..e81dd8c38d 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Includes.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Includes.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; using System.Xml.Schema; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs index 82cba77fa2..f79b8153ee 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; using System.Xml.XPath; @@ -1028,7 +1026,7 @@ namespace System.Xml.Tests } //[Variation(Desc = "615444 XmlSchema.Write ((XmlWriter)null) throws InvalidOperationException instead of ArgumenNullException")] - [Fact(Skip = "TODO: Fix NotImplementedException")] + [Fact] public void v125() { XmlSchema xs = new XmlSchema(); @@ -1072,15 +1070,15 @@ namespace System.Xml.Tests return; } - [Fact(Skip = "TODO: Fix NotImplementedException")] + [Fact] public void GetBuiltinSimpleTypeWorksAsEcpected() { Initialize(); - string xml = "<?xml version=\"1.0\" encoding=\"utf-16\"?>" + "\r\n" + - "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" + "\r\n" + - " <xs:simpleType>" + "\r\n" + - " <xs:restriction base=\"xs:anySimpleType\" />" + "\r\n" + - " </xs:simpleType>" + "\r\n" + + string xml = "<?xml version=\"1.0\" encoding=\"utf-16\"?>" + Environment.NewLine + + "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">" + Environment.NewLine + + " <xs:simpleType>" + Environment.NewLine + + " <xs:restriction base=\"xs:anySimpleType\" />" + Environment.NewLine + + " </xs:simpleType>" + Environment.NewLine + "</xs:schema>"; XmlSchema schema = new XmlSchema(); XmlSchemaSimpleType stringType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String); diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ProhibitDTD.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ProhibitDTD.cs index e663a73b01..47b2d96c45 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ProhibitDTD.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ProhibitDTD.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests @@ -184,7 +182,7 @@ namespace System.Xml.Tests } catch (XmlException) { - Assert.True(false); //exepect a validation warning for unresolvable schema location + Assert.True(false); //expect a validation warning for unresolvable schema location } CError.Compare(warningCount, 1, "Warning Count mismatch"); return; @@ -206,7 +204,7 @@ namespace System.Xml.Tests } catch (XmlException) { - Assert.True(false); //exepect a validation warning for unresolvable schema location + Assert.True(false); //expect a validation warning for unresolvable schema location } CError.Compare(warningCount, 1, "Warning Count mismatch"); return; @@ -232,7 +230,7 @@ namespace System.Xml.Tests } catch (XmlException) { - Assert.True(false); //exepect a validation warning for unresolvable schema location + Assert.True(false); //expect a validation warning for unresolvable schema location } CError.Compare(warningCount, (int)param1, "Warning Count mismatch"); CError.Compare(errorCount, 0, "Error Count mismatch"); @@ -258,7 +256,7 @@ namespace System.Xml.Tests xss.Add(schema); - // exepect a validation warning for unresolvable schema location + // expect a validation warning for unresolvable schema location CError.Compare(warningCount, 0, "Warning Count mismatch"); CError.Compare(errorCount, 0, "Error Count mismatch"); return; @@ -303,7 +301,7 @@ namespace System.Xml.Tests } catch (XmlException) { - Assert.True(false); //exepect a validation warning for unresolvable schema location + Assert.True(false); //expect a validation warning for unresolvable schema location } CError.Compare(warningCount, 0, "Warning Count mismatch"); @@ -405,7 +403,7 @@ namespace System.Xml.Tests } catch (XmlException) { - Assert.True(false); //exepect a validation warning for unresolvable schema location + Assert.True(false); //expect a validation warning for unresolvable schema location } _output.WriteLine("Count: " + xss.Count); diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Remove.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Remove.cs index 7137bf1645..d031a24a88 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Remove.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Remove.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; using System.Collections; using System.Xml.Schema; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_RemoveRecursive.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_RemoveRecursive.cs index 0d09f3130d..b4a2244ab5 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_RemoveRecursive.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_RemoveRecursive.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; using System.Collections; using System.Xml.Schema; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs index 76a83b8993..b2f113a28e 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Reprocess.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ValidationEventHandler.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ValidationEventHandler.cs index ae92af6b5f..20a349538b 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ValidationEventHandler.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_ValidationEventHandler.cs @@ -5,7 +5,6 @@ using Xunit; using Xunit.Abstractions; using System.Collections; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlNameTable.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlNameTable.cs index 8365e0cf8a..cfdda83410 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlNameTable.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlNameTable.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlResolver.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlResolver.cs index fc6e231b98..f1a9bcb7e6 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlResolver.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_XmlResolver.cs @@ -5,7 +5,6 @@ using Xunit; using Xunit.Abstractions; using System.IO; -using System.Net; using System.Xml.Schema; namespace System.Xml.Tests @@ -17,6 +16,9 @@ namespace System.Xml.Tests public TC_SchemaSet_XmlResolver(ITestOutputHelper output) { + // Make sure that we don't cache the value of the switch to enable testing + AppContext.SetSwitch("TestSwitch.LocalAppContext.DisableCaching", true); + _output = output; } @@ -94,56 +96,53 @@ namespace System.Xml.Tests return; } - // TODO: Fix - ////[Variation(Desc = "v4 - schema(Internet)->schema(Local)", Priority = 1)] - //[InlineData()] - //public int v4() - //{ - // Initialize(); - // XmlSchemaSet sc = new XmlSchemaSet(); - // sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); - // sc.Add(null, FilePathUtil.GetHttpTestDataPath() + @"/XmlSchemaCollection/xmlresolver_v4.xsd"); - // CError.Compare(sc.Count, 2, "SchemaSet count"); - // CError.Compare(bWarningCallback, false, "Warning thrown"); - // return; - //} - //todo: add these tests for local - ////[Variation(Desc = "v5 - schema(Intranet)->schema(Internet)->schema(Intranet)", Priority = 1)] - //[InlineData()] - //public int v5() - //{ - // Initialize(); - // XmlSchemaSet sc = new XmlSchemaSet(); - // sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); - // sc.Add(null, TestData._Root + "xmlresolver_v5.xsd"); - // CError.Compare(sc.Count, 3, "SchemaSet count"); - // CError.Compare(bWarningCallback, false, "Warning not thrown"); - // return; - //} - ////[Variation(Desc = "v6 - schema(Intranet)->schema(Internet)->schema(Internet)", Priority = 1)] - //[InlineData()] - //public int v6() - //{ - // Initialize(); - // XmlSchemaSet sc = new XmlSchemaSet(); - // sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); - // sc.Add(null, TestData._Root + "xmlresolver_v6_a.xsd"); - // CError.Compare(sc.Count, 3, "SchemaSet count"); - // CError.Compare(bWarningCallback, false, "Warning not thrown"); - // return; - //} - ////[Variation(Desc = "v7 - schema(Local)->schema(Internet)[->schema(Internet)][schema(Local)]", Priority = 1)] - //[InlineData()] - //public int v7() - //{ - // Initialize(); - // XmlSchemaSet sc = new XmlSchemaSet(); - // sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); - // sc.Add(null, TestData._Root + "xmlresolver_v7_a.xsd"); - // CError.Compare(sc.Count, 3, "SchemaSet count"); - // CError.Compare(bWarningCallback, false, "Warning not thrown"); - // return; - //} + //[Variation(Desc = "v4 - schema(Local)->schema(Local)", Priority = 1)] + [ActiveIssue(14064)] + [Fact] + public void v4() + { + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); + + Initialize(); + XmlSchemaSet sc = new XmlSchemaSet(); + sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); + sc.Add(null, Path.Combine(TestData._Root, "xmlresolver_v4.xsd")); + CError.Compare(sc.Count, 2, "SchemaSet count"); + CError.Compare(bWarningCallback, false, "Warning thrown"); + return; + } + + //[Variation(Desc = "v5 - schema(Local)->schema(Local)->schema(Local)", Priority = 1)] + [ActiveIssue(14064)] + [Fact] + public void v5() + { + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); + + Initialize(); + XmlSchemaSet sc = new XmlSchemaSet(); + sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); + sc.Add(null, Path.Combine(TestData._Root, "xmlresolver_v5.xsd")); + CError.Compare(sc.Count, 3, "SchemaSet count"); + CError.Compare(bWarningCallback, false, "Warning not thrown"); + return; + } + + //[Variation(Desc = "v6 - schema(Local)->schema(Local), but resolving external URI is not allowed", Priority = 1)] + [Fact] + public void v6() + { + // Make sure the switch has its default value + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", false); + + Initialize(); + XmlSchemaSet sc = new XmlSchemaSet(); + sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback); + sc.Add(null, Path.Combine(TestData._Root, "xmlresolver_v4.xsd")); + CError.Compare(sc.Count, 1, "SchemaSet count"); + CError.Compare(bWarningCallback, false, "Warning thrown"); + return; + } } } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CXmlTestResolver.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CXmlTestResolver.cs index 1134d74657..de545b2f89 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CXmlTestResolver.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CXmlTestResolver.cs @@ -2,11 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// ICredentials -using System; -using System.Net; -using System.Xml; - namespace System.Xml.Tests { // CalledResolveUri Event Args diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Constructor_AddSchema.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Constructor_AddSchema.cs index d3cb4eeeb3..eb2c7c01b2 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Constructor_AddSchema.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Constructor_AddSchema.cs @@ -2,9 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -122,7 +120,7 @@ namespace System.Xml.Tests XmlSchemaInfo info = new XmlSchemaInfo(); XmlSchemaSet sch = new XmlSchemaSet(); - //sch.Add("", TestData + "Basic.xsd"); + sch.Add("", XmlReader.Create(new StringReader("<?xml version=\"1.0\" ?>\n" + "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n" + " <xs:element name=\"root\" type=\"xs:int\" />\n" + diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CustomImplementations.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CustomImplementations.cs index 9302a67be2..e61ea67dcf 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CustomImplementations.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/CustomImplementations.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; -using System.Xml; using System.Xml.Schema; namespace System.Xml.Tests diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ExceptionVerifier.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ExceptionVerifier.cs new file mode 100644 index 0000000000..7de6f2d488 --- /dev/null +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ExceptionVerifier.cs @@ -0,0 +1,399 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Linq; +using Xunit.Abstractions; +using System.Collections; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Resources; +using System.Text.RegularExpressions; + +namespace System.Xml.Tests +{ + public class LineInfo + { + public int LineNumber { get; private set; } + + public int LinePosition { get; private set; } + + public string FilePath { get; private set; } + + public LineInfo(int lineNum, int linePos) + { + LineNumber = lineNum; + LinePosition = linePos; + FilePath = String.Empty; + } + + public LineInfo(int lineNum, int linePos, string filePath) + { + LineNumber = lineNum; + LinePosition = linePos; + FilePath = filePath; + } + } + + [Flags] + public enum ExceptionVerificationFlags + { + None = 0, + IgnoreMultipleDots = 1, + IgnoreLineInfo = 2, + } + + public class ExceptionVerifier + { + private readonly Assembly _asm; + private Assembly _locAsm; + private readonly Hashtable _resources; + + private string _actualMessage; + private string _expectedMessage; + private Exception _ex; + + private ExceptionVerificationFlags _verificationFlags = ExceptionVerificationFlags.None; + + private ITestOutputHelper _output; + + public bool IgnoreMultipleDots + { + get + { + return (_verificationFlags & ExceptionVerificationFlags.IgnoreMultipleDots) != 0; + } + set + { + if (value) + _verificationFlags = _verificationFlags | ExceptionVerificationFlags.IgnoreMultipleDots; + else + _verificationFlags = _verificationFlags & (~ExceptionVerificationFlags.IgnoreMultipleDots); + } + } + + public bool IgnoreLineInfo + { + get + { + return (_verificationFlags & ExceptionVerificationFlags.IgnoreLineInfo) != 0; + } + set + { + if (value) + _verificationFlags = _verificationFlags | ExceptionVerificationFlags.IgnoreLineInfo; + else + _verificationFlags = _verificationFlags & (~ExceptionVerificationFlags.IgnoreLineInfo); + } + } + + private const string ESCAPE_ANY = "~%anything%~"; + private const string ESCAPE_NUMBER = "~%number%~"; + + public ExceptionVerifier(string assemblyName, ExceptionVerificationFlags flags, ITestOutputHelper output) + { + _output = output; + + if (assemblyName == null) + throw new VerifyException("Assembly name cannot be null"); + + _verificationFlags = flags; + + try + { + switch (assemblyName.ToUpper()) + { + case "SYSTEM.XML": + { + var dom = new XmlDocument(); + _asm = dom.GetType().GetTypeInfo().Assembly; + } + break; + default: + _asm = Assembly.LoadFrom(Path.Combine(GetRuntimeInstallDir(), assemblyName + ".dll")); + break; + } + + if (_asm == null) + throw new VerifyException("Can not load assembly " + assemblyName); + + // let's determine if this is a loc run, if it is then we need to load satellite assembly + _locAsm = null; + if (!CultureInfo.CurrentCulture.Equals(new CultureInfo("en-US")) && !CultureInfo.CurrentCulture.Equals(new CultureInfo("en"))) + { + try + { + // load satellite assembly + _locAsm = _asm.GetSatelliteAssembly(new CultureInfo(CultureInfo.CurrentCulture.Parent.IetfLanguageTag)); + } + catch (FileNotFoundException e1) + { + _output.WriteLine(e1.ToString()); + } + catch (FileLoadException e2) + { + _output.WriteLine(e2.ToString()); + } + } + } + catch (Exception e) + { + _output.WriteLine("Exception: " + e.Message); + _output.WriteLine("Stack: " + e.StackTrace); + throw new VerifyException("Error while loading assembly"); + } + + string[] resArray; + Stream resStream = null; + var bFound = false; + + // Check that assembly manifest has resources + if (null != _locAsm) + resArray = _locAsm.GetManifestResourceNames(); + else + resArray = _asm.GetManifestResourceNames(); + + foreach (var s in resArray) + { + if (s.EndsWith(".resources")) + { + resStream = null != _locAsm ? _locAsm.GetManifestResourceStream(s) : _asm.GetManifestResourceStream(s); + bFound = true; + if (bFound && resStream != null) + { + // Populate hashtable from resources + var resReader = new ResourceReader(resStream); + if (_resources == null) + { + _resources = new Hashtable(); + } + var ide = resReader.GetEnumerator(); + while (ide.MoveNext()) + { + if (!_resources.ContainsKey(ide.Key.ToString())) + _resources.Add(ide.Key.ToString(), ide.Value.ToString()); + } + resReader.Dispose(); + } + //break; + } + } + + if (!bFound || resStream == null) + throw new VerifyException("GetManifestResourceStream() failed"); + } + + private static string GetRuntimeInstallDir() + { + // Get mscorlib path + var s = typeof(object).GetTypeInfo().Module.FullyQualifiedName; + // Remove mscorlib.dll from the path + return Directory.GetParent(s).ToString(); + } + + public ExceptionVerifier(string assemblyName, ITestOutputHelper output) + : this(assemblyName, ExceptionVerificationFlags.None, output) + { } + + private void ExceptionInfoOutput() + { + // Use reflection to obtain "res" property value + var exceptionType = _ex.GetType(); + var fInfo = exceptionType.GetField("res", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase) ?? + exceptionType.GetTypeInfo().BaseType.GetField("res", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase); + + if (fInfo == null) + throw new VerifyException("Cannot obtain Resource ID from Exception."); + + _output.WriteLine( + "\n===== Original Exception Message =====\n" + _ex.Message + + "\n===== Resource Id =====\n" + fInfo.GetValue(_ex) + + "\n===== HelpLink =====\n" + _ex.HelpLink + + "\n===== Source =====\n" + _ex.Source /*+ + "\n===== TargetSite =====\n" + ex.TargetSite + "\n"*/); + + _output.WriteLine( + "\n===== InnerException =====\n" + _ex.InnerException + + "\n===== StackTrace =====\n" + _ex.StackTrace); + } + + public string[] ReturnAllMatchingResIds(string message) + { + var ide = _resources.GetEnumerator(); + var list = new ArrayList(); + + _output.WriteLine("===== All mached ResIDs ====="); + while (ide.MoveNext()) + { + var resMessage = ide.Value.ToString(); + + resMessage = ESCAPE_ANY + Regex.Replace(resMessage, @"\{\d*\}", ESCAPE_ANY) + ESCAPE_ANY; + resMessage = MakeEscapes(resMessage).Replace(ESCAPE_ANY, ".*"); + if (Regex.Match(message, resMessage, RegexOptions.Singleline).ToString() == message) + { + list.Add(ide.Key); + _output.WriteLine(" [" + ide.Key.ToString() + "] = \"" + ide.Value.ToString() + "\""); + } + } + + return (string[])list.ToArray(typeof(string[])); + } + + // Common helper methods used by different overloads of IsExceptionOk() + private static void CheckNull(Exception e) + { + if (e == null) + { + throw new VerifyException("NULL exception passed to IsExceptionOk()"); + } + } + + private void CompareMessages() + { + if (IgnoreMultipleDots && _expectedMessage.EndsWith(".")) + _expectedMessage = _expectedMessage.TrimEnd(new char[] { '.' }) + "."; + _expectedMessage = Regex.Escape(_expectedMessage); + _expectedMessage = _expectedMessage.Replace(ESCAPE_ANY, ".*"); + _expectedMessage = _expectedMessage.Replace(ESCAPE_NUMBER, @"\d*"); + + // ignore case + _expectedMessage = _expectedMessage.ToLowerInvariant(); + _actualMessage = _actualMessage.ToLowerInvariant(); + if (Regex.Match(_actualMessage, _expectedMessage, RegexOptions.Singleline).ToString() != _actualMessage) + { + // Unescape before printing the expected message string + _expectedMessage = Regex.Unescape(_expectedMessage); + _output.WriteLine("Mismatch in error message"); + _output.WriteLine("===== Expected Message =====\n" + _expectedMessage); + _output.WriteLine("===== Expected Message Length =====\n" + _expectedMessage.Length); + _output.WriteLine("===== Actual Message =====\n" + _actualMessage); + _output.WriteLine("===== Actual Message Length =====\n" + _actualMessage.Length); + throw new VerifyException("Mismatch in error message"); + } + } + + public void IsExceptionOk(Exception e, string expectedResId) + { + CheckNull(e); + _ex = e; + if (expectedResId == null) + { + // Pint actual exception info and quit + // This can be used to dump exception properties, verify them and then plug them into our expected results + ExceptionInfoOutput(); + throw new VerifyException("Did not pass resource ID to verify"); + } + + IsExceptionOk(e, new object[] { expectedResId }); + } + + public void IsExceptionOk(Exception e, string expectedResId, string[] paramValues) + { + var list = new ArrayList { expectedResId }; + + foreach (var param in paramValues) + list.Add(param); + + IsExceptionOk(e, list.ToArray()); + } + + public void IsExceptionOk(Exception e, string expectedResId, string[] paramValues, LineInfo lineInfo) + { + var list = new ArrayList { expectedResId, lineInfo }; + + foreach (var param in paramValues) + list.Add(param); + + IsExceptionOk(e, list.ToArray()); + } + + public void IsExceptionOk(Exception e, object[] IdsAndParams) + { + CheckNull(e); + _ex = e; + + _actualMessage = e.Message; + _expectedMessage = ConstructExpectedMessage(IdsAndParams); + + CompareMessages(); + } + + private static string MakeEscapes(string str) + { + return new[] { "\\", "$", "{", "[", "(", "|", ")", "*", "+", "?" }.Aggregate(str, (current, esc) => current.Replace(esc, "\\" + esc)); + } + + public string ConstructExpectedMessage(object[] IdsAndParams) + { + var lineInfoMessage = ""; + var paramList = new ArrayList(); + var paramsStartPosition = 1; + + // Verify that input list contains at least one element - ResId + if (IdsAndParams.Length == 0 || !(IdsAndParams[0] is string)) + throw new VerifyException("ResID at IDsAndParams[0] missing!"); + string expectedResId = (IdsAndParams[0] as string); + + // Verify that resource id exists in resources + if (!_resources.ContainsKey(expectedResId)) + { + ExceptionInfoOutput(); + throw new VerifyException("Resources in [" + _asm.GetName().Name + "] does not contain string resource: " + expectedResId); + } + + // If LineInfo exist, construct LineInfo message + if (IdsAndParams.Length > 1 && (IdsAndParams[1] is LineInfo)) + { + if (!IgnoreLineInfo) + { + var lineInfo = (IdsAndParams[1] as LineInfo); + + // Xml_ErrorPosition = "Line {0}, position {1}." + lineInfoMessage = String.IsNullOrEmpty(lineInfo.FilePath) ? _resources["Xml_ErrorPosition"].ToString() : _resources["Xml_ErrorFilePosition"].ToString(); + + var lineNumber = lineInfo.LineNumber.ToString(); + var linePosition = lineInfo.LinePosition.ToString(); + lineInfoMessage = String.IsNullOrEmpty(lineInfo.FilePath) ? String.Format(lineInfoMessage, lineNumber, linePosition) : String.Format(lineInfoMessage, lineInfo.FilePath, lineNumber, linePosition); + } + else + lineInfoMessage = ESCAPE_ANY; + + lineInfoMessage = " " + lineInfoMessage; + paramsStartPosition = 2; + } + + string message = _resources[expectedResId].ToString(); + for (var i = paramsStartPosition; i < IdsAndParams.Length; i++) + { + if (IdsAndParams[i] is object[]) + paramList.Add(ConstructExpectedMessage(IdsAndParams[i] as object[])); + else + { + if (IdsAndParams[i] == null) + paramList.Add(ESCAPE_ANY); + else + paramList.Add(IdsAndParams[i] as string); + } + } + + try + { + message = string.Format(message, paramList.ToArray()); + } + catch (FormatException) + { + throw new VerifyException("Mismatch in number of parameters!"); + } + + return message + lineInfoMessage; + } + } + + public class VerifyException : Exception + { + public VerifyException(string msg) + : base(msg) + { } + } +}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedAttributes.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedAttributes.cs index 4543403701..8c3acdfbc2 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedAttributes.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedAttributes.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.Collections; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedParticles.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedParticles.cs index b97c3c5ea4..5fe8e6bd6a 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedParticles.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/GetExpectedParticles.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Initialize_EndValidation.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Initialize_EndValidation.cs index ef16fd4a38..79b5b9d76a 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Initialize_EndValidation.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/Initialize_EndValidation.cs @@ -2,9 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -16,9 +14,12 @@ namespace System.Xml.Tests public class TCInitialize : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCInitialize(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -230,9 +231,23 @@ namespace System.Xml.Tests break; } } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, (string)null); + switch (typeToValidate) + { + case "other": + _exVerifier.IsExceptionOk(e, "Sch_SchemaElementNameMismatch", new string[] { "PartialElement2", "PartialElement" }); + break; + case "type": + _exVerifier.IsExceptionOk(e, "Sch_SchemaElementNameMismatch", new string[] { "foo", "PartialElement" }); + break; + case "attribute": + _exVerifier.IsExceptionOk(e, "Sch_ValidateAttributeInvalidCall"); + break; + default: + Assert.True(false); + break; + } return; } @@ -285,10 +300,6 @@ namespace System.Xml.Tests val.ValidateElement("foo", "", info, "PartialType2", null, null, null); break; - case "element": - val.ValidateElement("PartialElement", "", info); - break; - case "attribute": val.ValidateAttribute("PartialAttribute", "", StringGetter("123"), info); break; @@ -298,10 +309,20 @@ namespace System.Xml.Tests break; } } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, (string)null); - + switch (typeToValidate) + { + case "other": + _exVerifier.IsExceptionOk(e, "Sch_XsiTypeBlockedEx", new string[] { "PartialType2", "foo" }); + break; + case "attribute": + _exVerifier.IsExceptionOk(e, "Sch_ValidateAttributeInvalidCall"); + break; + default: + Assert.True(false); + break; + } return; } @@ -391,10 +412,23 @@ namespace System.Xml.Tests break; } } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, (string)null); - + switch (typeToValidate) + { + case "other": + _exVerifier.IsExceptionOk(e, "Sch_SchemaAttributeNameMismatch", new string[] { "PartialAttribute2", "PartialAttribute" }); + break; + case "element": + _exVerifier.IsExceptionOk(e, "Sch_ValidateElementInvalidCall"); + break; + case "type": + _exVerifier.IsExceptionOk(e, "Sch_ValidateElementInvalidCall"); + break; + default: + Assert.True(false); + break; + } return; } @@ -459,7 +493,7 @@ namespace System.Xml.Tests if (typeToValidate == "text") val.ValidateText(StringGetter("foo")); else - val.ValidateWhitespace(StringGetter("\r\n\t ")); + val.ValidateWhitespace(StringGetter(Environment.NewLine + "\t ")); return; } @@ -470,9 +504,12 @@ namespace System.Xml.Tests public class TCEndValidation : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCEndValidation(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -559,9 +596,9 @@ namespace System.Xml.Tests val.EndValidation(); Assert.True(false); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_UndeclaredId", new string[] { "a3" }); + _exVerifier.IsExceptionOk(e, "Sch_UndeclaredId", new string[] { "a3" }); return; } } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/PropertiesTests.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/PropertiesTests.cs index 8e3a4138ed..250e7d2bff 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/PropertiesTests.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/PropertiesTests.cs @@ -2,10 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -17,9 +15,12 @@ namespace System.Xml.Tests public class TCXmlResolver : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCXmlResolver(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } //BUG #304124 @@ -181,9 +182,9 @@ namespace System.Xml.Tests val.ValidateElement("bar", "", null, "t:type1", null, "uri:tempuri " + Path.Combine(TestData, XSDFILE_TARGET_NAMESPACE), null); Assert.True(false); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_XsiTypeNotFound", new string[] { "uri:tempuri:type1" }); + _exVerifier.IsExceptionOk(e, "Sch_XsiTypeNotFound", new string[] { "uri:tempuri:type1" }); return; } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests.csproj b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests.csproj index cfe9b0c7c6..7a2b4cdf72 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests.csproj +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/System.Xml.XmlSchema.XmlSchemaValidatorApi.Tests.csproj @@ -18,6 +18,7 @@ <ItemGroup> <Compile Include="Constructor_AddSchema.cs" /> <Compile Include="CustomImplementations.cs" /> + <Compile Include="ExceptionVerifier.cs" /> <Compile Include="GetExpectedAttributes.cs" /> <Compile Include="GetExpectedParticles.cs" /> <Compile Include="Initialize_EndValidation.cs" /> @@ -39,7 +40,6 @@ </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\..\System.Private.Xml\pkg\System.Private.Xml.pkgproj" /> - <ProjectReference Include="..\..\..\..\Microsoft.Win32.Registry\pkg\Microsoft.Win32.Registry.pkgproj" /> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> </Project>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute.cs index c003373a25..a05bc159cb 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute.cs @@ -2,10 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -17,9 +15,12 @@ namespace System.Xml.Tests public class TCValidateAttribute : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateAttribute(ITestOutputHelper output) : base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Theory] @@ -188,9 +189,9 @@ namespace System.Xml.Tests { val.ValidateAttribute("RequiredAttribute", "", StringGetter("foo"), info); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_DuplicateAttribute", new string[] { "RequiredAttribute" }); + _exVerifier.IsExceptionOk(e, "Sch_DuplicateAttribute", new string[] { "RequiredAttribute" }); return; } @@ -368,9 +369,12 @@ namespace System.Xml.Tests public class TCValidateEndOfAttributes : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateEndOfAttributes(ITestOutputHelper output) : base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -445,9 +449,9 @@ namespace System.Xml.Tests { val.ValidateEndOfAttributes(null); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_MissRequiredAttribute", new string[] { "RequiredAttribute" }); + _exVerifier.IsExceptionOk(e, "Sch_MissRequiredAttribute", new string[] { "RequiredAttribute" }); return; } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute_String.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute_String.cs index 308c69fb11..aa342d5eb6 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute_String.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateAttribute_String.cs @@ -2,10 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -17,9 +15,12 @@ namespace System.Xml.Tests public class TCValidateAttribute_String : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateAttribute_String(ITestOutputHelper output) : base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Theory] @@ -188,9 +189,9 @@ namespace System.Xml.Tests { val.ValidateAttribute("RequiredAttribute", "", "foo", info); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_DuplicateAttribute", new string[] { "RequiredAttribute" }); + _exVerifier.IsExceptionOk(e, "Sch_DuplicateAttribute", new string[] { "RequiredAttribute" }); return; } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateElement.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateElement.cs index 1e28b1a2a7..fb47e7b2af 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateElement.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateElement.cs @@ -2,10 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -17,9 +15,12 @@ namespace System.Xml.Tests public class TCValidateElement : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateElement(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Theory] @@ -87,9 +88,9 @@ namespace System.Xml.Tests else val.ValidateElement("$$##", "", null, null, null, null, null); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_UndeclaredElement", new string[] { "$$##" }); + _exVerifier.IsExceptionOk(e, "Sch_UndeclaredElement", new string[] { "$$##" }); return; } @@ -198,7 +199,7 @@ namespace System.Xml.Tests else { Assert.True(holder.IsCalledA); - //XmlExceptionVerifier.IsExceptionOk(holder.lastException); + _exVerifier.IsExceptionOk(holder.lastException, "Sch_XsiTypeNotFound", new string[] { "uri:tempuri:type1" }); } return; @@ -233,7 +234,7 @@ namespace System.Xml.Tests else { Assert.True(holder.IsCalledA); - //XmlExceptionVerifier.IsExceptionOk(holder.lastException); + _exVerifier.IsExceptionOk(holder.lastException, "Sch_XsiTypeNotFound", new string[] { "type1" }); } return; @@ -257,11 +258,11 @@ namespace System.Xml.Tests { val.ValidateEndElement(info); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, new object[] { "Sch_IncompleteContentExpecting", - // new object[] { "Sch_ElementName", "NillableElement" }, - // new object[] { "Sch_ElementName", "foo" } }); + _exVerifier.IsExceptionOk(e, new object[] { "Sch_IncompleteContentExpecting", + new object[] { "Sch_ElementName", "NillableElement" }, + new object[] { "Sch_ElementName", "foo" } }); return; } @@ -322,9 +323,9 @@ namespace System.Xml.Tests { val.ValidateElement("foo", "uri:tempuri", null, "type1", null, null, null); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_XsiTypeNotFound", new string[] { "type1" }); + _exVerifier.IsExceptionOk(e, "Sch_XsiTypeNotFound", new string[] { "type1" }); return; } Assert.True(false); @@ -356,7 +357,7 @@ namespace System.Xml.Tests Assert.True(holder.IsCalledA); Assert.Equal(holder.lastSeverity, XmlSeverityType.Warning); - //XmlExceptionVerifier.IsExceptionOk(holder.lastException, "Sch_CannotLoadSchema", new string[] { "uri:tempuri", null }); + _exVerifier.IsExceptionOk(holder.lastException, "Sch_CannotLoadSchema", new string[] { "uri:tempuri", null }); return; } @@ -384,7 +385,7 @@ namespace System.Xml.Tests Assert.True(holder.IsCalledA); Assert.Equal(holder.lastSeverity, XmlSeverityType.Warning); - //XmlExceptionVerifier.IsExceptionOk(holder.lastException, "Sch_CannotLoadSchema", new string[] { "", null }); + _exVerifier.IsExceptionOk(holder.lastException, "Sch_CannotLoadSchema", new string[] { "", null }); return; } @@ -405,7 +406,7 @@ namespace System.Xml.Tests Assert.True(holder.IsCalledA); Assert.Equal(holder.lastSeverity, XmlSeverityType.Warning); - //XmlExceptionVerifier.IsExceptionOk(holder.lastException, "Sch_NoElementSchemaFound", new string[] { "undefined" }); + _exVerifier.IsExceptionOk(holder.lastException, "Sch_NoElementSchemaFound", new string[] { "undefined" }); return; } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs index c319a5435e..f1d15548d1 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateMisc.cs @@ -2,10 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.IO; using System.Text.RegularExpressions; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_EndElement.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_EndElement.cs index 02db6dea69..dd81c604d0 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_EndElement.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_EndElement.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -14,9 +13,12 @@ namespace System.Xml.Tests public class TCValidateText : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateText(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -133,11 +135,11 @@ namespace System.Xml.Tests { val.ValidateText(StringGetter("some text")); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, new object[] { "Sch_InvalidTextInElementExpecting", - // new object[] { "Sch_ElementName", "ElementOnlyElement" }, - // new object[] { "Sch_ElementName", "child" } }); + _exVerifier.IsExceptionOk(e, new object[] { "Sch_InvalidTextInElementExpecting", + new object[] { "Sch_ElementName", "ElementOnlyElement" }, + new object[] { "Sch_ElementName", "child" } }); return; } @@ -158,9 +160,9 @@ namespace System.Xml.Tests { val.ValidateText(StringGetter("some text")); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_InvalidTextInEmpty"); + _exVerifier.IsExceptionOk(e, "Sch_InvalidTextInEmpty"); return; } @@ -173,9 +175,12 @@ namespace System.Xml.Tests public class TCValidateWhitespace : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateWhitespace(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -205,7 +210,7 @@ namespace System.Xml.Tests val.ValidationEventHandler += new ValidationEventHandler(holder.CallbackA); val.Initialize(); - val.ValidateWhitespace(StringGetter(" \t\r\n")); + val.ValidateWhitespace(StringGetter(" \t" + Environment.NewLine)); val.EndValidation(); Assert.True(!holder.IsCalledA); @@ -226,13 +231,13 @@ namespace System.Xml.Tests val.ValidateElement("ElementOnlyElement", "", info); val.ValidateEndOfAttributes(null); - val.ValidateWhitespace(StringGetter(" \t\r\n")); + val.ValidateWhitespace(StringGetter(" \t"+ Environment.NewLine)); val.ValidateElement("child", "", info); val.ValidateEndOfAttributes(null); val.ValidateEndElement(info); - val.ValidateWhitespace(StringGetter(" \t\r\n")); + val.ValidateWhitespace(StringGetter(" \t" + Environment.NewLine)); val.ValidateEndElement(info); val.EndValidation(); @@ -256,11 +261,11 @@ namespace System.Xml.Tests try { - val.ValidateWhitespace(StringGetter(" \r\n\t")); + val.ValidateWhitespace(StringGetter(" " + Environment.NewLine + "\t")); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_InvalidWhitespaceInEmpty"); + _exVerifier.IsExceptionOk(e, "Sch_InvalidWhitespaceInEmpty"); return; } @@ -282,7 +287,7 @@ namespace System.Xml.Tests } catch (Exception) // Replace with concrete exception type { - // Verify exception + // Verify exception ???? Assert.True(false); } @@ -295,9 +300,12 @@ namespace System.Xml.Tests public class TCValidateEndElement : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateEndElement(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -474,9 +482,9 @@ namespace System.Xml.Tests { val.ValidateEndElement(info, "23"); } - catch (InvalidOperationException) + catch (InvalidOperationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_InvalidEndElementCall"); + _exVerifier.IsExceptionOk(e, "Sch_InvalidEndElementCall"); return; } @@ -606,9 +614,9 @@ namespace System.Xml.Tests val.ValidateEndElement(info); Assert.True(false); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_DuplicateKey", new string[] { "1", "numberKey" }); + _exVerifier.IsExceptionOk(e, "Sch_DuplicateKey", new string[] { "1", "numberKey" }); return; } } @@ -624,9 +632,9 @@ namespace System.Xml.Tests val.ValidateEndElement(info); Assert.True(false); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_UnresolvedKeyref", new string[] { "3", "numberKey" }); + _exVerifier.IsExceptionOk(e, "Sch_UnresolvedKeyref", new string[] { "3", "numberKey" }); return; } } @@ -711,9 +719,9 @@ namespace System.Xml.Tests { val.ValidateEndElement(info, "23"); } - catch (InvalidOperationException) + catch (InvalidOperationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, (string)null); + _exVerifier.IsExceptionOk(e, "Sch_InvalidEndElementCallTyped"); return; } @@ -726,9 +734,12 @@ namespace System.Xml.Tests public class TCSkipToEndElement : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCSkipToEndElement(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -838,9 +849,9 @@ namespace System.Xml.Tests { val.SkipToEndElement(info); } - catch (InvalidOperationException) + catch (InvalidOperationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_InvalidEndElementMultiple", new string[] { "SkipToEndElement" }); + _exVerifier.IsExceptionOk(e, "Sch_InvalidEndElementMultiple", new string[] { "SkipToEndElement" }); return; } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_String.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_String.cs index 52b589c944..ddc3ca1de2 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_String.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateText_String.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; @@ -14,9 +13,12 @@ namespace System.Xml.Tests public class TCValidateText_String : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; + public TCValidateText_String(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -135,11 +137,11 @@ namespace System.Xml.Tests { val.ValidateText("some text"); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, new object[] { "Sch_InvalidTextInElementExpecting", - // new object[] { "Sch_ElementName", "ElementOnlyElement" }, - // new object[] { "Sch_ElementName", "child" } }); + _exVerifier.IsExceptionOk(e, new object[] { "Sch_InvalidTextInElementExpecting", + new object[] { "Sch_ElementName", "ElementOnlyElement" }, + new object[] { "Sch_ElementName", "child" } }); return; } @@ -160,9 +162,9 @@ namespace System.Xml.Tests { val.ValidateText("some text"); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_InvalidTextInEmpty"); + _exVerifier.IsExceptionOk(e, "Sch_InvalidTextInEmpty"); return; } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateWhitespace_String.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateWhitespace_String.cs index c5c26eb789..4c715b2b11 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateWhitespace_String.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidateWhitespace_String.cs @@ -14,9 +14,11 @@ namespace System.Xml.Tests public class TCValidateWhitespace_String : CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; + private ExceptionVerifier _exVerifier; public TCValidateWhitespace_String(ITestOutputHelper output): base(output) { _output = output; + _exVerifier = new ExceptionVerifier("System.Xml", _output); } [Fact] @@ -46,7 +48,7 @@ namespace System.Xml.Tests val.ValidationEventHandler += new ValidationEventHandler(holder.CallbackA); val.Initialize(); - val.ValidateWhitespace(" \t\r\n"); + val.ValidateWhitespace(" \t" + Environment.NewLine); val.EndValidation(); Assert.True(!holder.IsCalledA); @@ -67,13 +69,13 @@ namespace System.Xml.Tests val.ValidateElement("ElementOnlyElement", "", info); val.ValidateEndOfAttributes(null); - val.ValidateWhitespace(" \t\r\n"); + val.ValidateWhitespace(" \t" + Environment.NewLine); val.ValidateElement("child", "", info); val.ValidateEndOfAttributes(null); val.ValidateEndElement(info); - val.ValidateWhitespace(" \t\r\n"); + val.ValidateWhitespace(" \t" + Environment.NewLine); val.ValidateEndElement(info); val.EndValidation(); @@ -97,11 +99,11 @@ namespace System.Xml.Tests try { - val.ValidateWhitespace(" \r\n\t"); + val.ValidateWhitespace(" " + Environment.NewLine + "\t"); } - catch (XmlSchemaValidationException) + catch (XmlSchemaValidationException e) { - //XmlExceptionVerifier.IsExceptionOk(e, "Sch_InvalidWhitespaceInEmpty"); + _exVerifier.IsExceptionOk(e, "Sch_InvalidWhitespaceInEmpty"); return; } diff --git a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidatorModule.cs b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidatorModule.cs index 278bdb66e4..8eaf9118f9 100644 --- a/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidatorModule.cs +++ b/src/System.Private.Xml/tests/XmlSchema/XmlSchemaValidatorApi/ValidatorModule.cs @@ -2,16 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.IO; -using System.Xml; using System.Xml.Schema; using Xunit; using Xunit.Abstractions; namespace System.Xml.Tests { - public class CXmlSchemaValidatorTestCase //: CTestCase + public class CXmlSchemaValidatorTestCase { private ITestOutputHelper _output; public CXmlSchemaValidatorTestCase(ITestOutputHelper output) diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/398968repro.xsl b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/398968repro.xsl new file mode 100644 index 0000000000..6276032f19 --- /dev/null +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/398968repro.xsl @@ -0,0 +1,9 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:output omit-xml-declaration="yes"/> + +<xsl:template match="/"> + <xsl:copy-of select="document('Stra%C3%9Fe.xml')"/> +</xsl:template> + +</xsl:stylesheet> diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/Straße.xml b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/Straße.xml new file mode 100644 index 0000000000..74d9a6d378 --- /dev/null +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/Straße.xml @@ -0,0 +1 @@ +<foo></foo> diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings11.xsl b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings11.xsl new file mode 100644 index 0000000000..7d939717af --- /dev/null +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings11.xsl @@ -0,0 +1,7 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:output method="html" /> + +<xsl:template match="/"> +<xsl:value-of select="document('http://IDontExist/IDontExist.xml', //book)"/> +</xsl:template> +</xsl:stylesheet>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings14-inc.xsl b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings14-inc.xsl new file mode 100644 index 0000000000..0b8e95d06f --- /dev/null +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings14-inc.xsl @@ -0,0 +1,7 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:template match="/"> + <xsl:value-of select="document('http://IDontExist/IDontExist.xml')"/> +</xsl:template> + +</xsl:stylesheet>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings14.xsl b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings14.xsl new file mode 100644 index 0000000000..fb97ffd16b --- /dev/null +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings14.xsl @@ -0,0 +1,4 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:include href="XsltSettings14-inc.xsl"/> + +</xsl:stylesheet>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings15.xsl b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings15.xsl new file mode 100644 index 0000000000..1bded055cb --- /dev/null +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings15.xsl @@ -0,0 +1,11 @@ +<!DOCTYPE xsl:stylesheet [ +<!ENTITY doc "document('http://webxtest/testcases/books.xml')"> +]> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:output method="html" /> + +<xsl:template match="/"> +<xsl:value-of select="&doc;"/> +</xsl:template> + +</xsl:stylesheet>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings9.xsl b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings9.xsl new file mode 100644 index 0000000000..92acf0d1f6 --- /dev/null +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/XsltSettings9.xsl @@ -0,0 +1,8 @@ +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:output method="html" /> + +<xsl:template match="/"> +<xsl:value-of select="document('http://IDontExist/IDontExist.xml')//book[1]/title"/> +</xsl:template> +</xsl:stylesheet> + diff --git a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/xmlResolver_document_function_absolute_uri.xsl b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/xmlResolver_document_function_absolute_uri.xsl index b38664f1f8..855b041e9e 100644 --- a/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/xmlResolver_document_function_absolute_uri.xsl +++ b/src/System.Private.Xml/tests/Xslt/TestFiles/TestData/XsltApiV2/xmlResolver_document_function_absolute_uri.xsl @@ -4,7 +4,7 @@ <result> - <xsl:for-each select="document('c:\\temp\\xmlResolver_document_function.xml')//elem"> + <xsl:for-each select="document('ABSOLUTE_URI')//elem"> <xsl:value-of select="."/> </xsl:for-each> diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs index d73e583128..801828a959 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Errata4.cs @@ -4,11 +4,9 @@ using Xunit; using Xunit.Abstractions; -using System; using System.Collections.Generic; using System.IO; using System.Text; -using System.Xml; using System.Xml.Xsl; using XmlCoreTest.Common; using OLEDB.Test.ModuleCore; @@ -122,7 +120,6 @@ namespace System.Xml.Tests #endregion private const string createElementsXsltInline = ... - [ActiveIssue(9877)] //[Variation(Priority = 1, Desc = "Crate elment/attribute :: Invalid start name char", Params = new object[] { false, CharType.NameStartChar })] [InlineData(false, CharType.NameStartChar)] //[Variation(Priority = 1, Desc = "Crate elment/attribute :: Invalid name char", Params = new object[] { false, CharType.NameChar })] @@ -145,6 +142,7 @@ namespace System.Xml.Tests //[Variation(Priority = 0, Desc = "Crate elment/attribute :: Valid name CharType.NameStartSurrogateLowChar", Params = new object[] { true, CharType.NameStartSurrogateLowChar })] //[Variation(Priority = 0, Desc = "Crate elment/attribute :: Valid name CharType.NameSurrogateHighChar", Params = new object[] { true, CharType.NameSurrogateHighChar })] //[Variation(Priority = 0, Desc = "Crate elment/attribute :: Valid name CharType.NameSurrogateLowChar", Params = new object[] { true, CharType.NameSurrogateLowChar })] + [OuterLoop] [Theory] public void CreateElementsAndAttributesUsingXsltAndXPath(object param0, object param1) { @@ -155,7 +153,7 @@ namespace System.Xml.Tests string charsToChooseFrom = isValidChar ? UnicodeCharHelper.GetValidCharacters(charType) : UnicodeCharHelper.GetInvalidCharacters(charType); Assert.True(charsToChooseFrom.Length > 0); - foreach (bool enableDebug in new bool[] { /*true,*/ false }) //ActiveIssue(10023) + foreach (bool enableDebug in new bool[] { /*true,*/ false }) // XSLT debugging not supported in Core { XslCompiledTransform transf = new XslCompiledTransform(enableDebug); using (XmlReader r = XmlReader.Create(new StringReader(createElementsXsltAndXpath))) transf.Load(r); @@ -185,7 +183,6 @@ namespace System.Xml.Tests return; } - [ActiveIssue(9877)] //[Variation(Priority = 1, Desc = "Crate elment/attribute (Inline) :: Invalid start name char", Params = new object[] { false, CharType.NameStartChar })] [InlineData(false, CharType.NameStartChar)] //[Variation(Priority = 1, Desc = "Crate elment/attribute (Inline) :: Invalid name char", Params = new object[] { false, CharType.NameChar })] @@ -208,6 +205,7 @@ namespace System.Xml.Tests //[Variation(Priority = 0, Desc = "Crate elment/attribute (Inline) :: Valid name CharType.NameStartSurrogateLowChar", Params = new object[] { true, CharType.NameStartSurrogateLowChar })] //[Variation(Priority = 0, Desc = "Crate elment/attribute (Inline) :: Valid name CharType.NameSurrogateHighChar", Params = new object[] { true, CharType.NameSurrogateHighChar })] //[Variation(Priority = 0, Desc = "Crate elment/attribute (Inline) :: Valid name CharType.NameSurrogateLowChar", Params = new object[] { true, CharType.NameSurrogateLowChar })] + [OuterLoop] [Theory] public void CreateElementsAndAttributesUsingXsltInline(object param0, object param1) { @@ -219,7 +217,7 @@ namespace System.Xml.Tests string charsToChooseFrom = isValidChar ? UnicodeCharHelper.GetValidCharacters(charType) : UnicodeCharHelper.GetInvalidCharacters(charType); Assert.True(charsToChooseFrom.Length > 0); - foreach (bool enableDebug in new bool[] { /*true,*/ false }) //ActiveIssue(10023) + foreach (bool enableDebug in new bool[] { /*true,*/ false }) // XSLT debugging not supported in Core { foreach (string name in FuzzNames(!isValidChar, charType, numOfRepeat)) { @@ -268,7 +266,6 @@ namespace System.Xml.Tests } } - [ActiveIssue(9877)] //[Variation(Priority = 1, Desc = "Invalid start name char", Params = new object[] { false, CharType.NameStartChar })] [InlineData(false, CharType.NameStartChar)] //[Variation(Priority = 1, Desc = "Invalid name char", Params = new object[] { false, CharType.NameChar })] @@ -380,7 +377,7 @@ namespace System.Xml.Tests } } - public /*override*/ new int Init(object objParam) + public new int Init(object objParam) { return 1; } diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs index 72b332f6de..710eb6ba2c 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/OutputSettings.cs @@ -4,10 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System.Globalization; using System.IO; -using System.Xml; -using System.Xml.XmlDiff; using System.Xml.Xsl; using System.Text; @@ -183,7 +180,7 @@ namespace System.Xml.Tests //[Variation(id = 18, Desc = "Verify Encoding set to windows-1252 explicitly, expected windows-1252", Pri = 1, Params = new object[] { "books.xml", "Encoding4.xsl", "windows-1252", "Encoding must be windows-1252" })] [InlineData("books.xml", "Encoding4.xsl", "windows-1252", "Encoding must be windows-1252")] [Theory] - public void OS6_ActiveIssue9877(object param0, object param1, object param2, object param3) + public void OS6_Windows1252Encoding(object param0, object param1, object param2, object param3) { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); OS6(param0, param1, param2, param3); diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Program.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Program.cs deleted file mode 100644 index bdf4e94387..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using ModuleCore; - -namespace XmlTests -{ - internal class Program - { - public static int Main() - { - string args = @"DocType:[DOCTYPE] trace:false Host:[Host]"; - return 100 + TestRunner.Execute(args); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs index c1e3ffddd2..c50d590ba3 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/TempFiles.cs @@ -4,444 +4,162 @@ using Xunit; using Xunit.Abstractions; -using System; -using System.CodeDom.Compiler; using System.IO; -using System.Xml; using System.Xml.Xsl; namespace System.Xml.Tests { - // TODO: BinCompat - this is testing API which is currently not available - re-enable if it is back - // //[TestCase(Name = "TemporaryFiles", Desc = "This testcase tests the Temporary Files property on XslCompiledTransform")] - // public class TempFiles : XsltApiTestCaseBase2 - // { - // private XslCompiledTransform _xsl = null; - // private string _xmlFile = string.Empty; - // private string _xslFile = string.Empty; - - // private ITestOutputHelper _output; - // public TempFiles(ITestOutputHelper output) : base(output) - // { - // _output = output; - // } - - // private void Init(string xmlFile, string xslFile, bool enableDebug) - // { - // if (enableDebug) - // _xsl = new XslCompiledTransform(true); - // else - // _xsl = new XslCompiledTransform(false); - - // _xmlFile = FullFilePath(xmlFile); - // _xslFile = FullFilePath(xslFile); - - // return; - // } - - // private StringWriter Transform() - // { - // StringWriter sw = new StringWriter(); - // _xsl.Transform(_xmlFile, null, sw); - // return sw; - // } - - // private void VerifyResult(object actual, object expected, string message) - // { - // _output.WriteLine("Expected : {0}", expected); - // _output.WriteLine("Actual : {0}", actual); - - // Assert.Equal(actual, expected); - // } - - // private void VerifyResult(bool expression, string message) - // { - // Assert.True(expression); - // } - - // //[Variation(id = 1, Desc = "Default value of TemporaryFiles before load, expected null", Pri = 0)] - // [InlineData()] - // [Theory] - // public void TempFiles1() - // { - // XslCompiledTransform xslt = new XslCompiledTransform(); - // VerifyResult(xslt.TemporaryFiles, null, "Default value of TemporaryFiles must be null"); - // } - - // //[Variation(id = 2, Desc = "TemporaryFiles after load in Retail Mode with no script block, expected count = 0", Pri = 0, Params = new object[] { "books.xml", "NoScripts.xsl", false })] - // [InlineData("books.xml", "NoScripts.xsl", false, 2)] - // //[Variation(id = 3, Desc = "TemporaryFiles after load in Debug Mode with no script block, expected count = 0", Pri = 0, Params = new object[] { "books.xml", "NoScripts.xsl", true })] - // [InlineData("books.xml", "NoScripts.xsl", true, 3)] - // [Theory] - // public void TempFiles2(object param0, object param1, object param2, object id) - // { - // if (_isInProc && (int)id == 3) - // return; //TEST_SKIPPED; - - // Init(param0.ToString(), param1.ToString(), (bool)param2); - // _xsl.Load(_xslFile); - - // VerifyResult(_xsl.TemporaryFiles.Count, 0, "There should be no temp files generated, when there are no script block"); - // } - - // //[Variation(id = 4, Desc = "TemporaryFiles after load in Retail Mode with script block and EnableScript", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", false })] - // [ActiveIssue(9873)] - // [InlineData("books.xml", "TempFiles.xsl", false)] - // [Theory] - // public void TempFiles3(object param0, object param1, object param2) - // { - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // if (_isInProc) - // return; //TEST_SKIPPED; - - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - - // //In retail mode temporary files are not generated if a script block exist - // VerifyResult(_xsl.TemporaryFiles.Count, 0, "TemporaryFiles generated in retail mode"); - // } - - // //[Variation(id = 5, Desc = "TemporaryFiles after load in Debug Mode with script block and EnableScript", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", true })] - // [ActiveIssue(9873)] - // [InlineData("books.xml", "TempFiles.xsl", true)] - // [Theory] - // public void TempFiles3AndHalf(object param0, object param1, object param2) - // { - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // if (_isInProc) - // return; //TEST_SKIPPED; - - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - - // //In debug mode temporary files are generated if a script block exist - // //An extra .pdb info is generated if debugging is enabled - // VerifyResult(_xsl.TemporaryFiles.Count > 0, "TemporaryFiles must be generated when there is a script block"); - // } - - // //[Variation(id = 6, Desc = "TemporaryFiles after load in retail mode with script block and default settings", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", false })] - // [InlineData("books.xml", "TempFiles.xsl", false, 6)] - // //[Variation(id = 7, Desc = "TemporaryFiles after load in debug mode with script block and default settings", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", true })] - // [InlineData("books.xml", "TempFiles.xsl", true, 7)] - // [Theory] - // public void TempFiles4(object param0, object param1, object param2, object id) - // { - // if (_isInProc && (int)id == 7) - // return; //TEST_SKIPPED; - - // Init(param0.ToString(), param1.ToString(), (bool)param2); - // _xsl.Load(_xslFile, XsltSettings.Default, new XmlUrlResolver()); - - // VerifyResult(_xsl.TemporaryFiles.Count, 0, "TemporaryFiles must not be generated, when XsltSettings is None"); - // } - - // //[Variation(id = 8, Desc = "TemporaryFiles after load in retail mode with script block and EnableDocumentFunction", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", false })] - // [InlineData("books.xml", "TempFiles.xsl", false, 8)] - // //[Variation(id = 9, Desc = "TemporaryFiles after load in debug mode with script block and EnableDocumentFunction", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", true })] - // [InlineData("books.xml", "TempFiles.xsl", true, 9)] - // [Theory] - // public void TempFiles5(object param0, object param1, object param2, object id) - // { - // if (_isInProc && (int)id == 9) - // return; //TEST_SKIPPED; - - // Init(param0.ToString(), param1.ToString(), (bool)param2); - // _xsl.Load(_xslFile, new XsltSettings(true, false), new XmlUrlResolver()); - - // VerifyResult(_xsl.TemporaryFiles.Count, 0, "TemporaryFiles must not be generated, when XsltSettings is EnableDocumentFunction alone"); - // } - - // //[Variation(id = 10, Desc = "Verify the existence of TemporaryFiles after load in debug mode with script block", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", true })] - // [ActiveIssue(9873)] - // [InlineData("books.xml", "TempFiles.xsl", true)] - // [Theory] - // public void TempFiles6(object param0, object param1, object param2) - // { - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // if (_isInProc) - // return; //TEST_SKIPPED; - - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - - // foreach (string filename in _xsl.TemporaryFiles) - // { - // _output.WriteLine(filename); - // Assert.True(File.Exists(filename)); //Temporary file - // } - // return; - // } - - // //[Variation(id = 11, Desc = "Verify if the user can delete the TemporaryFiles after load in debug mode with script block", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", true })] - // [ActiveIssue(9873)] - // [InlineData("books.xml", "TempFiles.xsl", true)] - // [Theory] - // public void TempFiles7(object param0, object param1, object param2) - // { - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // if (_isInProc) - // return; //Test_SKIPPED; - - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - - // TempFileCollection tempFiles = _xsl.TemporaryFiles; - - // int fileCount = tempFiles.Count; - // tempFiles.Delete(); - // fileCount = tempFiles.Count; - - // VerifyResult(fileCount, 0, "Temp files could not be deleted"); - // } - - // //[Variation(id = 12, Desc = "Verify if the user can rename the TemporaryFiles after load in debug mode with script block", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", true })] - // [ActiveIssue(9873)] - // [InlineData("books.xml", "TempFiles.xsl", true)] - // [Theory] - // public void TempFiles8(object param0, object param1, object param2) - // { - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // if (_isInProc) - // return; //Test_SKIPPED; - - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - - // TempFileCollection tempFiles = _xsl.TemporaryFiles; - - // string newfilename = string.Empty; - // foreach (string filename in tempFiles) - // { - // string tempdir = filename.Substring(0, filename.LastIndexOf("\\") + 1); - // newfilename = tempdir + "new" + filename.Substring(filename.LastIndexOf("\\") + 1); - // File.Move(filename, newfilename); - // } - - // return; - // } - - // //[Variation(id = 13, Desc = "Verify if the necessary files are generated after load in debug mode with script block", Pri = 1, Params = new object[] { "books.xml", "TempFiles.xsl", true })] - // [ActiveIssue(9873)] - // [InlineData("books.xml", "TempFiles.xsl", true)] - // [Theory] - // public void TempFiles9(object param0, object param1, object param2) - // { - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // if (_isInProc) - // return; //Test_SKIPPED; - - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - - // TempFileCollection tempFiles = _xsl.TemporaryFiles; - // string filelist = string.Empty; - - // foreach (string filename in tempFiles) - // { - // filelist += filename.Substring(filename.LastIndexOf("\\") + 1) + ";"; - // } - - // _output.WriteLine("Verifying the existence of .dll, .pdb, .err, .out, .cmdline, .cs and .tmp"); - // Assert.True(filelist.IndexOf(".dll") > 0); //Script DLL tempfile is not generated - // Assert.True(filelist.IndexOf(".pdb") > 0); //Debug info tempfile is not generated - // Assert.True(filelist.IndexOf(".err") > 0); //Error tempfile is not generated - // Assert.True(filelist.IndexOf(".out") > 0); //Output tempfile is not generated - // Assert.True(filelist.IndexOf(".cmdline") > 0); //Command Line tempfile is not generated - // Assert.True(filelist.IndexOf(".cs") > 0); //CSharp tempfile is not generated - // Assert.True(filelist.IndexOf(".tmp") > 0); //Tempfile is not generated - - // return; - // } - - // //[Variation(id = 14, Desc = "TemporaryFiles after unsuccessful load of an invalid stylesheet in debug mode with script block", Pri = 2, Params = new object[] { "books.xml", "Invalid.xsl", true })] - // [InlineData("books.xml", "Invalid.xsl", true)] - // [Theory] - // public void TempFiles10(object param0, object param1, object param2) - // { - // TempFileCollection tempFiles = null; - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // try - // { - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - // } - // catch (XsltException e) - // { - // _output.WriteLine(e.ToString()); - // tempFiles = _xsl.TemporaryFiles; - // } - - // VerifyResult(tempFiles, null, "Temporary files must not be generated"); - // } - - // //[Variation(id = 15, Desc = "TemporaryFiles after unsuccessful load of a valid stylesheet in debug mode with a missing function in the script block", Pri = 2, Params = new object[] { "books.xml", "InvalidFn.xsl", true })] - // [ActiveIssue(9873)] - // [InlineData("books.xml", "InvalidFn.xsl", true)] - // [Theory] - // public void TempFiles11(object param0, object param1, object param2) - // { - // TempFileCollection tempFiles = null; - // Init(param0.ToString(), param1.ToString(), (bool)param2); - - // if (_isInProc) - // return; //Test_SKIPPED; - - // try - // { - // _xsl.Load(_xslFile, new XsltSettings(false, true), new XmlUrlResolver()); - // } - // catch (XsltException e) - // { - // _output.WriteLine(e.ToString()); - // tempFiles = _xsl.TemporaryFiles; - // } - - // VerifyResult(tempFiles != null, "Temporary files should have been generated even when Load() is unsuccessful"); - // } - - // //[Variation(Desc = "Load File from a drive c:", Pri = 2)] - // [InlineData()] - // [Theory] - // public void TempFiles12() - // { - // if (_isInProc) - // return; //Test_SKIPPED; - - // string childFile = Path.Combine(Directory.GetCurrentDirectory(), "child.xsl"); - - // string parentString = "<?xml version=\"1.0\"?>" - // + "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">" - // + "<xsl:import href=\"" + childFile + "\"/>" - // + "<xsl:output method=\"xml\" omit-xml-declaration=\"yes\" indent=\"yes\"/>" - // + "<xsl:template match=\"book[@style='autobiography']\">" - // + "<SPAN style=\"color=blue\">From B<xsl:value-of select=\"name()\"/> : <xsl:value-of select=\"title\"/>" - // + "</SPAN><br/>" - // + "<xsl:apply-templates />" - // + "</xsl:template>" - // + "<xsl:template match=\"text()\" >" - // + "</xsl:template>" - // + "</xsl:stylesheet>"; - - // string childString = "<?xml version=\"1.0\"?>" - // + "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">" - // + "<xsl:output method=\"xml\" omit-xml-declaration=\"yes\" indent=\"yes\"/>" - // + "<xsl:template match=\"book[@style='autobiography']\">" - // + "<SPAN style=\"color=blue\">From B<xsl:value-of select=\"name()\"/> : <xsl:value-of select=\"title\"/>" - // + "</SPAN><br/>" - // + "<xsl:apply-templates />" - // + "</xsl:template>" - // + "<xsl:template match=\"text()\" >" - // + "</xsl:template>" - // + "</xsl:stylesheet>"; - - // try - // { - // // create a xsl file in current directory on some drive, this is included in XSL above - // StreamWriter file = new StreamWriter(new FileStream(childFile, FileMode.Create, FileAccess.Write)); - // file.WriteLine(childString); - // file.Dispose(); - // StreamWriter parentFile = new StreamWriter(new FileStream("parent.xsl", FileMode.Create, FileAccess.Write)); - // parentFile.WriteLine(parentString); - // parentFile.Dispose(); - // } - // catch (Exception e) - // { - // _output.WriteLine(e.ToString()); - // Assert.True(false); - // } - - // try - // { - // // initialize XslCompiledTransform instance - // _xsl = new XslCompiledTransform(); - // - // // Now let's load the parent xsl file - // _xsl.Load("parent.xsl", new XsltSettings(false, true), new XmlUrlResolver()); - // } - // catch (XsltException e) - // { - // _output.WriteLine(e.ToString()); - // Assert.True(false); - // } - // return; - // } - - // //[Variation(Desc = "Bug 469775 - XSLT V2 : Exception thrown if xsl:preserve-space/xsl:strip-space is used and input document contains entities", Pri = 2)] - // [InlineData()] - // [Theory] - // public void TempFiles13() - // { - // try - // { - // XslCompiledTransform xslt = new XslCompiledTransform(); - // xslt.Load(FullFilePath("bug469775.xsl")); - // Stream res = new MemoryStream(); - // xslt.Transform(new XmlTextReader(FullFilePath("bug469775.xml")), (XsltArgumentList)null, res); - // _output.WriteLine(res.ToString()); - // } - // catch (System.Xml.XmlException) - // { - // Assert.True(false); - // } - // return; - // } - - // //[Variation(Desc = "Bug 469770 - XslCompiledTransform failed to load embedded stylesheets when prefixes are defined outside of xsl:stylesheet element", Pri = 2)] - // [InlineData()] - // [Theory] - // public void TempFiles14() - // { - // try - // { - // string xsl = "<root xmlns:ns=\"testing\">" - // + "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">" - // + "<xsl:template match=\"/\">" - // + "<xsl:value-of select=\"ns:test\" />" - // + "</xsl:template>" - // + "</xsl:stylesheet>" - // + "</root>"; - - // XmlReader r = XmlReader.Create(new StringReader(xsl)); - // while (r.NodeType != XmlNodeType.Element || r.LocalName != "stylesheet") - // { - // if (!r.Read()) - // { - // _output.WriteLine("There is no 'stylesheet' element in the file"); - // Assert.True(false); - // } - // } - - // XslCompiledTransform t = new XslCompiledTransform(); - // t.Load(r); - // } - // catch (XsltException exception) - // { - // _output.WriteLine("The following exception should not have been thrown"); - // _output.WriteLine(exception.ToString()); - // Assert.True(false); - // } - - // return; - // } - - // //[Variation(Desc = "Bug 482971 - XslCompiledTransform cannot output numeric character reference after long output", Pri = 2)] - // [InlineData()] - // [Theory] - // public void TempFiles15() - // { - // try - // { - // XslCompiledTransform xslt = new XslCompiledTransform(); - // xslt.Load(FullFilePath("bug482971.xsl")); - // xslt.Transform(FullFilePath("bug482971.xml"), "out.txt"); - // } - // catch (Exception exception) - // { - // _output.WriteLine("No exception should not have been thrown"); - // _output.WriteLine(exception.ToString()); - // Assert.True(false); - // } - // return; - // } - // } + //[TestCase(Name = "TemporaryFiles", Desc = "This testcase tests the Temporary Files property on XslCompiledTransform")] + public class TempFiles : XsltApiTestCaseBase2 + { + private XslCompiledTransform _xsl = null; + + private ITestOutputHelper _output; + public TempFiles(ITestOutputHelper output) : base(output) + { + _output = output; + } + + //[Variation(Desc = "Load File from a drive c:", Pri = 2)] + [InlineData()] + [Theory] + public void TempFiles1() + { + string childFile = Path.Combine(Directory.GetCurrentDirectory(), "child.xsl"); + + string parentString = "<?xml version=\"1.0\"?>" + + "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">" + + "<xsl:import href=\"" + childFile + "\"/>" + + "<xsl:output method=\"xml\" omit-xml-declaration=\"yes\" indent=\"yes\"/>" + + "<xsl:template match=\"book[@style='autobiography']\">" + + "<SPAN style=\"color=blue\">From B<xsl:value-of select=\"name()\"/> : <xsl:value-of select=\"title\"/>" + + "</SPAN><br/>" + + "<xsl:apply-templates />" + + "</xsl:template>" + + "<xsl:template match=\"text()\" >" + + "</xsl:template>" + + "</xsl:stylesheet>"; + + string childString = "<?xml version=\"1.0\"?>" + + "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">" + + "<xsl:output method=\"xml\" omit-xml-declaration=\"yes\" indent=\"yes\"/>" + + "<xsl:template match=\"book[@style='autobiography']\">" + + "<SPAN style=\"color=blue\">From B<xsl:value-of select=\"name()\"/> : <xsl:value-of select=\"title\"/>" + + "</SPAN><br/>" + + "<xsl:apply-templates />" + + "</xsl:template>" + + "<xsl:template match=\"text()\" >" + + "</xsl:template>" + + "</xsl:stylesheet>"; + + try + { + // create a xsl file in current directory on some drive, this is included in XSL above + StreamWriter file = new StreamWriter(new FileStream(childFile, FileMode.Create, FileAccess.Write)); + file.WriteLine(childString); + file.Dispose(); + StreamWriter parentFile = new StreamWriter(new FileStream("parent.xsl", FileMode.Create, FileAccess.Write)); + parentFile.WriteLine(parentString); + parentFile.Dispose(); + } + catch (Exception e) + { + _output.WriteLine(e.ToString()); + Assert.True(false); + } + + try + { + // initialize XslCompiledTransform instance + _xsl = new XslCompiledTransform(); + + // Now let's load the parent xsl file + _xsl.Load("parent.xsl", new XsltSettings(false, true), new XmlUrlResolver()); + } + catch (XsltException e) + { + _output.WriteLine(e.ToString()); + Assert.True(false); + } + return; + } + + //[Variation(Desc = "Bug 469775 - XSLT V2 : Exception thrown if xsl:preserve-space/xsl:strip-space is used and input document contains entities", Pri = 2)] + [InlineData()] + [Theory] + public void TempFiles2() + { + try + { + XslCompiledTransform xslt = new XslCompiledTransform(); + xslt.Load(FullFilePath("bug469775.xsl")); + Stream res = new MemoryStream(); + xslt.Transform(new XmlTextReader(FullFilePath("bug469775.xml")), (XsltArgumentList)null, res); + _output.WriteLine(res.ToString()); + } + catch (System.Xml.XmlException) + { + Assert.True(false); + } + return; + } + + //[Variation(Desc = "Bug 469770 - XslCompiledTransform failed to load embedded stylesheets when prefixes are defined outside of xsl:stylesheet element", Pri = 2)] + [InlineData()] + [Theory] + public void TempFiles3() + { + try + { + string xsl = "<root xmlns:ns=\"testing\">" + + "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">" + + "<xsl:template match=\"/\">" + + "<xsl:value-of select=\"ns:test\" />" + + "</xsl:template>" + + "</xsl:stylesheet>" + + "</root>"; + + XmlReader r = XmlReader.Create(new StringReader(xsl)); + while (r.NodeType != XmlNodeType.Element || r.LocalName != "stylesheet") + { + if (!r.Read()) + { + _output.WriteLine("There is no 'stylesheet' element in the file"); + Assert.True(false); + } + } + + XslCompiledTransform t = new XslCompiledTransform(); + t.Load(r); + } + catch (XsltException exception) + { + _output.WriteLine("The following exception should not have been thrown"); + _output.WriteLine(exception.ToString()); + Assert.True(false); + } + + return; + } + + //[Variation(Desc = "Bug 482971 - XslCompiledTransform cannot output numeric character reference after long output", Pri = 2)] + [InlineData()] + [Theory] + public void TempFiles4() + { + try + { + XslCompiledTransform xslt = new XslCompiledTransform(); + xslt.Load(FullFilePath("bug482971.xsl")); + xslt.Transform(FullFilePath("bug482971.xml"), "out.txt"); + } + catch (Exception exception) + { + _output.WriteLine("No exception should not have been thrown"); + _output.WriteLine(exception.ToString()); + Assert.True(false); + } + return; + } + } }
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs index f30de2c5d5..201d4a7d97 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslCompiledTransform.cs @@ -4,29 +4,21 @@ using Xunit; using Xunit.Abstractions; -using System; -using System.CodeDom.Compiler; using System.Collections; using System.Diagnostics; using System.IO; -using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.Loader; -using System.Security; using System.Text; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; using XmlCoreTest.Common; -using System.Collections.Generic; namespace System.Xml.Tests { public class ReflectionTestCaseBase : XsltApiTestCaseBase2 { - //protected static readonly MethodInfo methCompileToType = GetStaticMethod(typeof(XslCompiledTransform), "CompileToType"); - private ITestOutputHelper _output; public ReflectionTestCaseBase(ITestOutputHelper output) : base(output) { @@ -47,19 +39,6 @@ namespace System.Xml.Tests return methInfo; } - /*protected static CompilerErrorCollection WCompileToType( - XmlReader stylesheet, - XsltSettings settings, - XmlResolver stylesheetResolver, - bool debug, - TypeBuilder typeBuilder, - string scriptAssemblyPath) - { - return XslCompiledTransform.CompileToType(stylesheet, settings, stylesheetResolver, debug, typeBuilder, scriptAssemblyPath); - //return (CompilerErrorCollection)methCompileToType.Invoke(null, - // new object[] { stylesheet, settings, stylesheetResolver, debug, typeBuilder, scriptAssemblyPath }); - }*/ - protected String scriptTestPath = null; protected String ScriptTestPath @@ -80,21 +59,6 @@ namespace System.Xml.Tests } } - //protected TypeBuilder ATypeBuilder - //{ - // get - // { - // AppDomain cd = System.Threading.Thread.GetDomain(); - // AssemblyName an = new AssemblyName(); - // an.Name = "HelloClass"; - - // AssemblyBuilder ab = cd.DefineDynamicAssembly(an, AssemblyBuilderAccess.RunAndSave); - // ModuleBuilder mb = ab.DefineDynamicModule("HelloModule", "HelloModule.dll", true); - // TypeBuilder tb = mb.DefineType("Hello", TypeAttributes.Class | TypeAttributes.Public); - // return tb; - // } - //} - protected MethodInfo AMethodInfo { get @@ -112,301 +76,9 @@ namespace System.Xml.Tests protected void WLoad(XslCompiledTransform instance, MethodInfo meth, Byte[] bytes, Type[] types) { instance.Load(meth, bytes, types); - /* - Type[] paramTypes = new Type[3] { typeof(MethodInfo), typeof(Byte[]), typeof(Type[]) }; - - MethodInfo m = typeof(XslCompiledTransform).GetMethod("Load", - BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, - null, - paramTypes, - null); - - m.Invoke(instance, new Object[] { meth, bytes, types }); - */ - } - - protected void TestWLoad(XslCompiledTransform xslt, String asmPath, String type) - { - Assembly asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(asmPath); - Type t = asm.GetType(type); - - MethodInfo meth = GetStaticMethod(t, "Execute"); - Byte[] staticData = (Byte[])t.GetTypeInfo().GetField("staticData", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(t); - Type[] ebTypes = (Type[])t.GetTypeInfo().GetField("ebTypes", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(t); - - WLoad(xslt, meth, staticData, ebTypes); } } - //[TestCase(Name = "CompileToType tests", Desc = "This testcase tests XslCompiledTransform private CompileToType method via Reflection. Same method is also exercised by xsltc.exe")] - public class CCompileToTypeTest : ReflectionTestCaseBase - { - private ITestOutputHelper _output; - public CCompileToTypeTest(ITestOutputHelper output) : base(output) - { - _output = output; - } - - //BinCompat TODO: Add this test back - ////[Variation("CompileToType(XmlReader = null)", Pri = 1)] - //[InlineData()] - //[Theory] - //public void Var1() - //{ - // try - // { - // WCompileToType((XmlReader)null, XsltSettings.Default, null, false, ATypeBuilder, String.Empty); - // } - // catch (Exception e) - // { - // _output.WriteLine(e.ToString()); - - // if (e is ArgumentNullException || e.InnerException is ArgumentNullException) - // return; - - // _output.WriteLine("Did not throw ArgumentNullException"); - // } - // Assert.True(false); - //} - - //BinCompat TODO: Add this test back - it might possibly need to be removed - to be investigated - //[Variation("CompileToType(TypeBuilder= null)", Pri = 1)] - [InlineData()] - [Theory] - public void Var2() - { - /*try - { - WCompileToType(XmlReader.Create(FullFilePath("identity.xsl")), XsltSettings.Default, null, false, null, String.Empty); - } - catch (Exception e) - { - _output.WriteLine(e.ToString()); - - if (e is ArgumentNullException || e.InnerException is ArgumentNullException) - return; - - _output.WriteLine("Did not throw ArgumentNullException"); - } - Assert.True(false);*/ - } - - //BinCompat TODO: Add this test back - ////[Variation("CompileToType(AsmPath= No Extension file name)", Pri = 1)] - //[InlineData()] - //[Theory] - //public void Var3() - //{ - // AppDomain cd = System.Threading.Thread.GetDomain(); - // AssemblyName an = new AssemblyName(); - // an.Name = "HelloClass"; - - // AssemblyBuilder ab = cd.DefineDynamicAssembly(an, AssemblyBuilderAccess.RunAndSave); - // ModuleBuilder mb = ab.DefineDynamicModule("HelloModule", "HelloModule.dll", true); - // TypeBuilder tb = mb.DefineType("Hello", TypeAttributes.Class | TypeAttributes.Public); - - // try - // { - // String xslPath = ScriptTestPath + "Scripting28.xsl"; - // CompilerErrorCollection errors; - // using (XmlReader reader = XmlReader.Create(xslPath)) - // { - // errors = WCompileToType(reader, XsltSettings.TrustedXslt, null, false, tb, "ScName"); - // } - - // // Print errors and warnings - // bool hasError = false; - // foreach (CompilerError error in errors) - // { - // _output.WriteLine(error.ToString()); - // hasError = true; - // } - - // if (hasError) Assert.True(false); - // } - // catch (Exception e) - // { - // _output.WriteLine(e.ToString()); - // Assert.True(false); - // } - - // return; - //} - - //BinCompat TODO: Add this test back - ////[Variation("CompileToType(Valid case with scripts)", Pri = 1)] - //[InlineData()] - //[Theory] - //public void Var4() - //{ - // AppDomain cd = System.Threading.Thread.GetDomain(); - // AssemblyName an = new AssemblyName(); - // an.Name = "HelloClass4"; - - // AssemblyBuilder ab = cd.DefineDynamicAssembly(an, AssemblyBuilderAccess.RunAndSave); - // ModuleBuilder mb = ab.DefineDynamicModule("HelloModule4", "HelloModule4.dll", true); - // TypeBuilder tb = mb.DefineType("Hello4", TypeAttributes.Class | TypeAttributes.Public); - - // try - // { - // String xslPath = ScriptTestPath + "Scripting28.xsl"; - // CompilerErrorCollection errors; - // using (XmlReader reader = XmlReader.Create(xslPath)) - // { - // errors = WCompileToType(reader, XsltSettings.TrustedXslt, null, false, tb, "SomeAsm4.dll"); - // } - - // // Print errors and warnings - // bool hasError = false; - // foreach (CompilerError error in errors) - // { - // _output.WriteLine(error.ToString()); - // hasError = true; - // } - - // if (hasError) Assert.True(false); - // } - // catch (Exception e) - // { - // _output.WriteLine(e.ToString()); - // Assert.True(false); - // } - - // return; - //} - - // Q> In CompileToType when scriptAssemblyPath is null, should we really throw ArgumentNullExc - // if the stylesheet does not have any scripts (but the settings are enabled)? - // - // Anton> Sergey and I think it\92s acceptable behavior. Implementing the other way will require extra - // code churn in 3 files, which we tried to avoid. - - //BinCompat TODO: Add this test back - ////[Variation("CompileToType(ScriptPath = null, sytlesheet with no scripts)", Pri = 1)] - //[InlineData()] - //[Theory] - //public void Var5() - //{ - // AppDomain cd = System.Threading.Thread.GetDomain(); - // AssemblyName an = new AssemblyName(); - // an.Name = "HelloClass5"; - - // AssemblyBuilder ab = cd.DefineDynamicAssembly(an, AssemblyBuilderAccess.RunAndSave); - // ModuleBuilder mb = ab.DefineDynamicModule("HelloModule5", "HelloModule5.dll", true); - // TypeBuilder tb = mb.DefineType("Hello5", TypeAttributes.Class | TypeAttributes.Public); - - // try - // { - // String xslPath = FullFilePath("identity.xsl"); - // CompilerErrorCollection errors; - // using (XmlReader reader = XmlReader.Create(xslPath)) - // { - // errors = WCompileToType(reader, XsltSettings.TrustedXslt, null, false, tb, null); - // } - - // // Print errors and warnings - // bool hasError = false; - // foreach (CompilerError error in errors) - // { - // _output.WriteLine(error.ToString()); - // hasError = true; - // } - - // if (hasError) Assert.True(false); - // } - // catch (ArgumentNullException e) - // { - // _output.WriteLine(e.ToString()); - // return; - // } - - // Assert.True(false); - //} - - //BinCompat TODO: Add this test back - //[Variation("CompileToType(ScriptPath = null, stylesheet with scripts)", Pri = 1)] - //[InlineData()] - //[Theory] - //public void Var6() - //{ - // AppDomain cd = System.Threading.Thread.GetDomain(); - // AssemblyName an = new AssemblyName(); - // an.Name = "HelloClass6"; - - // AssemblyBuilder ab = cd.DefineDynamicAssembly(an, AssemblyBuilderAccess.RunAndSave); - // ModuleBuilder mb = ab.DefineDynamicModule("HelloModule6", "HelloModule6.dll", true); - // TypeBuilder tb = mb.DefineType("Hello6", TypeAttributes.Class | TypeAttributes.Public); - - // try - // { - // String xslPath = ScriptTestPath + "Scripting28.xsl"; - // CompilerErrorCollection errors; - // using (XmlReader reader = XmlReader.Create(xslPath)) - // { - // errors = WCompileToType(reader, XsltSettings.TrustedXslt, null, false, tb, null); - // } - - // // Print errors and warnings - // bool hasError = false; - // foreach (CompilerError error in errors) - // { - // _output.WriteLine(error.ToString()); - // hasError = true; - // } - - // if (hasError) Assert.True(false); - // } - // catch (Exception e) - // { - // _output.WriteLine(e.ToString()); - // return; - // } - - // Assert.True(false); - //} - - //BinCompat TODO: Add this test back - // //[Variation("CompileToType(ScriptPath = null, XsltSettings = null)", Pri = 1)] - // [InlineData()] - // [Theory] - // public void Var7() - // { - // AppDomain cd = System.Threading.Thread.GetDomain(); - // AssemblyName an = new AssemblyName(); - // an.Name = "HelloClass7"; - - // AssemblyBuilder ab = cd.DefineDynamicAssembly(an, AssemblyBuilderAccess.RunAndSave); - // ModuleBuilder mb = ab.DefineDynamicModule("HelloModule7", "HelloModule7.dll", true); - // TypeBuilder tb = mb.DefineType("Hello7", TypeAttributes.Class | TypeAttributes.Public); - - // try - // { - // CompilerErrorCollection errors; - // using (XmlReader reader = XmlReader.Create(FullFilePath("identity.xsl"))) - // { - // errors = WCompileToType(reader, null, null, false, tb, null); - // } - - // // Print errors and warnings - // bool hasError = false; - // foreach (CompilerError error in errors) - // { - // _output.WriteLine(error.ToString()); - // hasError = true; - // } - - // if (!hasError) return; - // } - // catch (Exception e) - // { - // _output.WriteLine(e.ToString()); - // Assert.True(false); - // } - - // Assert.True(false); - // } - } - //[TestCase(Name = "Load(MethodInfo, ByteArray, TypeArray) tests", Desc = "This testcase tests private Load method via Reflection. This method is used by sharepoint")] public class CLoadMethInfoTest : ReflectionTestCaseBase { @@ -459,167 +131,6 @@ namespace System.Xml.Tests } Assert.True(false); } - - //[Variation("Valid Load after error case Load(MethodInfo, ByteArray, TypeArray)", Pri = 1)] - [ActiveIssue(9988)] - [InlineData()] - [Theory] - public void Var3() - { - // BinCompat TODO: rewrite this test so that it does not load xsl from dll - Assert.True(false); - - //XslCompiledTransform xslt = new XslCompiledTransform(); - //try - //{ - // //error case - // WLoad(xslt, AMethodInfo, new Byte[5], null); - //} - //catch (Exception e) - //{ - // /* - // * Anton> If staticData array is malformed, you end up with weird exceptions. - // * We didn\92t expect this method to be public and didn\92t implement any range/sanity - // * checks in deserialization code path, besides CLR implicit range checks for array indices. - // * You have found one such place, but there are dozens of them. Fixing all of them will cause - // * code churn in many files and another round of [code review/test sign-off/approval] process. - // * Right now it works according to the \93Garbage In, Garbage Out\94 principle. - // * - // */ - // _output.WriteLine(e.ToString()); - //} - - //String asmPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\bftBaseLine.dll"); - //String type = "bftBaseLine"; - //String xml = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\sft1.xml"); - //TestWLoad(xslt, Path.GetFullPath(asmPath), type); - //xslt.Transform(xml, "errout.txt"); - //return; - } - - //[Variation("Multiple Loads Load(MethodInfo, ByteArray, TypeArray)", Pri = 1)] - [ActiveIssue(9988)] - [InlineData()] - [Theory] - public void Var7() - { - // BinCompat TODO: rewrite this test so that it does not load xsl from dll - Assert.True(false); - - /*XslCompiledTransform xslt = new XslCompiledTransform(); - - String asmPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\bftBaseLine.dll"); - String type = "bftBaseLine"; - String xml = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\sft1.xml"); - - Assembly asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.GetFullPath(asmPath)); - Type t = asm.GetType(type); - - MethodInfo meth = GetStaticMethod(t, "Execute"); - Byte[] staticData = (Byte[])t.GetTypeInfo().GetField("staticData", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(t); - Type[] ebTypes = (Type[])t.GetTypeInfo().GetField("ebTypes", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(t); - - asmPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\Scripting28.dll"); - type = "Scripting28"; - - asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.GetFullPath(asmPath)); - t = asm.GetType(type); - - MethodInfo meth2 = GetStaticMethod(t, "Execute"); - Byte[] staticData2 = (Byte[])t.GetTypeInfo().GetField("staticData", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(t); - Type[] ebTypes2 = (Type[])t.GetTypeInfo().GetField("ebTypes", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(t); - - for (int i = 0; i < 100; i++) - { - WLoad(xslt, meth, staticData, ebTypes); - WLoad(xslt, meth2, staticData2, ebTypes2); - xslt.Transform(xml, "out.txt"); - xslt.Transform(xml, "out1.txt"); - } - - return;*/ - } - - //[Variation("Load(MethodInfo, ByteArray, TypeArray) simple assembly", Pri = 1)] - [ActiveIssue(9988)] - [InlineData()] - [Theory] - public void Var4() - { - // BinCompat TODO: rewrite this test so that it does not load xsl from dll - Assert.True(false); - - /*XslCompiledTransform xslt = new XslCompiledTransform(); - String asmPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\bftBaseLine.dll"); - String type = "bftBaseLine"; - String xml = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\sft1.xml"); - - try - { - TestWLoad(xslt, Path.GetFullPath(asmPath), type); - xslt.Transform(xml, "out.txt"); - return; - } - catch (Exception e) - { - _output.WriteLine(e.ToString()); - } - Assert.True(false);*/ - } - - //[Variation("Load(MethodInfo, ByteArray, TypeArray) assembly with scripts", Pri = 1)] - [ActiveIssue(9988)] - [InlineData()] - [Theory] - public void Var5() - { - // BinCompat TODO: rewrite this test so that it does not load xsl from dll - Assert.True(false); - - /*XslCompiledTransform xslt = new XslCompiledTransform(); - String asmPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\Scripting28.dll"); - String type = "Scripting28"; - String xml = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\sft1.xml"); - - try - { - TestWLoad(xslt, Path.GetFullPath(asmPath), type); - xslt.Transform(xml, "out.txt"); - return; - } - catch (Exception e) - { - _output.WriteLine(e.ToString()); - } - Assert.True(false);*/ - } - - //[Variation("Load(MethodInfo, ByteArray, TypeArray) old xsltc assembly", Pri = 1)] - [ActiveIssue(9988)] - [InlineData()] - [Theory] - public void Var6() - { - // BinCompat TODO: rewrite this test so that it does not load xsl from dll - Assert.True(false); - - /*XslCompiledTransform xslt = new XslCompiledTransform(); - String asmPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\CTT1.dll"); - String type = "CCT1"; - String xml = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\sft1.xml"); - - try - { - TestWLoad(xslt, Path.GetFullPath(asmPath), type); - xslt.Transform(xml, "out.txt"); - return; - } - catch (Exception e) - { - _output.WriteLine(e.ToString()); - } - Assert.True(false);*/ - } } //[TestCase(Name = "Null argument tests", Desc = "This testcase passes NULL arguments to all XslCompiledTransform methods")] @@ -988,15 +499,16 @@ namespace System.Xml.Tests { _output = output; } - //[Variation(id = 1, Desc = "Set XmlResolver property to null, load style sheet with import/include, should not affect transform")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void XmlResolver1() + public void XmlResolver1(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL("XmlResolver_Main.xsl", null); + LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType, null); Assert.True(false); } catch (XsltException e1) @@ -1007,24 +519,26 @@ namespace System.Xml.Tests catch (ArgumentNullException e2) { _output.WriteLine(e2.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } //[Variation(id = 2, Desc = "Set XmlResolver property to null, load style sheet with document function, should not resolve during load")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void XmlResolver2() + public void XmlResolver2(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL("XmlResolver_Main.xsl", null); + LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType, null); _output.WriteLine("No exception was thrown"); Assert.True(false); } @@ -1036,28 +550,36 @@ namespace System.Xml.Tests catch (ArgumentNullException e2) { _output.WriteLine(e2.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } //[Variation(id = 3, Desc = "Default XmlResolver, load style sheet with document function, should resolve during transform", Pri = 1, Param = "DefaultResolver.txt")] - [InlineData("DefaultResolver.txt")] + [InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void XmlResolver3(object param) + public void XmlResolver3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string Baseline = Path.Combine("baseline", (string)param); - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", xslInputType, readerType) == 1) { - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -1071,53 +593,47 @@ namespace System.Xml.Tests Assert.True(false); } - /* - //[Variation("Set to NULL many times in a loop, then to proper cred.")] - [InlineData()] - [Theory] - public void XmlResolver6() - { - // Skip this test for Load(URI) - // Reason: When style sheet URI = Intranet zone, XmlSecureResolver does not resolve document function - - if(LoadXSL("xmlResolver_cred.xsl") == TEST_PASS) - { - for(int i=0; i<100; i++) - xslt.XmlResolver = null; - - for(int i=0; i<100; i++) - xslt.XmlResolver = GetDefaultCredResolver(); - - if ((Transform("fruits.xml") == TEST_PASS) && (CheckResult(377.8217373898) == TEST_PASS)) - return; - else - { - _output.WriteLine("Failed to use XmlResolver property to resolve document function"); - Assert.True(false); - } - } - else - { - _output.WriteLine("Failed to load style sheet!"); - Assert.True(false); - } - } - */ - //[Variation(id = 7, Desc = "document() has absolute URI", Pri = 0)] - [ActiveIssue(14071)] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void XmlResolver7() + public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result>123</result>"; + // copy file on the local machine + try + { + string tempPath = Path.GetTempPath(); + string testFile = Path.Combine(tempPath, "xmlResolver_document_function.xml"); + if (File.Exists(testFile)) + { + File.SetAttributes(testFile, FileAttributes.Normal); + File.Delete(testFile); + } + string xmlFile = FullFilePath("xmlResolver_document_function.xml"); + File.Copy(xmlFile, testFile, true); + } + catch (Exception e) + { + _output.WriteLine(e.ToString()); + _output.WriteLine("Could not copy file to local. Some other issues prevented this test from running"); + return; //TEST_SKIPPED; + } + // copy file on the local machine (this is now done with createAPItestfiles.js, see Oasys scenario.) - if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl") == 1) + if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl", xslInputType, readerType) == 1) { - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(expected); return; @@ -1161,17 +677,18 @@ namespace System.Xml.Tests } //[Variation(id = 1, Desc = "Call Load with null value")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric1() + public void LoadGeneric1(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL(null); + LoadXSL(null, xslInputType, readerType); } catch (System.ArgumentException) { - // System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri) throws System.ArgumentException here for null return; } _output.WriteLine("Exception not generated for null parameter name"); @@ -1179,21 +696,29 @@ namespace System.Xml.Tests } //[Variation(id = 2, Desc = "Load with valid, then invalid, then valid again")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void LoadGeneric2() + public void LoadGeneric2(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { - LoadXSL("IDontExist.xsl"); + LoadXSL("IDontExist.xsl", xslInputType, readerType); } catch (System.IO.FileNotFoundException) { try { - Transform("fruits.xml"); + Transform((string) "fruits.xml", (OutputType) outputType, navType); } catch (System.InvalidOperationException e) { @@ -1211,18 +736,26 @@ namespace System.Xml.Tests } //[Variation(id = 3, Desc = "Load an invalid, then a valid and transform", Param = "showParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void LoadGeneric3(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); try { - LoadXSL("IDontExist.xsl"); + LoadXSL("IDontExist.xsl", xslInputType, readerType); } catch (System.IO.FileNotFoundException) { - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1233,31 +766,39 @@ namespace System.Xml.Tests } //[Variation(id = 4, Desc = "Call several overloaded functions", Param = "showParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void LoadGeneric4(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric4(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); - if (MyXslInputType() != XslInputType.Reader) - LoadXSL("showParamLongName.xsl", XslInputType.Reader, new XmlUrlResolver()); - if (MyXslInputType() != XslInputType.URI) - LoadXSL("showParamLongName.xsl", XslInputType.URI, new XmlUrlResolver()); - if (MyXslInputType() != XslInputType.Navigator) - LoadXSL("showParamLongName.xsl", XslInputType.Navigator, new XmlUrlResolver()); - - if ((LoadXSL("showParam.xsl") == 0) || (Transform("fruits.xml") == 0)) + if (xslInputType != XslInputType.Reader) + LoadXSL("showParamLongName.xsl", XslInputType.Reader, readerType, new XmlUrlResolver()); + if (xslInputType != XslInputType.URI) + LoadXSL("showParamLongName.xsl", XslInputType.URI, readerType, new XmlUrlResolver()); + if (xslInputType != XslInputType.Navigator) + LoadXSL("showParamLongName.xsl", XslInputType.Navigator, readerType, new XmlUrlResolver()); + + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 0) || (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 0)) Assert.True(false); VerifyResult(Baseline, _strOutFile); - if (MyXslInputType() != XslInputType.Navigator) - LoadXSL("showParamLongName.xsl", XslInputType.Navigator, new XmlUrlResolver()); - if (MyXslInputType() != XslInputType.URI) - LoadXSL("showParamLongName.xsl", XslInputType.URI, new XmlUrlResolver()); - if (MyXslInputType() != XslInputType.Reader) - LoadXSL("showParamLongName.xsl", XslInputType.Reader, new XmlUrlResolver()); + if (xslInputType != XslInputType.Navigator) + LoadXSL("showParamLongName.xsl", XslInputType.Navigator, readerType, new XmlUrlResolver()); + if (xslInputType != XslInputType.URI) + LoadXSL("showParamLongName.xsl", XslInputType.URI, readerType, new XmlUrlResolver()); + if (xslInputType != XslInputType.Reader) + LoadXSL("showParamLongName.xsl", XslInputType.Reader, readerType, new XmlUrlResolver()); - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1267,20 +808,28 @@ namespace System.Xml.Tests } //[Variation(id = 5, Desc = "Call same overloaded Load() many times then transform", Param = "showParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void LoadGeneric5(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric5(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); for (int i = 0; i < 100; i++) { - if (LoadXSL("showParam.xsl") != 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) != 1) { _output.WriteLine("Failed to load stylesheet showParam.xsl on the {0} attempt", i); Assert.True(false); } } - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1290,13 +839,15 @@ namespace System.Xml.Tests } //[Variation(id = 6, Desc = "Call load with non-existing stylesheet")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric6() + public void LoadGeneric6(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL("IDontExist.xsl"); + LoadXSL("IDontExist.xsl", xslInputType, readerType); } catch (System.IO.FileNotFoundException) { @@ -1307,19 +858,27 @@ namespace System.Xml.Tests } //[Variation(id = 7, Desc = "Verify that style sheet is closed properly after Load - Shared Read Access")] - [InlineData()] - [Theory] - public void LoadGeneric7() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric7(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { FileStream s2; string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; // check immediately after load and after transform - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType) == 1) { s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.Read, FileShare.Read); s2.Dispose(); - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(expected); s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.Read, FileShare.Read); @@ -1330,46 +889,28 @@ namespace System.Xml.Tests Assert.True(false); } - /* - //[Variation(id =8, Desc ="Verify that style sheet is closed properly after Load - ReadWrite Access")] - [InlineData()] - [Theory] - public void LoadGeneric8() - { - FileStream s2; - - // check immediately after load and after transform - - if(LoadXSL("XmlResolver_Main.xsl") == TEST_PASS) - { - s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - if((Transform("fruits.xml") == TEST_PASS) && (CheckResult(428.8541842246)== TEST_PASS)) - { - s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - return; - } - } - _output.WriteLine("Appeared to not close style sheet file properly after loading."); - Assert.True(false); - } - */ - //[Variation(id = 9, Desc = "Verify that included files are closed properly after Load - Read Access")] - [InlineData()] - [Theory] - public void LoadGeneric9() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric9(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { FileStream s2; string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; // check immediately after load and after transform - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType) == 1) { s2 = new FileStream(FullFilePath("XmlResolver_Sub.xsl"), FileMode.Open, FileAccess.Read); s2.Dispose(); - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(expected); s2 = new FileStream(FullFilePath("XmlResolver_Include.xsl"), FileMode.Open, FileAccess.Read, FileShare.Read); @@ -1381,37 +922,20 @@ namespace System.Xml.Tests Assert.True(false); } - /* - //[Variation(id =10, Desc ="Verify that included files are closed properly after Load - ReadWrite Access")] - [InlineData()] - [Theory] - public void LoadGeneric10() - { - FileStream s2; - - // check immediately after load and after transform - if(LoadXSL("XmlResolver_Main.xsl") == TEST_PASS) - { - s2 = new FileStream(FullFilePath("XmlResolver_sub.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - if((Transform("fruits.xml") == TEST_PASS) && (CheckResult(428.8541842246)== TEST_PASS)) - { - s2 = new FileStream(FullFilePath("XmlResolver_Include.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - return; - } - } - _output.WriteLine("Appeared to not close file properly after loading."); - Assert.True(false); - } - */ - //[Variation(id = 11, Desc = "Load stylesheet with entity reference: Bug #68450 ")] - [InlineData()] - [Theory] - public void LoadGeneric11() - { - if (MyDocType().ToString() == "DataDocument") + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric11(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) + { + if (navType.ToString() == "DataDocument") // Skip the test for DataDocument return; else @@ -1420,12 +944,12 @@ namespace System.Xml.Tests Name </Book>"; - if (LoadXSL("books_entity_ref.xsl", XslInputType.Reader, new XmlUrlResolver()) != 1) + if (LoadXSL("books_entity_ref.xsl", XslInputType.Reader, readerType, new XmlUrlResolver()) != 1) { _output.WriteLine("Failed to load stylesheet books_entity_ref.xsl"); Assert.True(false); } - if ((LoadXSL("books_entity_ref.xsl") == 1) && (Transform("books_entity_ref.xml") == 1)) + if ((LoadXSL("books_entity_ref.xsl", xslInputType, readerType) == 1) && (Transform((string) "books_entity_ref.xml", (OutputType) outputType, navType) == 1)) { VerifyResult(expected); return; @@ -1435,15 +959,17 @@ namespace System.Xml.Tests } //[Variation(id = 12, Desc = "Load with invalid stylesheet and verify that file is closed properly")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric12() + public void LoadGeneric12(XslInputType xslInputType, ReaderType readerType) { Stream strmTemp; try { - int i = LoadXSL("xslt_error.xsl"); + int i = LoadXSL("xslt_error.xsl", xslInputType, readerType); } catch (XsltException) { @@ -1490,13 +1016,15 @@ namespace System.Xml.Tests } //[Variation("Call Load with null source value and null resolver")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric1() + public void LoadGeneric1(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL_Resolver(null, null); + LoadXSL_Resolver(null, xslInputType, readerType, null); } catch (System.ArgumentNullException e) { @@ -1508,13 +1036,15 @@ namespace System.Xml.Tests } //[Variation("Call Load with null source value and valid resolver")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric2() + public void LoadGeneric2(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL_Resolver(null, new XmlUrlResolver()); + LoadXSL_Resolver(null, xslInputType, readerType, new XmlUrlResolver()); } catch (System.ArgumentNullException e) { @@ -1526,39 +1056,49 @@ namespace System.Xml.Tests } //[Variation("Call Load with null XmlResolver, style sheet does not have include/import, URI should throw ArgumentNullException and the rest shouldn't error", Param = "showParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void LoadGeneric3(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); try { - LoadXSL_Resolver("showParam.xsl", null); - Transform("fruits.xml"); + LoadXSL_Resolver("showParam.xsl", xslInputType, readerType, null); + Transform((string) "fruits.xml", (OutputType) outputType, navType); VerifyResult(Baseline, _strOutFile); return; } catch (ArgumentNullException e) { _output.WriteLine(e.ToString()); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } //[Variation("Call Load with null XmlResolver and stylesheet has import/include, URI should throw ArgumentNullException, rest throw XsltException")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric4() + public void LoadGeneric4(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL_Resolver("XmlResolver_Main.xsl", null); + LoadXSL_Resolver("XmlResolver_Main.xsl", xslInputType, readerType, null); _output.WriteLine("No exception was thrown when a null resolver is passed"); Assert.True(false); } @@ -1570,26 +1110,28 @@ namespace System.Xml.Tests catch (ArgumentNullException e2) { _output.WriteLine(e2.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } //[Variation("Call Load with null custom resolver and style sheet has import/include, should throw Exception")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric5() + public void LoadGeneric5(XslInputType xslInputType, ReaderType readerType) { CustomNullResolver myResolver = new CustomNullResolver(_output); try { - LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver); + LoadXSL_Resolver("XmlResolver_Main.xsl", xslInputType, readerType, myResolver); _output.WriteLine("No exception is thrown"); Assert.True(false); } @@ -1601,69 +1143,85 @@ namespace System.Xml.Tests catch (ArgumentNullException e2) { _output.WriteLine(e2.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } catch (XmlException e3) { _output.WriteLine(e3.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } //[Variation("Call Load with null custom resolver and style sheet has no import/include, should error for URI only", Param = "ShowParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void LoadGeneric6(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric6(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); CustomNullResolver myResolver = new CustomNullResolver(_output); try { - LoadXSL_Resolver("showParam.xsl", myResolver); - Transform("fruits.xml"); + LoadXSL_Resolver("showParam.xsl", xslInputType, readerType, myResolver); + Transform((string) "fruits.xml", (OutputType) outputType, navType); VerifyResult(Baseline, _strOutFile); return; } catch (ArgumentNullException e) { _output.WriteLine(e.ToString()); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } catch (XsltException e3) { _output.WriteLine(e3.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } //[Variation("Style sheet has import/include, call Load first with custom null resolver and then default resolver, should not fail", Param = "XmlResolverTestMain.txt")] - [InlineData("XmlResolverTestMain.txt")] - [Theory] - public void LoadGeneric7(object param) + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric7(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; @@ -1672,7 +1230,7 @@ namespace System.Xml.Tests try { - LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver); + LoadXSL_Resolver("XmlResolver_Main.xsl", xslInputType, readerType, myResolver); } //For input types != URI catch (System.Xml.Xsl.XsltException e1) @@ -1688,9 +1246,9 @@ namespace System.Xml.Tests CheckExpectedError(e1, "System.Xml", "Xslt_CannotLoadStylesheet", new string[] { new Uri(Uri.UriSchemeFile + Uri.SchemeDelimiter + Path.GetFullPath(FullFilePath("XmlResolver_Main.xsl"))).ToString(), "null" }); } - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType) == 1) { - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(expected); return; @@ -1717,9 +1275,9 @@ namespace System.Xml.Tests CheckExpectedError(e2, "System.Xml", "Xslt_CannotLoadStylesheet", new string[] { new Uri(Uri.UriSchemeFile + Uri.SchemeDelimiter + Path.GetFullPath(FullFilePath("XmlResolver_Main.xsl"))).ToString(), "null" }); } - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType) == 1) { - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -1736,11 +1294,11 @@ namespace System.Xml.Tests catch (XmlException e3) { _output.WriteLine(e3.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } @@ -1749,18 +1307,26 @@ namespace System.Xml.Tests } //[Variation("Style sheet has import/include, call Load first with default resolver and then with custom null resolver, should fail", Param = "XmlResolverTestMain.txt")] - [InlineData("XmlResolverTestMain.txt")] - [Theory] - public void LoadGeneric8(object param) + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader)] + [InlineData("XmlResolverTestMain.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader)] + [Theory] + public void LoadGeneric8(object param, XslInputType xslInputType, ReaderType readerType) { string Baseline = Path.Combine("baseline", (string)param); CustomNullResolver myResolver = new CustomNullResolver(_output); - if ((LoadXSL("XmlResolver_Main.xsl") == 1)) + if ((LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType) == 1)) { try { - LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver); + LoadXSL_Resolver("XmlResolver_Main.xsl", xslInputType, readerType, myResolver); } catch (System.Xml.Xsl.XsltException e1) { @@ -1781,22 +1347,22 @@ namespace System.Xml.Tests catch (ArgumentNullException e2) { _output.WriteLine(e2.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } catch (XmlException e3) { _output.WriteLine(e3.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("XmlException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } @@ -1808,15 +1374,23 @@ namespace System.Xml.Tests } //[Variation("Load with resolver with credentials, then load XSL that does not need cred.")] - [InlineData()] - [Theory] - public void LoadGeneric9() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void LoadGeneric9(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; - if ((LoadXSL_Resolver("XmlResolver_Main.xsl", GetDefaultCredResolver()) == 1)) + if ((LoadXSL_Resolver("XmlResolver_Main.xsl", xslInputType, readerType, GetDefaultCredResolver()) == 1)) { - if ((LoadXSL("XmlResolver_Main.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType) == 1) && (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1)) { VerifyResult(expected); return; @@ -1830,35 +1404,16 @@ namespace System.Xml.Tests Assert.True(false); } - /* This test doesn't make sense coz loading a stylesheet with null resolver will throw ArgumentNullException - //[Variation("Call Load() many times with null resolver then perform a transform")] - [InlineData()] - [Theory] - public void LoadGeneric10() - { - for(int i=0; i < 100; i++) - { - if(LoadXSL_Resolver("showParam.xsl", null) != TEST_PASS) - { - _output.WriteLine("Failed to load stylesheet showParam.xsl on the {0} attempt", i); - Assert.True(false); - } - } - if((LoadXSL_Resolver("showParam.xsl", null) == TEST_PASS) && (Transform("fruits.xml") == TEST_PASS) - && (VerifyResult(Baseline, _strOutFile)== TEST_PASS)) - return; - Assert.True(false); - } - */ - //[Variation("Call Load with null Resolver, file does not exist")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric11() + public void LoadGeneric11(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL_Resolver("IDontExist.xsl", null); + LoadXSL_Resolver("IDontExist.xsl", xslInputType, readerType, null); _output.WriteLine("No exception was thrown"); Assert.True(false); } @@ -1870,52 +1425,15 @@ namespace System.Xml.Tests catch (ArgumentNullException e2) { _output.WriteLine(e2.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } - - /* This test doesn't make sense anymore coz passing null resolver throws ArgumentNullException - * right on the first Load on showParam.xsl - * - //[Variation("Load non existing stylesheet with null resolver and try to transform")] - [InlineData()] - [Theory] - public void LoadGeneric12() - { - if(LoadXSL_Resolver("showParam.xsl", null) == TEST_PASS) - { - try - { - LoadXSL_Resolver("IDontExist.xsl", null); - } - catch(System.IO.FileNotFoundException) - { - //no stylesheet loaded, should throw error - try - { - Transform("fruits.xml"); - } - catch(System.InvalidOperationException e2) - { - return CheckExpectedError(e2, "system.xml", "Xslt_NoStylesheetLoaded", new string[] { "IDontExist.xsl" }); - } - } - _output.WriteLine("Exception not generated for non-existent file parameter name"); - } - else - { - _output.WriteLine("Errors loading initial file"); - Assert.True(false); - } - Assert.True(false); - } - */ } /***********************************************************/ @@ -1935,15 +1453,17 @@ namespace System.Xml.Tests } //[Variation("Basic check for usage of credentials on resolver, load XSL that needs cred. with correct resolver", Param = "XmlResolverTestMain.txt")] - [InlineData("XmlResolverTestMain.txt")] + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("XmlResolverTestMain.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void LoadUrlResolver1(object param) + public void LoadUrlResolver1(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { // XsltResolverTestMain.xsl is placed in IIS virtual directory // which requires integrated Windows NT authentication string Baseline = Path.Combine("baseline", (string)param); - if ((LoadXSL_Resolver(Path.Combine("XmlResolver", "XmlResolverTestMain.xsl"), GetDefaultCredResolver()) == 1) && - (Transform("fruits.xml") == 1)) + if ((LoadXSL_Resolver(Path.Combine("XmlResolver", "XmlResolverTestMain.xsl"), xslInputType, readerType, GetDefaultCredResolver()) == 1) && + (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1953,13 +1473,13 @@ namespace System.Xml.Tests } //[Variation("Load XSL that needs cred. with null resolver, should fail", Param = "XmlResolverTestMain.txt")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrlResolver2() + public void LoadUrlResolver2(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL_Resolver(Path.Combine("XmlResolver", "XmlResolverTestMain.xsl"), null); + LoadXSL_Resolver(Path.Combine("XmlResolver", "XmlResolverTestMain.xsl"), xslInputType, readerType, null); } catch (XsltException e) { @@ -1971,13 +1491,13 @@ namespace System.Xml.Tests } //[Variation("Call Load with null source value")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrlResolver3() + public void LoadUrlResolver3(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL_Resolver(null, new XmlUrlResolver()); + LoadXSL_Resolver(null, xslInputType, readerType, new XmlUrlResolver()); } catch (ArgumentNullException e) { @@ -1989,71 +1509,6 @@ namespace System.Xml.Tests } } - /****************************************************************************************/ - /* XslCompiledTransform.Load(Reader/Navigator,XmlResolver,Evidence) - Integrity */ - /****************************************************************************************/ - - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Reader, Reader", Desc = "READER,READER")] - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Reader, Stream", Desc = "READER,STREAM")] - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Reader, Writer", Desc = "READER,WRITER")] - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Reader, TextWriter", Desc = "READER,TEXTWRITER")] - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Navigator, Reader", Desc = "NAVIGATOR,READER")] - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] - //[TestCase(Name = "XslCompiledTransform.Load(,XmlResolver,Evidence) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] - public class CLoadReaderResolverEvidenceTest : XsltApiTestCaseBase2 - { - private ITestOutputHelper _output; - public CLoadReaderResolverEvidenceTest(ITestOutputHelper output) : base(output) - { - _output = output; - } - - //[Variation("Call Load with style sheet that has script, pass null evidence, should throw security exception")] - [InlineData()] - [Theory] - public void LoadGeneric2() - { - /* - try - { - LoadXSL_Resolver_Evidence("scripting_unsafe_object.xsl", new XmlUrlResolver(), null); - } - catch(System.Security.Policy.PolicyException e) - { - _output.WriteLine(e.ToString()); - return; - } - _output.WriteLine("Did not throw a security exception for null evidence!"); - Assert.True(false); - */ - return; //TEST_SKIPPED; - } - - //BinCompat TODO: Add this test back - ////[Variation("Call Load with style sheet that has script, pass correct evidence")] - //[InlineData()] - //[Theory] - //public void LoadGeneric3() - //{ - // if (_isInProc) - // return; //TEST_SKIPPED; - - // Evidence evidence = new Evidence(); - // evidence.AddHost(new Zone(SecurityZone.MyComputer)); - // try - // { - // LoadXSL_Resolver_Evidence("scripting_unsafe_object.xsl", new XmlUrlResolver(), evidence); - // } - // catch (System.Security.Policy.PolicyException) - // { - // _output.WriteLine("Should not throw a security exception for correct evidence!"); - // Assert.True(false); - // } - // return; - //} - } - /***********************************************************/ /* XslCompiledTransform.Load(Url) */ /***********************************************************/ @@ -2068,20 +1523,20 @@ namespace System.Xml.Tests } //[Variation("Call Load with an invalid uri")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl1() + public void LoadUrl1(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL("IDontExist.xsl", XslInputType.URI, new XmlUrlResolver()); + LoadXSL("IDontExist.xsl", XslInputType.URI, readerType, new XmlUrlResolver()); _output.WriteLine("No exception was thrown"); Assert.True(false); } catch (FileNotFoundException e1) { _output.WriteLine(e1.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { @@ -2092,28 +1547,27 @@ namespace System.Xml.Tests catch (ArgumentNullException e2) { _output.WriteLine(e2.Message); - if (MyXslInputType() == XslInputType.URI) + if (xslInputType == XslInputType.URI) return; else { - _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + MyXslInputType() + "'"); + _output.WriteLine("ArgumentNullException is not supposed to be thrown for the input type '" + xslInputType + "'"); Assert.True(false); } } } //[Variation("Load file with empty string")] - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl2() + public void LoadUrl2(ReaderType readerType) { try { - LoadXSL(szEmpty, XslInputType.URI, new XmlUrlResolver()); + LoadXSL(szEmpty, XslInputType.URI, readerType, new XmlUrlResolver()); } catch (System.ArgumentException) { - // System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri) throws ArgumentException return; } _output.WriteLine("Exception not generated for an empty string filename"); @@ -2121,13 +1575,13 @@ namespace System.Xml.Tests } //[Variation("Load with \".\"")] - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl3() + public void LoadUrl3(ReaderType readerType) { try { - LoadXSL(".", XslInputType.URI, new XmlUrlResolver()); + LoadXSL(".", XslInputType.URI, readerType, new XmlUrlResolver()); } catch (System.UnauthorizedAccessException) { @@ -2138,13 +1592,13 @@ namespace System.Xml.Tests } //[Variation("Load with \"..\"")] - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl() + public void LoadUrl(ReaderType readerType) { try { - LoadXSL("..", XslInputType.URI, new XmlUrlResolver()); + LoadXSL("..", XslInputType.URI, readerType, new XmlUrlResolver()); } catch (System.UnauthorizedAccessException) { @@ -2156,60 +1610,21 @@ namespace System.Xml.Tests //[Variation("Load with \"\\\\\"")] [PlatformSpecific(TestPlatforms.Windows)] //Not an invalid path on Unix - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl5() + public void LoadUrl5(ReaderType readerType) { try { - LoadXSL("\\\\", XslInputType.URI, new XmlUrlResolver()); + LoadXSL("\\\\", XslInputType.URI, readerType, new XmlUrlResolver()); } catch (System.ArgumentException) { - // System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri) throws ArgumentException return; } _output.WriteLine("Exception not generated for non-existent file parameter name"); Assert.True(false); } - - /* - - //[Variation("Call Load with style sheet that has script, pass Url which does not have correct evidence, should fail")] - [InlineData()] - [Theory] - public void LoadUrl6() - { - try - { - LoadXSL_Resolver(FullHttpPath("XmlResolver/scripting_unsafe_object.xsl"), GetDefaultCredResolver()); - } - catch(System.Security.Policy.PolicyException) - { - return; - } - _output.WriteLine("Should throw a security exception for incorrect evidence!"); - Assert.True(false); - } - - //[Variation("Call Load with style sheet that has script, pass Url which has correct evidence, should pass")] - [InlineData()] - [Theory] - public void LoadUrl7() - { - try - { - LoadXSL("scripting_unsafe_object.xsl"); - } - catch(System.Security.Policy.PolicyException) - { - _output.WriteLine("Should not throw a security exception for correct evidence!"); - Assert.True(false); - } - return; - } - - */ } /***********************************************************/ @@ -2226,9 +1641,9 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void LoadNavigator1(object param) + public void LoadNavigator1(object param, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); xslt = new XslCompiledTransform(); @@ -2242,7 +1657,7 @@ namespace System.Xml.Tests xrLoad.Dispose(); xslt.Load(xdTemp); - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -2251,9 +1666,9 @@ namespace System.Xml.Tests } //[Variation("Create Navigator and navigate away from root", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void LoadNavigator2(object param) + public void LoadNavigator2(object param, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); xslt = new XslCompiledTransform(); @@ -2265,7 +1680,7 @@ namespace System.Xml.Tests xP.MoveToNext(); xslt.Load(xP); - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -2274,20 +1689,19 @@ namespace System.Xml.Tests } //[Variation("Basic check for usage of credentials on resolver, load XSL that needs cred. with correct resolver", Param = "XmlResolverTestMain.txt")] - [InlineData("XmlResolverTestMain.txt")] + [InlineData("XmlResolverTestMain.txt", OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void LoadNavigator3(object param) + public void LoadNavigator3(object param, OutputType outputType, NavType navType) { xslt = new XslCompiledTransform(); string Baseline = Path.Combine("baseline", (string)param); XmlReader xrLoad = XmlReader.Create(FullFilePath(Path.Combine("XmlResolver", "XmlResolverTestMain.xsl"))); - //xrLoad.XmlResolver = GetDefaultCredResolver(); XPathDocument xdTemp = new XPathDocument(xrLoad, XmlSpace.Preserve); XPathNavigator xP = ((IXPathNavigable)xdTemp).CreateNavigator(); xslt.Load(xP, XsltSettings.TrustedXslt, GetDefaultCredResolver()); - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -2296,28 +1710,29 @@ namespace System.Xml.Tests } //[Variation("Regression case for bug 80768")] - [ActiveIssue(9873)] [InlineData()] [Theory] public void LoadNavigator4() { - if (_isInProc) - return; //TEST_SKIPPED; + var e = Assert.ThrowsAny<XsltException>(() => + { + string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out>You are safe</out>"; - string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out>You are safe</out>"; + xslt = new XslCompiledTransform(); + XmlReader xrLoad = XmlReader.Create(FullFilePath("Bug80768.xsl")); + XPathDocument xd = new XPathDocument(xrLoad, XmlSpace.Preserve); - xslt = new XslCompiledTransform(); - XmlReader xrLoad = XmlReader.Create(FullFilePath("Bug80768.xsl")); - XPathDocument xd = new XPathDocument(xrLoad, XmlSpace.Preserve); + xslt.Load(xd, XsltSettings.TrustedXslt, new XmlUrlResolver()); - xslt.Load(xd, XsltSettings.TrustedXslt, new XmlUrlResolver()); + FileStream fs = new FileStream(_strOutFile, FileMode.Create, FileAccess.ReadWrite); + XPathNavigator xn = new MyNavigator(FullFilePath("foo.xml")); + xslt.Transform(xn, null, fs); + fs.Dispose(); - FileStream fs = new FileStream(_strOutFile, FileMode.Create, FileAccess.ReadWrite); - XPathNavigator xn = new MyNavigator(FullFilePath("foo.xml")); - xslt.Transform(xn, null, fs); - fs.Dispose(); + VerifyResult(expected); + }); - VerifyResult(expected); + Assert.Equal("Compiling JScript/CSharp scripts is not supported", e.InnerException.Message); } } @@ -2335,9 +1750,9 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", OutputType.Stream, NavType.XPathDocument)] [Theory] - public void LoadXmlReader1(object param) + public void LoadXmlReader1(object param, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); Boolean fTEST_FAIL = false; @@ -2364,7 +1779,7 @@ namespace System.Xml.Tests } if (fTEST_FAIL) Assert.True(false); - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -2526,18 +1941,18 @@ namespace System.Xml.Tests } //[Variation("Basic check for usage of credentials on resolver, load XSL that needs cred. with correct resolver", Param = "XmlResolverTestMain.txt")] - [InlineData("XmlResolverTestMain.txt")] + [InlineData("XmlResolverTestMain.txt", OutputType.Stream, NavType.XPathDocument)] [Theory] - public void LoadXmlReader7(object param) + public void LoadXmlReader7(object param, OutputType outputType, NavType navType) { xslt = new XslCompiledTransform(); string Baseline = Path.Combine("baseline", (string)param); XmlReader xrLoad = XmlReader.Create(FullFilePath(Path.Combine("XmlResolver", "XmlResolverTestMain.xsl"))); - //xrLoad.XmlResolver = GetDefaultCredResolver(); + xslt.Load(xrLoad, XsltSettings.TrustedXslt, GetDefaultCredResolver()); xrLoad.Dispose(); - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -2730,12 +2145,20 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test", Param = "showParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void TransformGeneric1(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void TransformGeneric1(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2745,14 +2168,22 @@ namespace System.Xml.Tests } //[Variation("Load and Transform multiple times", Param = "showParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void TransformGeneric2(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void TransformGeneric2(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); for (int i = 0; i < 5; i++) { - if ((LoadXSL("showParam.xsl") != 1) || (Transform("fruits.xml") != 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) != 1) || (Transform((string) "fruits.xml", (OutputType) outputType, navType) != 1)) Assert.True(false); VerifyResult(Baseline, _strOutFile); @@ -2761,16 +2192,24 @@ namespace System.Xml.Tests } //[Variation("Load once, Transform many times", Param = "showParam.txt")] - [InlineData("showParam.txt")] - [Theory] - public void TransformGeneric3(object param) + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void TransformGeneric3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { for (int i = 0; i < 100; i++) { - if (Transform("fruits.xml") != 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) != 1) { _output.WriteLine("Test failed to transform after {0} iterations", i); Assert.True(false); @@ -2783,14 +2222,16 @@ namespace System.Xml.Tests } //[Variation("Call Transform without loading")] - [InlineData()] + [InlineData(OutputType.Stream, NavType.XPathDocument)] + [InlineData(OutputType.Writer, NavType.XPathDocument)] + [InlineData(OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void TransformGeneric4() + public void TransformGeneric4(OutputType outputType, NavType navType) { xslt = new XslCompiledTransform(); try { - Transform("fruits.xml"); + Transform((string) "fruits.xml", (OutputType) outputType, navType); } catch (System.InvalidOperationException e) { @@ -2802,13 +2243,21 @@ namespace System.Xml.Tests } //[Variation("Closing XSL and XML files used in transform, Read access")] - [InlineData()] - [Theory] - public void TransformGeneric5() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void TransformGeneric5(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { FileStream s2; - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1)) { s2 = new FileStream(FullFilePath("showParam.xsl"), FileMode.Open, FileAccess.Read); s2.Dispose(); @@ -2822,41 +2271,23 @@ namespace System.Xml.Tests Assert.True(false); } - /* - //[Variation("Closing XSL and XML files used in transform, ReadWrite access")] - [InlineData()] - [Theory] - public void TransformGeneric6() - { - FileStream s2; - - if((LoadXSL("showParam.xsl") == TEST_PASS) && (Transform("fruits.xml") == TEST_PASS)) - { - s2 = new FileStream(FullFilePath("showParam.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - - s2 = new FileStream(FullFilePath("fruits.xml"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - - return; - } - _output.WriteLine("Encountered errors performing transform and could not verify if files were closed"); - Assert.True(false); - } - */ - //[Variation("Bug20003707 - InvalidProgramException for 2.0 stylesheets in forwards-compatible mode")] - [InlineData()] - [Theory] - public void TransformGeneric7() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void TransformGeneric7(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - if (_isInProc) - return; //TEST_SKIPPED; - try { - LoadXSL("ForwardComp.xsl"); - Transform("data.xml"); + LoadXSL("ForwardComp.xsl", xslInputType, readerType); + Transform((string) "data.xml", (OutputType) outputType, navType); } catch (XsltException e) { @@ -2879,17 +2310,22 @@ namespace System.Xml.Tests } //[Variation("Bug378293 - Incorrect error message when an attribute is added to a root node")] - [InlineData()] - [Theory] - public void TransformGeneric9() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void TransformGeneric9(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - if (_isInProc) - return; //TEST_SKIPPED; - try { - LoadXSL("RootNodeAtt.xsl"); - Transform("data.xml"); + LoadXSL("RootNodeAtt.xsl", xslInputType, readerType); + Transform((string) "data.xml", (OutputType) outputType, navType); } catch (XsltException e) { @@ -2914,17 +2350,22 @@ namespace System.Xml.Tests } //[Variation("Bug369463 - Invalid XPath exception in forward compatibility mode should render lineNumber linePosition")] - [InlineData()] - [Theory] - public void TransformGeneric11() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void TransformGeneric11(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - if (_isInProc) - return; //TEST_SKIPPED; - try { - LoadXSL("Bug369463.xsl"); - Transform("data.xml"); + LoadXSL("Bug369463.xsl", xslInputType, readerType); + Transform((string) "data.xml", (OutputType) outputType, navType); } catch (XsltException e) { @@ -2961,17 +2402,25 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver, load style sheet with import/include, should not affect transform")] - [InlineData()] - [Theory] - public void XmlResolver1() + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void XmlResolver1(XslInputType xslInputType , ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; try { - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType) == 1) { - if (TransformResolver("fruits.xml", null) == 1) + if (TransformResolver("fruits.xml", outputType, navType, null) == 1) { VerifyResult(expected); return; @@ -2989,19 +2438,27 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver, load style sheet with document function, should not resolve during transform", Param = "xmlResolver_document_function.txt")] - [InlineData("xmlResolver_document_function.txt")] + [InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("xmlResolver_document_function.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void XmlResolver2(object param) + public void XmlResolver2(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> string Baseline = Path.Combine("baseline", (string)param); - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", xslInputType, readerType) == 1) { - if (TransformResolver("fruits.xml", null) == 1) + if (TransformResolver("fruits.xml", outputType, navType, null) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -3016,18 +2473,26 @@ namespace System.Xml.Tests } //[Variation("Default XmlResolver, load style sheet with document function, should resolve during transform", Param = "DefaultResolver.txt")] - [InlineData("DefaultResolver.txt")] + [InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("DefaultResolver.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void XmlResolver3(object param) + public void XmlResolver3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> string Baseline = Path.Combine("baseline", (string)param); - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", xslInputType, readerType) == 1) { - if (Transform("fruits.xml") == 1) + if (Transform((string) "fruits.xml", (OutputType) outputType, navType) == 1) { VerifyResult(Baseline, _strOutFile); return; @@ -3042,20 +2507,27 @@ namespace System.Xml.Tests } //[Variation("document() has absolute URI")] - [ActiveIssue(14071)] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void XmlResolver5() + public void XmlResolver5(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result>123</result>"; // copy file on the local machine try { - string curDir = Directory.GetCurrentDirectory(); - string testFile = Path.Combine(curDir, "xmlResolver_document_function.xml"); + string tempPath = Path.GetTempPath(); + string testFile = Path.Combine(tempPath, "xmlResolver_document_function.xml"); if (File.Exists(testFile)) { File.SetAttributes(testFile, FileAttributes.Normal); @@ -3071,9 +2543,9 @@ namespace System.Xml.Tests return; //TEST_SKIPPED; } - if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl") == 1) + if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl", xslInputType, readerType) == 1) { - if (TransformResolver("fruits.xml", new XmlUrlResolver()) == 1) + if (TransformResolver("fruits.xml", outputType, navType, new XmlUrlResolver()) == 1) { VerifyResult(expected); return; @@ -3092,13 +2564,21 @@ namespace System.Xml.Tests } //[Variation("Pass null resolver but stylesheet doesn't have any include/imports")] - [InlineData()] - [Theory] - public void XmlResolver7() - { - LoadXSL("Bug382198.xsl"); + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] + public void XmlResolver7(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) + { + LoadXSL("Bug382198.xsl", xslInputType, readerType); // Pass null - TransformResolver("fruits.xml", null); + TransformResolver("fruits.xml", outputType, navType, null); return; } } @@ -3119,14 +2599,16 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr1(object param) + public void TransformStrStr1(object param, XslInputType xslInputType, ReaderType readerType) { string Baseline = Path.Combine("baseline", (string)param); String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { xslt.Transform(szFullFilename, _strOutFile); VerifyResult(Baseline, _strOutFile); @@ -3136,11 +2618,13 @@ namespace System.Xml.Tests } //[Variation("Input is null")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr2() + public void TransformStrStr2(XslInputType xslInputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3154,13 +2638,15 @@ namespace System.Xml.Tests } //[Variation("Output file is null")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr3() + public void TransformStrStr3(XslInputType xslInputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3176,11 +2662,13 @@ namespace System.Xml.Tests } //[Variation("Input is nonexisting file")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr4() + public void TransformStrStr4(XslInputType xslInputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3197,13 +2685,15 @@ namespace System.Xml.Tests //[Variation("Output file is invalid")] [PlatformSpecific(TestPlatforms.Windows)] //Output file name is valid on Unix - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr5() + public void TransformStrStr5(XslInputType xslInputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3219,11 +2709,13 @@ namespace System.Xml.Tests } //[Variation("Input is empty string")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr6() + public void TransformStrStr6(XslInputType xslInputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3239,13 +2731,15 @@ namespace System.Xml.Tests } //[Variation("Output file is empty string")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr7() + public void TransformStrStr7(XslInputType xslInputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3261,16 +2755,18 @@ namespace System.Xml.Tests } //[Variation("Call Transform many times", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr8(object param) + public void TransformStrStr8(object param, XslInputType xslInputType, ReaderType readerType) { string Baseline = Path.Combine("baseline", (string)param); String szFullFilename = FullFilePath("fruits.xml"); for (int i = 0; i < 50; i++) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { xslt.Transform(szFullFilename, _strOutFile); VerifyResult(Baseline, _strOutFile); @@ -3301,11 +2797,13 @@ namespace System.Xml.Tests } //[Variation("Output to unreachable destination")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr10() + public void TransformStrStr10(XslInputType xslInputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3322,12 +2820,14 @@ namespace System.Xml.Tests } //[Variation("Input filename is \'.\', \'..\', and \'\\\\\'")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr11() + public void TransformStrStr11(XslInputType xslInputType, ReaderType readerType) { int iCount = 0; - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { SetExpectedError("Xml_ResolveUrl"); try @@ -3366,13 +2866,15 @@ namespace System.Xml.Tests } //[Variation("Output filename is \'.\' and \'..\'")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr12() + public void TransformStrStr12(XslInputType xslInputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); int iCount = 0; - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { try { @@ -3401,13 +2903,15 @@ namespace System.Xml.Tests //[Variation("Output filename is \'\\\\\'")] [PlatformSpecific(TestPlatforms.Windows)] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr12_win() + public void TransformStrStr12_win(XslInputType xslInputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { Assert.Throws<System.ArgumentException>(() => xslt.Transform(szFullFilename, "\\\\")); return; @@ -3418,14 +2922,16 @@ namespace System.Xml.Tests } //[Variation("Closing files after transform")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr13() + public void TransformStrStr13(XslInputType xslInputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); Stream strmTemp; - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", xslInputType, readerType) == 1) { xslt.Transform(szFullFilename, _strOutFile); StreamReader fs = null; @@ -3448,29 +2954,6 @@ namespace System.Xml.Tests } Assert.True(false); } - - /* - //[Variation("Transform(test.xml, test.xml)")] - [InlineData()] - [Theory] - public void TransformStrStr14() - { - String szFullFilename = FullFilePath("Bug75295.xml"); - - // Copy this file to current directory - File.Delete("out.xml"); - File.Copy(szFullFilename, "out.xml"); - - if(LoadXSL("Bug75295.xsl") == TEST_PASS) - { - xslt.Transform("out.xml", "out.xml"); - - if (CheckResult(270.5223692973) == TEST_PASS) - return; - } - Assert.True(false); - } - */ } /***********************************************************/ @@ -3489,9 +2972,11 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver to Transform, load style sheet with import/include, should not affect transform")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStrResolver1() + public void TransformStrStrResolver1(XslInputType xslInputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); string expected = @"<result> @@ -3499,7 +2984,7 @@ namespace System.Xml.Tests <fruit>orange</fruit> </result>"; - if (LoadXSL("XmlResolver_Main.xsl", new XmlUrlResolver()) == 1) + if (LoadXSL("XmlResolver_Main.xsl", xslInputType, readerType, new XmlUrlResolver()) == 1) { XmlTextReader xr = new XmlTextReader(szFullFilename); XmlTextWriter xw = new XmlTextWriter("out.xml", Encoding.Unicode); @@ -3513,11 +2998,13 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver, load style sheet with document function, should not resolve during transform")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStrResolver2() + public void TransformStrStrResolver2(XslInputType xslInputType, ReaderType readerType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><elem>1</elem><elem>2</elem><elem>3</elem></result>"; @@ -3526,7 +3013,7 @@ namespace System.Xml.Tests String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", xslInputType, readerType) == 1) { xslt.Transform(szFullFilename, "out.xml"); VerifyResult(expected); @@ -3539,11 +3026,13 @@ namespace System.Xml.Tests } //[Variation("Pass XmlUrlResolver, load style sheet with document function, should resolve during transform", Param = "xmlResolver_document_function.txt")] - [InlineData("xmlResolver_document_function.txt")] + [InlineData("xmlResolver_document_function.txt", XslInputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader)] + [InlineData("xmlResolver_document_function.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStrResolver3(object param) + public void TransformStrStrResolver3(object param, XslInputType xslInputType, ReaderType readerType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> @@ -3551,7 +3040,7 @@ namespace System.Xml.Tests String szFullFilename = FullFilePath("fruits.xml"); string Baseline = Path.Combine("baseline", (string)param); - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", xslInputType, readerType) == 1) { xslt.Transform(szFullFilename, "out.xml"); VerifyResult(Baseline, _strOutFile); @@ -3600,9 +3089,9 @@ namespace System.Xml.Tests [InlineData("XmlResolver_Main.xsl", "fruits.xml", "xmlResolver_main.txt", "NullResolver", false, "IXPathNavigable")] [InlineData("XmlResolver_Main.xsl", "fruits.xml", "xmlResolver_main.txt", "NullResolver", false, "XmlReader")] [Theory] - public void ValidCases_ActiveIssue9876(object param0, object param1, object param2, object param3, object param4, object param5) + public void ValidCases_ExternalURI(object param0, object param1, object param2, object param3, object param4, object param5) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); ValidCases(param0, param1, param2, param3, param4, param5); } @@ -3780,9 +3269,9 @@ namespace System.Xml.Tests } //[Variation("Local parameter gets overwritten with global param value", Pri = 1)] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void var1() + public void var1(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out> param1 (correct answer is 'local-param1-arg'): local-param1-arg @@ -3791,7 +3280,7 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", string.Empty, "global-param1-arg"); - if ((LoadXSL("paramScope.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("paramScope.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -3801,9 +3290,9 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg } //[Variation("Local parameter gets overwritten with global variable value", Pri = 1)] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void var2() + public void var2(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out> param1 (correct answer is 'local-param1-arg'): local-param1-arg @@ -3812,7 +3301,7 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", string.Empty, "global-param1-arg"); - if ((LoadXSL("varScope.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("varScope.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -3822,16 +3311,16 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg } //[Variation("Subclassed XPathNodeIterator returned from an extension object or XsltFunction is not accepted by XPath", Pri = 1)] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void var3() + public void var3(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><distinct-countries>France, Spain, Austria, Germany</distinct-countries>"; m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject("http://foo.com", new MyXsltExtension()); - if ((LoadXSL("Bug111075.xsl") == 1) && (Transform_ArgList("Bug111075.xml") == 1)) + if ((LoadXSL("Bug111075.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("Bug111075.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -3841,9 +3330,9 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg } //[Variation("Iterator using for-each over a variable is not reset correctly while using msxsl:node-set()", Pri = 1)] - [InlineData()] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void var4() + public void var4(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> Node Count: {3} @@ -3852,7 +3341,7 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg Correct Output: (1)(2)(3) Incorrect Output: [1][2][3]"; - if ((LoadXSL("Bug109644.xsl") == 1) && (Transform("foo.xml") == 1)) + if ((LoadXSL("Bug109644.xsl", xslInputType, readerType) == 1) && (Transform((string) "foo.xml", (OutputType) outputType, navType) == 1)) { Assert.Equal(expected, File.ReadAllText("out.xml"), ignoreLineEndingDifferences:true); } @@ -3870,97 +3359,37 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg _output = output; } - //BinCompat TODO: Add this test back - ////[Variation("Bug398968 - Globalization is broken for document() function")] - //[InlineData()] - //[Theory] - //public void RegressionTest1() - //{ - // // <SQL BU Defect Tracking 410060> - // if (_isInProc) - // return; //TEST_SKIPPED; - // // </SQL BU Defect Tracking 410060> - - // string testFile = "Stra\u00DFe.xml"; - - // // Create the file. - // using (FileStream fs = File.Open(testFile, FileMode.Open)) - // { - // Byte[] info = new UTF8Encoding(true).GetBytes("<PASSED/>"); - // fs.Write(info, 0, info.Length); - // } - - // LoadXSL("398968repro.xsl"); - // Transform("data.xml"); - // return; - //} - - //BinCompat TODO: Add this test back - ////[Variation("Bug410158 - Debug flag on XslCompiledTransform contaminates XsltSettings")] - //[InlineData()] - //[Theory] - //public void RegressionTest2() - //{ - // // <SQL BU Defect Tracking 410060> - // // This test uses Reflection, which doenst work inproc - // if (_isInProc) - // return; //TEST_SKIPPED; - // // </SQL BU Defect Tracking 410060> - - // string stylesheet = "<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'/>"; - // XsltSettings settings = new XsltSettings(); - // XmlResolver resolver = new XmlUrlResolver(); - - // int debuggableCnt1 = 0; - // foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) - // { - // string asmName = asm.GetName().Name; - // if (asmName.StartsWith("System.Xml.Xsl.CompiledQuery.", StringComparison.Ordinal)) - // { - // IEnumerable<Attribute> debuggableAttrs = asm.GetCustomAttributes(typeof(DebuggableAttribute)); - // if (debuggableAttrs.Count() > 0 && ((DebuggableAttribute)debuggableAttrs.First()).IsJITTrackingEnabled) - // { - // debuggableCnt1++; - // } - // } - // } - // _output.WriteLine("Number of debuggable XSLT stylesheets loaded (before load): " + debuggableCnt1); - - // XslCompiledTransform xct1 = new XslCompiledTransform(true); - // xct1.Load(XmlReader.Create(new StringReader(stylesheet)), settings, resolver); - - // XslCompiledTransform xct2 = new XslCompiledTransform(false); - // xct2.Load(XmlReader.Create(new StringReader(stylesheet)), settings, resolver); - - // int debuggableCnt2 = 0; - // foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) - // { - // string asmName = asm.GetName().Name; - // if (asmName.StartsWith("System.Xml.Xsl.CompiledQuery.", StringComparison.Ordinal)) - // { - // IEnumerable<Attribute> debuggableAttrs = asm.GetCustomAttributes(typeof(DebuggableAttribute)); - // if (debuggableAttrs.Count() > 0 && ((DebuggableAttribute)debuggableAttrs.First()).IsJITTrackingEnabled) - // { - // debuggableCnt2++; - // } - // } - // } - // _output.WriteLine("Number of debuggable XSLT stylesheets loaded (after load): " + debuggableCnt2); - - // if (debuggableCnt2 - debuggableCnt1 == 1) - // return; - // else - // Assert.True(false); - //} + //[Variation("Bug398968 - Globalization is broken for document() function")] + [PlatformSpecific(TestPlatforms.Windows)] //[ActiveIssue(14750)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [Theory] + public void RegressionTest1(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) + { + // <SQL BU Defect Tracking 410060> + // </SQL BU Defect Tracking 410060> + + string testFile = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "XsltApiV2", "Stra\u00DFe.xml"); + + // Create the file. + using (FileStream fs = File.Open(testFile, FileMode.Open)) + { + Byte[] info = new UTF8Encoding(true).GetBytes("<PASSED />"); + fs.Write(info, 0, info.Length); + } + + LoadXSL("398968repro.xsl", xslInputType, readerType); + Transform((string) "data.xml", (OutputType) outputType, navType); + return; + } //[Variation("Bug412703 - Off-by-one errors for XSLT loading error column")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)] [Theory] - public void RegressionTest3() + public void RegressionTest3(XslInputType xslInputType, ReaderType readerType) { try { - LoadXSL("bug370868.xsl"); + LoadXSL("bug370868.xsl", xslInputType, readerType); } catch (System.Xml.Xsl.XsltException e) { @@ -3995,16 +3424,6 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg return; } - // TODO: DENY is deprecated - ////[Variation("Bug429365 & SRZ070601000889 - XslCompiledTransform.Transform() fails on x64 when caller does not have UnmanagedCode privilege")] - //[InlineData()] - //public int RegressionTest6() - //{ - // // Should not throw - // ExecuteTransform(); - // return; - //} - //[Variation("Bug469781 - Replace shouldn't relax original type 'assertion failure'")] [InlineData()] [Theory] @@ -4068,20 +3487,6 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg Assert.True(false); } - - //[SecurityPermission(SecurityAction.Deny, UnmanagedCode = true)] - //private void ExecuteTransform() - //{ - // XslCompiledTransform xslCompiledTransform = new XslCompiledTransform(); - // xslCompiledTransform.Load(FullFilePath("xslt_sortnames.xsl")); - - // MemoryStream ms = new MemoryStream(); - // StreamReader stmRead = new StreamReader(ms, true); - // xslCompiledTransform.Transform(FullFilePath("xslt_names.xml"), null, ms); - // ms.Seek(0, new SeekOrigin()); - // string foo = stmRead.ReadToEnd(); - // _output.WriteLine(foo); - //} } internal class MyArrayIterator : XPathNodeIterator diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs index e67da3a913..a15b046c08 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs @@ -4,11 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Reflection; -using System.Runtime.Loader; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; using XmlCoreTest.Common; @@ -30,7 +26,7 @@ namespace System.Xml.Tests Init(null); } - public /*override*/ new void Init(object objParam) + public new void Init(object objParam) { xsltSameInstance = new XslCompiledTransform(); _strPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltApiV2\"); @@ -38,112 +34,11 @@ namespace System.Xml.Tests } } - //[TestCase(Name = "Same instance testing: Transform() - Type & MethodInfo")] - public class SameTypeCompiledTransform : XsltApiTestCaseBase2 - { - protected string _strPath; // Path of the data files - protected int counter; - - private Assembly _asm; - private Type _type; - private MethodInfo _meth; - private Byte[] _staticData; - private Type[] _ebTypes; - - private ITestOutputHelper _output; - public SameTypeCompiledTransform(ITestOutputHelper output) : base(output) - { - _output = output; - Init(null); - } - - public /*override*/ new void Init(object objParam) - { - _strPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltApiV2\"); - counter = 0; - InitTestData(); - return; - } - - private void InitTestData() - { - string filePath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\Scripting28.dll"); - _asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.GetFullPath(filePath)); - _type = _asm.GetType("Scripting28"); - _meth = ReflectionTestCaseBase.GetStaticMethod(_type, "Execute"); - _staticData = (Byte[])_type.GetTypeInfo().GetField("staticData", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(_type); - _ebTypes = (Type[])_type.GetTypeInfo().GetField("ebTypes", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static).GetValue(_type); - } - - public int LoadAndTransformWithType(Object args) - { - XslCompiledTransform xslt = new XslCompiledTransform(); - xslt.Load(_type); - string filePath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\Scripting28.xsl"); - xslt.Transform(filePath, String.Format("out{0}.txt", System.Threading.Interlocked.Increment(ref counter))); - return 1; - } - - public int LoadAndTransformWithMethodInfo(Object args) - { - XslCompiledTransform xslt = new XslCompiledTransform(); - xslt.Load(_meth, _staticData, _ebTypes); - string filePath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\precompiled\Scripting28.xsl"); - xslt.Transform(filePath, String.Format("out{0}.txt", System.Threading.Interlocked.Increment(ref counter))); - return 1; - } - - //////////////////////////////////////////////////////////////// - // Same type testing: - // Multiple Transform() over same XslCompiledTransform object - //////////////////////////////////////////////////////////////// - //[Variation("Multiple Loads on Type and Transform")] - [ActiveIssue(9873)] - [InlineData()] - [Theory] - public void proc1() - { - CThreads rThreads = new CThreads(_output); - - for (int i = 0; i < 1000; i++) - { - rThreads.Add(new ThreadFunc(LoadAndTransformWithType), i.ToString()); - } - - //Wait until they are complete - rThreads.Start(); - rThreads.Wait(); - - return; - } - - //[Variation("Multiple Loads with Common MethodInfo, ebTypes and static data and Transform")] - [ActiveIssue(9873)] - [InlineData()] - [Theory] - public void proc2() - { - CThreads rThreads = new CThreads(_output); - - for (int i = 0; i < 1000; i++) - { - rThreads.Add(new ThreadFunc(LoadAndTransformWithMethodInfo), i.ToString()); - } - - //Wait until they are complete - rThreads.Start(); - rThreads.Wait(); - - return; - } - } - //[TestCase(Name = "Same instance testing: Transform() - READER")] public class SameInstanceXslTransformReader : SameInstanceXslTransformTestCase { private XPathDocument _xd; // Loads XML file private XmlReader _xrData; // Loads XML File - //private XmlReader xr; // Reader output of transform is not supported in XSLT V2 private ITestOutputHelper _output; public SameInstanceXslTransformReader(ITestOutputHelper output) : base(output) @@ -206,7 +101,7 @@ namespace System.Xml.Tests [Theory] public void proc2() { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); Load("QFE505_multith_customer_repro_with_or_expr.xsl", "QFE505_multith_customer_repro_with_or_expr.xml"); @@ -505,7 +400,7 @@ namespace System.Xml.Tests [Theory] public void proc2() { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); Load("QFE505_multith_customer_repro_with_or_expr.xsl", "QFE505_multith_customer_repro_with_or_expr.xml"); diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs index 60d94c69ec..c65f3cfd66 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltApiV2.cs @@ -4,18 +4,12 @@ using Xunit; using Xunit.Abstractions; -using System; -using System.Globalization; using System.IO; -using System.Net; -using System.Reflection; using System.Text; -using System.Xml; using System.Xml.XmlDiff; using System.Xml.XPath; using System.Xml.Xsl; using XmlCoreTest.Common; -using OLEDB.Test.ModuleCore; namespace System.Xml.Tests { @@ -40,41 +34,10 @@ namespace System.Xml.Tests } //////////////////////////////////////////////////////////////// - // Module declaration for LTM usage - // - //////////////////////////////////////////////////////////////// - //[TestModule(Name = "XsltApiV2", Desc = "XslCompiledTransform API Tests", Pri = 1)] - public class XslCompiledTransformModule : CTestModule - { - public override int Init(object objParam) - { - int ret = base.Init(objParam); - - // These steps use to be part of javascript files and these were copied and executed as test setup step. - // I belive this to be a much better way of accomplishing the same task. - // Logic from CreateApiTestFiles.js - string sourceFile = Path.Combine(FilePathUtil.GetTestDataPath(), "XsltApiV2", "xmlResolver_document_function.xml"); - string targetFile = @"c:\temp\xmlResolver_document_function.xml"; - if (!Directory.Exists(@"c:\temp")) - Directory.CreateDirectory(@"c:\temp"); - if (!File.Exists(targetFile)) - File.Copy(sourceFile, targetFile, true); - - // Logic from CreateStrasse.js - using (XmlWriter writer = XmlWriter.Create("Stra\u00DFe.xml")) - { - writer.WriteComment(" "); - } - - return ret; - } - } - - //////////////////////////////////////////////////////////////// // Base class for test cases // //////////////////////////////////////////////////////////////// - public class XsltApiTestCaseBase2 //: CTestCase + public class XsltApiTestCaseBase2 { // Generic data for all derived test cases public String szXslNS = "http://www.w3.org/1999/XSL/Transform"; @@ -91,12 +54,7 @@ namespace System.Xml.Tests private string _strPath; // Path of the data files private string _httpPath; // Http Path of the data files - private XslInputType _nInputXsl; // reader, url, or navigator - private XmlInputType _nInputXml = XmlInputType.Reader; // reader, url, or navigator private bool _fTrace; // Should we write out the results of the transform? - private OutputType _nOutput; // Type of XSL Transform to do - private NavType _navType; // Data document type - private ReaderType _readerType; // Reader type // Other global variables protected string _strOutFile = "out.xml"; // File to create when using write transforms @@ -106,7 +64,6 @@ namespace System.Xml.Tests protected XsltArgumentList m_xsltArg; // For XsltArgumentList tests public object retObj; - protected bool _isInProc; // Is the current test run in proc or /Host None? protected string _standardTests; private ITestOutputHelper _output; @@ -117,29 +74,16 @@ namespace System.Xml.Tests this.Init(null); } - public XslInputType MyXslInputType() - { - return _nInputXsl; - } - - public XmlInputType MyXmlInputType() + static XsltApiTestCaseBase2() { - return _nInputXml; - } - - public OutputType MyOutputType() - { - return _nOutput; - } - - public NavType MyDocType() - { - return _navType; - } - - public ReaderType MyReaderType() - { - return _readerType; + // Replace absolute URI in xmlResolver_document_function.xml based on the environment + string targetFile = Path.Combine(Path.GetTempPath(), "xmlResolver_document_function.xml"); + string xslFile = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "XsltApiV2", "xmlResolver_document_function_absolute_uri.xsl"); + XmlDocument doc = new XmlDocument(); + doc.Load(xslFile); + string xslString = doc.OuterXml.Replace("ABSOLUTE_URI", targetFile); + doc.LoadXml(xslString); + doc.Save(xslFile); } public OutputType GetOutputType(String s) @@ -158,7 +102,6 @@ namespace System.Xml.Tests public XmlUrlResolver GetDefaultCredResolver() { XmlUrlResolver myDefaultCredResolver = new XmlUrlResolver(); - //myDefaultCredResolver.Credentials = CredentialCache.DefaultCredentials; return myDefaultCredResolver; } @@ -216,21 +159,10 @@ namespace System.Xml.Tests } } - public String InitStringValue(String str) - { - return String.Empty; - } - public void Init(object objParam) { - // Get input and transform type from attribute - _nInputXsl = GetXslInputType(String.Empty); - _nOutput = GetOutputType(String.Empty); - // Get parameter info from runtime variables passed to LTM _fTrace = false; - _navType = GetDocType(InitStringValue("doctype")); - _readerType = GetReaderType(InitStringValue("readertype")); //This is a temporary fix to restore the baselines. Refer to Test bug # _strPath = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "XsltApiV2"); @@ -327,17 +259,12 @@ namespace System.Xml.Tests // -------------------------------------------------------------------------------------------------------------- // LoadXSL // ------------------------------------------------------------------------------------------------------------- - public int LoadXSL(String _strXslFile) + public int LoadXSL(string _strXslFile, XslInputType xslInputType, ReaderType readerType) { - return LoadXSL(_strXslFile, _nInputXsl, new XmlUrlResolver()); + return LoadXSL(_strXslFile, xslInputType, readerType, new XmlUrlResolver()); } - public int LoadXSL(String _strXslFile, XmlResolver xr) - { - return LoadXSL(_strXslFile, _nInputXsl, xr); - } - - public int LoadXSL(String _strXslFile, XslInputType xslInputType, XmlResolver xr) + public int LoadXSL(string _strXslFile, XslInputType xslInputType, ReaderType readerType, XmlResolver xr) { _strXslFile = FullFilePath(_strXslFile); xslt = new XslCompiledTransform(); @@ -346,12 +273,13 @@ namespace System.Xml.Tests switch (xslInputType) { case XslInputType.URI: - /* _output.WriteLine("Loading style sheet as URI {0}", _strXslFile); - xslt.Load(_strXslFile, XsltSettings.TrustedXslt, xr); - break; - */ + _output.WriteLine("Loading style sheet as URI {0}", _strXslFile); + xrs = new XmlReaderSettings() { DtdProcessing = DtdProcessing.Parse}; + xslt.Load(XmlReader.Create(_strXslFile, xrs), XsltSettings.TrustedXslt, xr); + break; + case XslInputType.Reader: - switch (_readerType) + switch (readerType) { case ReaderType.XmlTextReader: XmlTextReader trTemp = new XmlTextReader(_strXslFile); @@ -425,12 +353,12 @@ namespace System.Xml.Tests // -------------------------------------------------------------------------------------------------------------- // LoadXSL_Resolver // ------------------------------------------------------------------------------------------------------------- - public int LoadXSL_Resolver(String _strXslFile, XmlResolver xr) + public int LoadXSL_Resolver(string _strXslFile, XslInputType xslInputType, ReaderType readerType, XmlResolver xr) { _strXslFile = FullFilePath(_strXslFile); xslt = new XslCompiledTransform(); XmlReaderSettings xrs = null; - switch (_nInputXsl) + switch (xslInputType) { case XslInputType.URI: _output.WriteLine("Loading style sheet as URI " + _strXslFile); @@ -438,7 +366,7 @@ namespace System.Xml.Tests break; case XslInputType.Reader: - switch (_readerType) + switch (readerType) { case ReaderType.XmlTextReader: XmlTextReader trTemp = new XmlTextReader(_strXslFile); @@ -507,97 +435,6 @@ namespace System.Xml.Tests return 1; } - // -------------------------------------------------------------------------------------------------------------- - // LoadXSL_Resolver_Evidence - // ------------------------------------------------------------------------------------------------------------- - /*public int LoadXSL_Resolver_Evidence(String _strXslFile, XmlResolver xr, Evidence e) - { - _strXslFile = FullFilePath(_strXslFile); - xslt = new XslCompiledTransform(); - - switch (_nInputXsl) - { - case XslInputType.Reader: - switch (_readerType) - { - case ReaderType.XmlTextReader: - XmlReader trTemp = XmlReader.Create(_strXslFile); - try - { - _output.WriteLine("Loading style sheet as XmlTextReader " + _strXslFile); - //xslt.Load(trTemp, xr, e); //Evidence is not supported on V2 XSLT Load - xslt.Load(trTemp, XsltSettings.TrustedXslt, xr); - } - catch (Exception ex) - { - throw (ex); - } - finally - { - if (trTemp != null) - trTemp.Dispose(); - } - break; - - case ReaderType.XmlNodeReader: - XmlDocument docTemp = new XmlDocument(); - docTemp.Load(_strXslFile); - XmlNodeReader nrTemp = new XmlNodeReader(docTemp); - try - { - _output.WriteLine("Loading style sheet as XmlNodeReader " + _strXslFile); - //xslt.Load(nrTemp, xr, e); Evidence is not supported in V2 XSLT Load - xslt.Load(nrTemp, XsltSettings.TrustedXslt, xr); - } - catch (Exception ex) - { - throw (ex); - } - finally - { - if (nrTemp != null) - nrTemp.Dispose(); - } - break; - - case ReaderType.XmlValidatingReader: - default: - XmlReaderSettings xrs = new XmlReaderSettings(); -#pragma warning disable 0618 - xrs.ProhibitDtd = false; -#pragma warning restore 0618 - XmlReader vrTemp = null; - try - { - vrTemp = XmlReader.Create(_strXslFile, xrs); - _output.WriteLine("Loading style sheet as XmlValidatingReader " + _strXslFile); - //xslt.Load(vrTemp, xr, e); Evidence is not supported in V2 XSLT Load - xslt.Load(vrTemp, XsltSettings.TrustedXslt, xr); - } - catch (Exception ex) - { - throw (ex); - } - finally - { - if (vrTemp != null) - vrTemp.Dispose(); - } - break; - } - break; - - case XslInputType.Navigator: - XmlReader xrLoad = XmlReader.Create(_strXslFile); - XPathDocument xdTemp = new XPathDocument(xrLoad, XmlSpace.Preserve); - xrLoad.Dispose(); - _output.WriteLine("Loading style sheet as Navigator " + _strXslFile); - xslt.Load(xdTemp.CreateNavigator(), XsltSettings.TrustedXslt, xr); - break; - } - return 1; - }*/ - //VerifyResult public void VerifyResult(string expectedValue) { @@ -685,23 +522,23 @@ namespace System.Xml.Tests // Transform // ------------------------------------------------------------------------------------------------------------- - public int Transform(String szXmlFile) + public int Transform(string szXmlFile, OutputType outputType, NavType navType) { // Default value of errorCase is false - return (Transform(szXmlFile, false)); + return (Transform(szXmlFile, outputType, navType, false)); } - public int Transform(String szXmlFile, bool errorCase) + public int Transform(String szXmlFile, OutputType outputType, NavType navType, bool errorCase) { szXmlFile = FullFilePath(szXmlFile); _output.WriteLine("Loading XML " + szXmlFile); - IXPathNavigable xd = LoadXML(szXmlFile, _navType); + IXPathNavigable xd = LoadXML(szXmlFile, navType); _output.WriteLine("Executing transform"); xrXSLT = null; Stream strmTemp = null; - switch (_nOutput) + switch (outputType) { case OutputType.Stream: try @@ -754,23 +591,23 @@ namespace System.Xml.Tests // Transform_ArgList // ------------------------------------------------------------------------------------------------------------- - public int Transform_ArgList(String szXmlFile) + public int Transform_ArgList(string szXmlFile, OutputType outputType, NavType navType) { // Default value of errorCase is false - return (Transform_ArgList(szXmlFile, false)); + return (Transform_ArgList(szXmlFile, outputType, navType, false)); } - public int Transform_ArgList(String szXmlFile, bool errorCase) + public int Transform_ArgList(string szXmlFile, OutputType outputType, NavType navType, bool errorCase) { szXmlFile = FullFilePath(szXmlFile); _output.WriteLine("Loading XML " + szXmlFile); - IXPathNavigable xd = LoadXML(szXmlFile, _navType); + IXPathNavigable xd = LoadXML(szXmlFile, navType); _output.WriteLine("Executing transform"); xrXSLT = null; Stream strmTemp = null; - switch (_nOutput) + switch (outputType) { case OutputType.Stream: try @@ -823,24 +660,24 @@ namespace System.Xml.Tests // TransformResolver // ------------------------------------------------------------------------------------------------------------- - public int TransformResolver(String szXmlFile, XmlResolver xr) + public int TransformResolver(string szXmlFile, OutputType outputType, NavType navType, XmlResolver xr) { // Default value of errorCase is false - return (TransformResolver(szXmlFile, xr, false)); + return (TransformResolver(szXmlFile, outputType, navType, xr, false)); } - public int TransformResolver(String szXmlFile, XmlResolver xr, bool errorCase) + public int TransformResolver(string szXmlFile, OutputType outputType, NavType navType, XmlResolver xr, bool errorCase) { szXmlFile = FullFilePath(szXmlFile); _output.WriteLine("Loading XML " + szXmlFile); - IXPathNavigable xd = LoadXML(szXmlFile, _navType); + IXPathNavigable xd = LoadXML(szXmlFile, navType); _output.WriteLine("Executing transform"); xrXSLT = null; Stream strmTemp = null; - switch (_nOutput) + switch (outputType) { case OutputType.Stream: try @@ -890,12 +727,12 @@ namespace System.Xml.Tests // -------------------------------------------------------------------------------------------------------------- // CheckResult // ------------------------------------------------------------------------------------------------------------- - public int CheckResult(double szExpResult) + public int CheckResult(double szExpResult, OutputType outputType) { double checksumActual; CXsltChecksum check = new CXsltChecksum(_fTrace, _output); - if (_nOutput == OutputType.URI) + if (outputType == OutputType.URI) checksumActual = check.Calc(xrXSLT); else checksumActual = check.Calc(_strOutFile); @@ -910,41 +747,6 @@ namespace System.Xml.Tests return 1; } - - public int CheckResult(string expResult) - { - double actChecksum, expChecksum; - CXsltChecksum check = new CXsltChecksum(_fTrace, _output); - - // Let's make sure we use the same checksum calculating function for - // actual and expected so we know we are comparing apples to apples. - if (_nOutput == OutputType.URI) - { - expChecksum = check.Calc(XmlReader.Create(new StringReader(expResult))); - actChecksum = check.Calc(xrXSLT); - } - else - { - using (StreamWriter sw = new StreamWriter(new FileStream(Path.Combine(Directory.GetCurrentDirectory(), "expectdchecksum.xml"), FileMode.Create, FileAccess.Write))) - { - sw.Write(expResult); - } - expChecksum = check.Calc("expectdchecksum.xml"); - actChecksum = check.Calc(_strOutFile); - } - - if (expChecksum != actChecksum || _fTrace) - { - _output.WriteLine("Act Xml: {0}", check.Xml); - _output.WriteLine("Exp Xml: {0}", expResult); - _output.WriteLine("Actual checksum: {0}, Expected: {1}", actChecksum, expChecksum); - } - - if (expChecksum != actChecksum) - return 0; - - return 1; - } } internal class CExceptionHandler @@ -973,7 +775,7 @@ namespace System.Xml.Tests public bool VerifyException(Exception ex) { Type _type = ex.GetType(); - res = String.Empty;//(string)_type.InvokeMember("res", BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.Instance, null, ex, null); + res = String.Empty; msg = (string)_nav.Evaluate("string(/exceptions/exception [@res = '" + res + "']/@message)"); try { @@ -989,7 +791,6 @@ namespace System.Xml.Tests public bool VerifyException(Exception ex, string res, string[] strParams) { - //msg = (string)nav.Evaluate("string(/exceptions/exception [@res = '"+res+"']/@message)"); try { _exVer.IsExceptionOk(ex, res, strParams); diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs index ac9df1dfc4..6199e57de6 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentList.cs @@ -4,16 +4,11 @@ using Xunit; using Xunit.Abstractions; -using System; using System.Collections.Generic; using System.Dynamic; -using System.Globalization; using System.IO; -using System.Security; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; -using XmlCoreTest.Common; namespace System.Xml.Tests { @@ -635,9 +630,9 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 1)] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject1() + public void GetExtObject1(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); @@ -653,7 +648,7 @@ namespace System.Xml.Tests } string expXml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><result xmlns:myObj=\"urn:my-object\"><func1>1.Test1</func1><func2>2.Test2</func2><func3>3.Test3</func3></result>"; - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expXml); return; @@ -682,9 +677,9 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is empty string", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject3(object param) + public void GetExtObject3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -699,7 +694,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -709,9 +704,9 @@ namespace System.Xml.Tests } //[Variation("Namespace URI non-existent")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject4() + public void GetExtObject4(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { m_xsltArg = new XsltArgumentList(); @@ -724,8 +719,8 @@ namespace System.Xml.Tests } try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml"); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType); } catch (System.Xml.Xsl.XsltException) { @@ -736,9 +731,9 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject5() + public void GetExtObject5(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { m_xsltArg = new XsltArgumentList(); MyObject obj = new MyObject(5, _output); @@ -753,7 +748,7 @@ namespace System.Xml.Tests } string expXml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><result xmlns:myObj=\"http://www.microsoft.com/this/is/a/very/long/namespace/uri/to/do/the/api/testing/for/xslt/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/\"><func1>1.Test1</func1><func2>2.Test2</func2><func3>3.Test3</func3></result>"; - if ((LoadXSL("myObjectLongNS.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectLongNS.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expXml); return; @@ -838,9 +833,9 @@ namespace System.Xml.Tests } //[Variation("Case sensitivity")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject8() + public void GetExtObject8(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(8, _output); m_xsltArg = new XsltArgumentList(); @@ -876,7 +871,7 @@ namespace System.Xml.Tests } string expXml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><result xmlns:myObj=\"urn:my-object\"><func1>1.Test1</func1><func2>2.Test2</func2><func3>3.Test3</func3></result>"; - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expXml); return; @@ -886,9 +881,9 @@ namespace System.Xml.Tests } //[Variation("Whitespace")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject9() + public void GetExtObject9(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { int i = 1; m_xsltArg = new XsltArgumentList(); @@ -909,8 +904,8 @@ namespace System.Xml.Tests try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml"); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType); } catch (System.Xml.Xsl.XsltException) { @@ -921,9 +916,9 @@ namespace System.Xml.Tests } //[Variation("Call after object has been removed")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject10() + public void GetExtObject10(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(10, _output); m_xsltArg = new XsltArgumentList(); @@ -940,8 +935,8 @@ namespace System.Xml.Tests try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml"); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType); } catch (System.Xml.Xsl.XsltException) { @@ -952,9 +947,9 @@ namespace System.Xml.Tests } //[Variation("Call multiple times")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void GetExtObject11() + public void GetExtObject11(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(11, _output); m_xsltArg = new XsltArgumentList(); @@ -971,7 +966,7 @@ namespace System.Xml.Tests } } string expXml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><result xmlns:myObj=\"urn:my-object\"><func1>1.Test1</func1><func2>2.Test2</func2><func3>3.Test3</func3></result>"; - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expXml); return; @@ -1022,9 +1017,17 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 1, Param = "showParam1.txt")] - [InlineData("showParam1.txt")] + [InlineData("showParam1.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam1.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam1(object param) + public void AddParam1(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1035,7 +1038,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1083,9 +1086,17 @@ namespace System.Xml.Tests } //[Variation("Very Long Param Name", Param = "LongParam.txt")] - [InlineData("LongParam.txt")] + [InlineData("LongParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("LongParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam4(object param) + public void AddParam4(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1096,7 +1107,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParamLongName.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParamLongName.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1144,9 +1155,17 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is empty string", Param = "showParam7.txt")] - [InlineData("showParam7.txt")] + [InlineData("showParam7.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam7.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam7(object param) + public void AddParam7(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1158,7 +1177,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test7") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1168,9 +1187,17 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam8(object param) + public void AddParam8(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1181,7 +1208,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test8") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1222,9 +1249,17 @@ namespace System.Xml.Tests } //[Variation("Object with same name, different namespace System.Xml.Tests", Param = "AddParam12.txt")] - [InlineData("AddParam12.txt")] + [InlineData("AddParam12.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam12.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam12(object param) + public void AddParam12(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); @@ -1249,7 +1284,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1259,9 +1294,17 @@ namespace System.Xml.Tests } //[Variation("Object with same namespace System.Xml.Tests, different name", Param = "AddParam13.txt")] - [InlineData("AddParam13.txt")] + [InlineData("AddParam13.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam13.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam13(object param) + public void AddParam13(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1285,7 +1328,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1295,9 +1338,17 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity", Param = "AddParam14.txt")] - [InlineData("AddParam14.txt")] + [InlineData("AddParam14.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam14.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam14(object param) + public void AddParam14(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1326,7 +1377,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test3") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1355,9 +1406,17 @@ namespace System.Xml.Tests } //[Variation("Add/remove object many times", Param = "AddParam16.txt")] - [InlineData("AddParam16.txt")] + [InlineData("AddParam16.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam16.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam16(object param) + public void AddParam16(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1396,7 +1455,7 @@ namespace System.Xml.Tests retObj = m_xsltArg.GetParam("myArg2", szEmpty); if (retObj.ToString() != "Test2") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1406,9 +1465,17 @@ namespace System.Xml.Tests } //[Variation("Whitespace in URI and param", Param = "AddParam17.txt")] - [InlineData("AddParam17.txt")] + [InlineData("AddParam17.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam17.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam17(object param) + public void AddParam17(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); int i = 1; @@ -1451,7 +1518,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1461,9 +1528,17 @@ namespace System.Xml.Tests } //[Variation("Adding many objects", Param = "AddParam18.txt")] - [InlineData("AddParam18.txt")] + [InlineData("AddParam18.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam18.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam18(object param) + public void AddParam18(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1477,7 +1552,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1487,9 +1562,17 @@ namespace System.Xml.Tests } //[Variation("Add same object many times", Param = "AddParam19.txt")] - [InlineData("AddParam19.txt")] + [InlineData("AddParam19.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam19.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam19(object param) + public void AddParam19(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -1511,7 +1594,7 @@ namespace System.Xml.Tests retObj = m_xsltArg.GetParam("myArg2", szEmpty); if (retObj.ToString() != ("Test2")) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1521,9 +1604,17 @@ namespace System.Xml.Tests } //[Variation("Using Different XSLT namespace", Param = "AddParam20.txt")] - [InlineData("AddParam20.txt")] + [InlineData("AddParam20.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParam20.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam20(object param) + public void AddParam20(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); @@ -1553,7 +1644,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test4") Assert.True(false); - if ((LoadXSL("showParamNS.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParamNS.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1575,27 +1666,35 @@ namespace System.Xml.Tests } //[Variation("Parameters should not be cached")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject32() + public void AddExtObject32(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected1 = @"<?xml version=""1.0"" encoding=""utf-8""?><out>Param: first</out>"; string expected2 = @"<?xml version=""1.0"" encoding=""utf-8""?><out>Param: second</out>"; - if (LoadXSL("test_Param.xsl") == 1) + if (LoadXSL("test_Param.xsl", xslInputType, readerType) == 1) { m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("myParam1", szEmpty, "first"); // Transform once - if (Transform_ArgList("foo.xml") == 1) + if (Transform_ArgList("foo.xml", outputType, navType) == 1) { VerifyResult(expected1); m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("myParam1", szEmpty, "second"); // Transform again to make sure that parameter from first transform are not cached - if (Transform_ArgList("foo.xml") == 1) + if (Transform_ArgList("foo.xml", outputType, navType) == 1) { VerifyResult(expected2); return; @@ -1633,75 +1732,299 @@ namespace System.Xml.Tests //global param is xsl:param local param is xsl:param //[Variation(id = 1, Pri = 2, Desc = "No param sent, global param used, local param exists with a default value", Params = new object[] { "AddParameterA1.xsl", "default local" })] - [InlineData("AddParameterA1.xsl", "default local")] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 2, Pri = 2, Desc = "No param sent, global param used, local param exists with no default value", Params = new object[] { "AddParameterA2.xsl", "" })] - [InlineData("AddParameterA2.xsl", "")] + [InlineData("AddParameterA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 3, Pri = 2, Desc = "No param sent, global param used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterA3.xsl", "default global" })] - [InlineData("AddParameterA3.xsl", "default global")] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 4, Pri = 2, Desc = "No param sent, global param used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterA4.xsl", "with-param" })] - [InlineData("AddParameterA4.xsl", "with-param")] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 5, Pri = 2, Desc = "No param sent, global param used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterA5.xsl", "" })] - [InlineData("AddParameterA5.xsl", "")] + [InlineData("AddParameterA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 6, Pri = 2, Desc = "No param sent, global param used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterA6.xsl", "default global" })] - [InlineData("AddParameterA6.xsl", "default global")] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 7, Pri = 2, Desc = "No param sent, global param used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterA7.xsl", "default global" })] - [InlineData("AddParameterA7.xsl", "default global")] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //global param is xsl:variable local param is xsl:param //[Variation(id = 8, Pri = 2, Desc = "No param sent, global variable used, local param exists with a default value", Params = new object[] { "AddParameterDA1.xsl", "default local" })] - [InlineData("AddParameterDA1.xsl", "default local")] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 9, Pri = 2, Desc = "No param sent, global variable used, local param exists with no default value", Params = new object[] { "AddParameterDA2.xsl", "" })] - [InlineData("AddParameterDA2.xsl", "")] + [InlineData("AddParameterDA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 10, Pri = 2, Desc = "No param sent, global variable used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterDA3.xsl", "default global" })] - [InlineData("AddParameterDA3.xsl", "default global")] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 11, Pri = 2, Desc = "No param sent, global variable used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterDA4.xsl", "with-param" })] - [InlineData("AddParameterDA4.xsl", "with-param")] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 12, Pri = 2, Desc = "No param sent, global variable used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterDA5.xsl", "" })] - [InlineData("AddParameterDA5.xsl", "")] + [InlineData("AddParameterDA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 13, Pri = 2, Desc = "No param sent, global variable used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterDA6.xsl", "default global" })] - [InlineData("AddParameterDA6.xsl", "default global")] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 14, Pri = 2, Desc = "No param sent, global variable used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterDA7.xsl", "default global" })] - [InlineData("AddParameterDA7.xsl", "default global")] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //global param is xsl:param local param is xsl:variable //[Variation(id = 15, Pri = 2, Desc = "No param sent, global param used, local variable exists with a default value", Params = new object[] { "AddParameterEA1.xsl", "default local" })] - [InlineData("AddParameterEA1.xsl", "default local")] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 16, Pri = 2, Desc = "No param sent, global param used, local variable exists with no default value", Params = new object[] { "AddParameterEA2.xsl", "" })] - [InlineData("AddParameterEA2.xsl", "")] + [InlineData("AddParameterEA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 17, Pri = 2, Desc = "No param sent, global param used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterEA3.xsl", "default global" })] - [InlineData("AddParameterEA3.xsl", "default global")] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 18, Pri = 2, Desc = "No param sent, global param used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterEA4.xsl", "default local" })] - [InlineData("AddParameterEA4.xsl", "default local")] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 19, Pri = 2, Desc = "No param sent, global param used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterEA5.xsl", "" })] - [InlineData("AddParameterEA5.xsl", "")] + [InlineData("AddParameterEA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 20, Pri = 2, Desc = "No param sent, global param used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterEA6.xsl", "default global" })] - [InlineData("AddParameterEA6.xsl", "default global")] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 21, Pri = 2, Desc = "No param sent, global param used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterEA7.xsl", "default global" })] - [InlineData("AddParameterEA7.xsl", "default global")] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //global param is xsl:variable local param is xsl:variable //[Variation(id = 22, Pri = 2, Desc = "No param sent, global variable used, local variable exists with a default value", Params = new object[] { "AddParameterFA1.xsl", "default local" })] - [InlineData("AddParameterFA1.xsl", "default local")] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 23, Pri = 2, Desc = "No param sent, global variable used, local variable exists with no default value", Params = new object[] { "AddParameterFA2.xsl", "" })] - [InlineData("AddParameterFA2.xsl", "")] + [InlineData("AddParameterFA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 24, Pri = 2, Desc = "No param sent, global variable used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterFA3.xsl", "default global" })] - [InlineData("AddParameterFA3.xsl", "default global")] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 25, Pri = 2, Desc = "No param sent, global variable used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterFA4.xsl", "default local" })] - [InlineData("AddParameterFA4.xsl", "default local")] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 26, Pri = 2, Desc = "No param sent, global variable used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterFA5.xsl", "" })] - [InlineData("AddParameterFA5.xsl", "")] + [InlineData("AddParameterFA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 27, Pri = 2, Desc = "No param sent, global variable used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterFA6.xsl", "default global" })] - [InlineData("AddParameterFA6.xsl", "default global")] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 28, Pri = 2, Desc = "No param sent, global variable used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterFA7.xsl", "default global" })] - [InlineData("AddParameterFA7.xsl", "default global")] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam1(object param0, object param1) + public void AddParam1(object param0, object param1, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { m_xsltArg = new XsltArgumentList(); string xslFile = param0.ToString(); string expected = "<result>" + param1.ToString() + "</result>"; - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("AddParameter.xml") == 1)) + if ((LoadXSL(xslFile, xslInputType, readerType) == 1) && (Transform_ArgList("AddParameter.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -1714,69 +2037,293 @@ namespace System.Xml.Tests //global param is xsl:param local param is xsl:param //[Variation(id = 29, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value", Params = new object[] { "AddParameterB1.xsl", "default local" })] - [InlineData("AddParameterB1.xsl", "default local")] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 30, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value", Params = new object[] { "AddParameterB2.xsl", "" })] - [InlineData("AddParameterB2.xsl", "")] + [InlineData("AddParameterB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 31, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterB3.xsl", "outside param" })] - [InlineData("AddParameterB3.xsl", "outside param")] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 32, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterB4.xsl", "with-param" })] - [InlineData("AddParameterB4.xsl", "with-param")] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 33, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterB5.xsl", "" })] - [InlineData("AddParameterB5.xsl", "")] + [InlineData("AddParameterB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 34, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterB6.xsl", "outside param" })] - [InlineData("AddParameterB6.xsl", "outside param")] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 35, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterB7.xsl", "outside param" })] - [InlineData("AddParameterB7.xsl", "outside param")] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //global param is xsl:variable local param is xsl:param //[Variation(id = 36, Pri = 2, Desc = "Param sent, global variable used, local param exists with a default value", Params = new object[] { "AddParameterDB1.xsl", "default local" })] - [InlineData("AddParameterDB1.xsl", "default local")] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 37, Pri = 2, Desc = "Param sent, global variable used, local param exists with no default value", Params = new object[] { "AddParameterDB2.xsl", "" })] - [InlineData("AddParameterDB2.xsl", "")] + [InlineData("AddParameterDB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 38, Pri = 2, Desc = "Param sent, global variable used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterDB3.xsl", "default global" })] - [InlineData("AddParameterDB3.xsl", "default global")] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 39, Pri = 2, Desc = "Param sent, global variable used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterDB4.xsl", "with-param" })] - [InlineData("AddParameterDB4.xsl", "with-param")] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 40, Pri = 2, Desc = "Param sent, global variable used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterDB5.xsl", "" })] - [InlineData("AddParameterDB5.xsl", "")] + [InlineData("AddParameterDB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 41, Pri = 2, Desc = "Param sent, global variable used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterDB6.xsl", "default global" })] - [InlineData("AddParameterDB6.xsl", "default global")] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 42, Pri = 2, Desc = "Param sent, global variable used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterDB7.xsl", "default global" })] - [InlineData("AddParameterDB7.xsl", "default global")] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //global param is xsl:param local param is xsl:variable //[Variation(id = 43, Pri = 2, Desc = "Param sent, global param used, local variable exists with a default value", Params = new object[] { "AddParameterEB1.xsl", "default local" })] - [InlineData("AddParameterEB1.xsl", "default local")] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 44, Pri = 2, Desc = "Param sent, global param used, local variable exists with no default value", Params = new object[] { "AddParameterEB2.xsl", "" })] - [InlineData("AddParameterEB2.xsl", "")] + [InlineData("AddParameterEB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 45, Pri = 2, Desc = "Param sent, global param used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterEB3.xsl", "outside param" })] - [InlineData("AddParameterEB3.xsl", "outside param")] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 46, Pri = 2, Desc = "Param sent, global param used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterEB4.xsl", "default local" })] - [InlineData("AddParameterEB4.xsl", "default local")] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 47, Pri = 2, Desc = "Param sent, global param used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterEB5.xsl", "" })] - [InlineData("AddParameterEB5.xsl", "")] + [InlineData("AddParameterEB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 48, Pri = 2, Desc = "Param sent, global param used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterEB6.xsl", "outside param" })] - [InlineData("AddParameterEB6.xsl", "outside param")] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 49, Pri = 2, Desc = "Param sent, global param used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterEB7.xsl", "outside param" })] - [InlineData("AddParameterEB7.xsl", "outside param")] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //global param is xsl:variable local param is xsl:variable //[Variation(id = 50, Pri = 2, Desc = "Param sent, global variable used, local variable exists with a default value", Params = new object[] { "AddParameterFB1.xsl", "default local" })] - [InlineData("AddParameterFB1.xsl", "default local")] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 51, Pri = 2, Desc = "Param sent, global variable used, local variable exists with no default value", Params = new object[] { "AddParameterFB2.xsl", "" })] - [InlineData("AddParameterFB2.xsl", "")] + [InlineData("AddParameterFB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 52, Pri = 2, Desc = "Param sent, global variable used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterFB3.xsl", "default global" })] - [InlineData("AddParameterFB3.xsl", "default global")] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 53, Pri = 2, Desc = "Param sent, global variable used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterFB4.xsl", "default local" })] - [InlineData("AddParameterFB4.xsl", "default local")] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 54, Pri = 2, Desc = "Param sent, global variable used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterFB5.xsl", "" })] - [InlineData("AddParameterFB5.xsl", "")] + [InlineData("AddParameterFB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 55, Pri = 2, Desc = "Param sent, global variable used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterFB6.xsl", "default global" })] - [InlineData("AddParameterFB6.xsl", "default global")] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 56, Pri = 2, Desc = "Param sent, global variable used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterFB7.xsl", "default global" })] - [InlineData("AddParameterFB7.xsl", "default global")] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam2(object param0, object param1) + public void AddParam2(object param0, object param1, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string xslFile = param0.ToString(); string expected = "<result>" + param1.ToString() + "</result>"; @@ -1784,7 +2331,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", "", "outside param"); - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("AddParameter.xml") == 1)) + if ((LoadXSL(xslFile, xslInputType, readerType) == 1) && (Transform_ArgList("AddParameter.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -1796,21 +2343,77 @@ namespace System.Xml.Tests //All the below variations, empty param is sent from client code //global param is xsl:param local param is xsl:param //[Variation(id = 57, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value", Params = new object[] { "AddParameterB1.xsl", "default local" })] - [InlineData("AddParameterB1.xsl", "default local")] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 58, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value", Params = new object[] { "AddParameterB2.xsl", "" })] - [InlineData("AddParameterB2.xsl", "")] + [InlineData("AddParameterB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 59, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterB3.xsl", "" })] - [InlineData("AddParameterB3.xsl", "")] + [InlineData("AddParameterB3.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 60, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterB4.xsl", "with-param" })] - [InlineData("AddParameterB4.xsl", "with-param")] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 61, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterB5.xsl", "" })] - [InlineData("AddParameterB5.xsl", "")] + [InlineData("AddParameterB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 62, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterB6.xsl", "" })] - [InlineData("AddParameterB6.xsl", "")] + [InlineData("AddParameterB6.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 63, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterB7.xsl", "" })] - [InlineData("AddParameterB7.xsl", "")] + [InlineData("AddParameterB7.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddParam3(object param0, object param1) + public void AddParam3(object param0, object param1, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string xslFile = param0.ToString(); string expected = "<result>" + param1.ToString() + "</result>"; @@ -1818,7 +2421,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", "", ""); - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("AddParameter.xml") == 1)) + if ((LoadXSL(xslFile, xslInputType, readerType) == 1) && (Transform_ArgList("AddParameter.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -1846,8 +2449,6 @@ namespace System.Xml.Tests //[TestCase(Name = "XsltArgumentList - AddExtensionObject : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] public class CArgAddExtObj : XsltApiTestCaseBase2 { - ///private PermissionSet nonePermSet = new PermissionSet(PermissionState.None); - private ITestOutputHelper _output; public CArgAddExtObj(ITestOutputHelper output) : base(output) { @@ -1855,17 +2456,25 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 1, Param = "myObjectDef.txt")] - [InlineData("myObjectDef.txt")] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject1(object param) + public void AddExtObject1(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); string Baseline = Path.Combine("baseline", (string)param); - ///nonePermSet.PermitOnly(); + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1884,12 +2493,10 @@ namespace System.Xml.Tests try { - ///nonePermSet.PermitOnly(); ; m_xsltArg.AddExtensionObject(null, obj); } catch (System.ArgumentNullException) { - ///CodeAccessPermission.RevertPermitOnly(); return; } _output.WriteLine("System.ArgumentNullException not generated for null namespace System.Xml.Tests"); @@ -1904,25 +2511,31 @@ namespace System.Xml.Tests MyObject obj = new MyObject(3, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; m_xsltArg.AddExtensionObject(szEmpty, obj); - ///CodeAccessPermission.RevertPermitOnly(); + return; } //[Variation("Very long namespace System.Xml.Tests", Param = "myObjectLongNs.txt")] - [InlineData("myObjectLongNS.txt")] + [InlineData("myObjectLongNS.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectLongNS.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject4(object param) + public void AddExtObject4(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { m_xsltArg = new XsltArgumentList(); MyObject obj = new MyObject(4, _output); string Baseline = Path.Combine("baseline", (string)param); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szLongNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("myObjectLongNS.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectLongNS.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -1938,9 +2551,8 @@ namespace System.Xml.Tests { MyObject obj = new MyObject(5, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szInvalid, obj); - ///CodeAccessPermission.RevertPermitOnly(); return; } @@ -1952,7 +2564,7 @@ namespace System.Xml.Tests MyObject obj1 = new MyObject(1, _output); MyObject obj2 = new MyObject(2, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj1); try { @@ -1960,7 +2572,6 @@ namespace System.Xml.Tests } catch (System.ArgumentException) { - ///CodeAccessPermission.RevertPermitOnly(); return; } _output.WriteLine("Did not launch exception 'System.ArgumentException' for an item already added"); @@ -1968,14 +2579,22 @@ namespace System.Xml.Tests } //[Variation("Case sensitivity", Param = "myObjectDef.txt")] - [InlineData("myObjectDef.txt")] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject8(object param) + public void AddExtObject8(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); string Baseline = Path.Combine("baseline", (string)param); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject("urn:my-object", obj); retObj = m_xsltArg.GetExtensionObject("urn:my-object"); @@ -1987,8 +2606,8 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject("URN:MY-OBJECT", obj); m_xsltArg.AddExtensionObject("urn:My-Object", obj); m_xsltArg.AddExtensionObject("urn-my:object", obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2007,12 +2626,10 @@ namespace System.Xml.Tests try { - ///nonePermSet.PermitOnly(); ; m_xsltArg.AddExtensionObject(szDefaultNS, null); } catch (System.ArgumentNullException) { - ///CodeAccessPermission.RevertPermitOnly(); return; } _output.WriteLine("Did not launch exception 'System.ArgumentNullException' for adding a null-valued item"); @@ -2020,9 +2637,17 @@ namespace System.Xml.Tests } //[Variation("Unitialized and NULL return values from the methods in the extension object")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject10() + public void AddExtObject10(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> @@ -2031,10 +2656,10 @@ namespace System.Xml.Tests MyObject obj = new MyObject(10, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_Null.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("MyObject_Null.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -2044,15 +2669,23 @@ namespace System.Xml.Tests } //[Variation("Add many objects", Param = "myObjectDef.txt")] - [InlineData("myObjectDef.txt")] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject11(object param) + public void AddExtObject11(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); MyObject obj1 = new MyObject(100, _output); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj1); for (int i = 1; i < 500; i++) @@ -2061,8 +2694,7 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject(szDefaultNS + i, obj); } - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2072,26 +2704,32 @@ namespace System.Xml.Tests } //[Variation("Whitespace")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject12() + public void AddExtObject12(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { int i = 1; m_xsltArg = new XsltArgumentList(); - - ///nonePermSet.PermitOnly(); ; + foreach (String str in szWhiteSpace) { MyObject obj = new MyObject(i, _output); m_xsltArg.AddExtensionObject(szDefaultNS + str, obj); i++; } - ///CodeAccessPermission.RevertPermitOnly(); try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -2108,7 +2746,7 @@ namespace System.Xml.Tests { MyObject obj = new MyObject(13, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); try { @@ -2116,7 +2754,6 @@ namespace System.Xml.Tests } catch (System.ArgumentException) { - ///CodeAccessPermission.RevertPermitOnly(); return; } _output.WriteLine("Did not exception for adding an extension object that already exists"); @@ -2124,22 +2761,30 @@ namespace System.Xml.Tests } //[Variation("Add and Remove multiple times", Param = "myObjectDef.txt")] - [InlineData("myObjectDef.txt")] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject14(object param) + public void AddExtObject14(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); MyObject obj = new MyObject(14, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + for (int i = 0; i < 400; i++) { m_xsltArg.AddExtensionObject(szDefaultNS, obj); m_xsltArg.RemoveExtensionObject(szDefaultNS); } m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2149,19 +2794,27 @@ namespace System.Xml.Tests } //[Variation("Namespace URI non-existent")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject15() + public void AddExtObject15(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(15, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szSimple, obj); - ///CodeAccessPermission.RevertPermitOnly(); + try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -2172,33 +2825,41 @@ namespace System.Xml.Tests } //[Variation("Accessing Private and protected Items")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject16() + public void AddExtObject16(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); + try { - LoadXSL("MyObject_PrivateAccess.xsl"); - Transform_ArgList("fruits.xml", true); + LoadXSL("MyObject_PrivateAccess.xsl", xslInputType, readerType); + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { try { - LoadXSL("MyObject_ProtectedAccess.xsl"); - Transform_ArgList("fruits.xml", true); + LoadXSL("MyObject_ProtectedAccess.xsl", xslInputType, readerType); + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { try { - LoadXSL("MyObject_DefaultAccess.xsl"); - Transform_ArgList("fruits.xml", true); + LoadXSL("MyObject_DefaultAccess.xsl", xslInputType, readerType); + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -2210,9 +2871,17 @@ namespace System.Xml.Tests } //[Variation("Writing To Output")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject17() + public void AddExtObject17(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> Here:End @@ -2220,10 +2889,10 @@ namespace System.Xml.Tests MyObject obj = new MyObject(17, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_ConsoleWrite.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("MyObject_ConsoleWrite.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(expected); return; @@ -2233,17 +2902,25 @@ namespace System.Xml.Tests } //[Variation("Recursive Functions", Param = "myObject_Recursion.txt")] - [InlineData("MyObject_Recursion.txt")] + [InlineData("MyObject_Recursion.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_Recursion.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject18(object param) + public void AddExtObject18(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(18, _output); m_xsltArg = new XsltArgumentList(); string Baseline = Path.Combine("baseline", (string)param); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_Recursion.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("MyObject_Recursion.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2253,17 +2930,25 @@ namespace System.Xml.Tests } //[Variation("Function-exists tests", Param = "MyObject_FnExists.txt")] - [InlineData("MyObject_FnExists.txt")] + [InlineData("MyObject_FnExists.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_FnExists.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject20(object param) + public void AddExtObject20(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); MyObject obj = new MyObject(20, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_FnExists.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("MyObject_FnExists.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2273,17 +2958,25 @@ namespace System.Xml.Tests } //[Variation("Argument Tests", Param = "MyObject_Arguments.txt")] - [InlineData("MyObject_Arguments.txt")] + [InlineData("MyObject_Arguments.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_Arguments.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject21(object param) + public void AddExtObject21(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_Arguments.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("MyObject_Arguments.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2301,7 +2994,7 @@ namespace System.Xml.Tests double d = 1; int i = 1; - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject("urn:myspace", d); try { @@ -2309,7 +3002,6 @@ namespace System.Xml.Tests } catch (System.ArgumentException) { - ///CodeAccessPermission.RevertPermitOnly(); return; } _output.WriteLine("Exception not thrown for URI namespace System.Xml.Tests in use"); @@ -2317,21 +3009,29 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject25() + public void AddExtObject25(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(25, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if (LoadXSL("MyObject_CaseSensitive.xsl") == 1) + + if (LoadXSL("MyObject_CaseSensitive.xsl", xslInputType, readerType) == 1) { try { - Transform_ArgList("fruits.xml"); - CheckResult(419.3031944636); + Transform_ArgList("fruits.xml", outputType, navType); + CheckResult(419.3031944636, outputType); } catch (System.Xml.Xsl.XsltException) { @@ -2343,20 +3043,28 @@ namespace System.Xml.Tests } //[Variation("Object namespace System.Xml.Tests found")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject26() + public void AddExtObject26(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(26, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_NotFoundNS.xsl") == 1)) + + if ((LoadXSL("MyObject_NotFoundNS.xsl", xslInputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml", true); + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -2368,17 +3076,25 @@ namespace System.Xml.Tests } //[Variation("Maintaining State", Param = "MyObject_KeepingState.txt")] - [InlineData("MyObject_KeepingState.txt")] + [InlineData("MyObject_KeepingState.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_KeepingState.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject27(object param) + public void AddExtObject27(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(27, _output); m_xsltArg = new XsltArgumentList(); string Baseline = Path.Combine("baseline", (string)param); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_KeepingState.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("MyObject_KeepingState.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2388,19 +3104,27 @@ namespace System.Xml.Tests } //[Variation("Deliberately Messing Up the Stylesheet", Param = "MyObject_KillerStrings.txt")] - [InlineData("MyObject_KillerStrings.txt")] + [InlineData("MyObject_KillerStrings.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("MyObject_KillerStrings.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject28(object param) + public void AddExtObject28(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(28, _output); m_xsltArg = new XsltArgumentList(); string Baseline = Path.Combine("baseline", (string)param); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_KillerStrings.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("MyObject_KillerStrings.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { - if (MyOutputType() == OutputType.Writer) + if (outputType == OutputType.Writer) /* writer output is slighlty different which causes a mismatch so we won't compare */ return; VerifyResult(Baseline, _strOutFile); @@ -2411,20 +3135,28 @@ namespace System.Xml.Tests } //[Variation("Function not found in Object")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject29() + public void AddExtObject29(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(29, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("MyObject_NotFound.xsl") == 1)) + + if ((LoadXSL("MyObject_NotFound.xsl", xslInputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml", true); + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -2442,30 +3174,37 @@ namespace System.Xml.Tests { MyObject obj = new MyObject(31, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szXslNS, obj); retObj = m_xsltArg.GetExtensionObject(szXslNS); - ///CodeAccessPermission.RevertPermitOnly(); Assert.Equal(retObj, obj); } //[Variation("Extension objects should not be cached during Transform()", Param = "Bug78587")] - [InlineData("Bug78587")] + [InlineData("Bug78587", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("Bug78587", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject32(object param) + public void AddExtObject32(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline1 = Path.Combine("baseline", (string)param) + "a.txt"; string Baseline2 = Path.Combine("baseline", (string)param) + "b.txt"; - if (LoadXSL("Bug78587.xsl") == 1) + if (LoadXSL("Bug78587.xsl", xslInputType, readerType) == 1) { m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject("id", new Id("first")); m_xsltArg.AddExtensionObject("capitalizer", new Capitalizer()); // Transform once - if (Transform_ArgList("Bug78587.xml") == 1) + if (Transform_ArgList("Bug78587.xml", outputType, navType) == 1) { VerifyResult(Baseline1, _strOutFile); m_xsltArg = new XsltArgumentList(); @@ -2473,7 +3212,7 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject("capitalizer", new Capitalizer()); // Transform again to make sure that extension objects from first transform are not cached - if (Transform_ArgList("Bug78587.xml") == 1) + if (Transform_ArgList("Bug78587.xml", outputType, navType) == 1) { VerifyResult(Baseline2, _strOutFile); return; @@ -2483,39 +3222,98 @@ namespace System.Xml.Tests Assert.True(false); } - //[Variation(id = 36, Desc = "Calling extension object from select in xsl:sort", Params = new object[] { "sort.xsl", "sort.txt" })] - [InlineData("sort.xsl", "sort.txt")] - [Theory] - public void AddExtObject33_ActiveIssue9997(object param0, object param1) - { - AddExtObject33(param0, param1); - } - //[Variation(id = 33, Desc = "Calling extension object from select in xsl:apply-templates", Params = new object[] { "apply-templates.xsl", "apply-templates.txt" })] - [InlineData("apply-templates.xsl", "apply-templates.txt")] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("apply-templates.xsl", "apply-templates.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 34, Desc = "Calling extension object from select in xsl:for-each", Params = new object[] { "for-each.xsl", "for-each.txt" })] - [InlineData("for-each.xsl", "for-each.txt")] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("for-each.xsl", "for-each.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 35, Desc = "Calling extension object from select in xsl:copy-of", Params = new object[] { "copy-of.xsl", "copy-of.txt" })] - [InlineData("copy-of.xsl", "copy-of.txt")] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("copy-of.xsl", "copy-of.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 37, Desc = "Calling extension object from select in xsl:variable", Params = new object[] { "variable.xsl", "variable.txt" })] - [InlineData("variable.xsl", "variable.txt")] + [InlineData("variable.xsl", "variable.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable.xsl", "variable.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 38, Desc = "Calling extension object from select in xsl:param", Params = new object[] { "param.xsl", "param.txt" })] - [InlineData("param.xsl", "param.txt")] + [InlineData("param.xsl", "param.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param.xsl", "param.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 39, Desc = "Calling extension object from select in xsl:with-param", Params = new object[] { "with-param.xsl", "with-param.txt" })] - [InlineData("with-param.xsl", "with-param.txt")] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("with-param.xsl", "with-param.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 40, Desc = "Calling extension object from select in xsl:value-of", Params = new object[] { "value-of.xsl", "value-of.txt" })] - [InlineData("value-of.xsl", "value-of.txt")] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("value-of.xsl", "value-of.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + //[Variation(id = 36, Desc = "Calling extension object from select in xsl:sort", Params = new object[] { "sort.xsl", "sort.txt" })] + [InlineData("sort.xsl", "sort.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("sort.xsl", "sort.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [Theory] - public void AddExtObject33(object param0, object param1) + public void AddExtObject33(object param0, object param1, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { ExObj obj = new ExObj(0, _output); m_xsltArg = new XsltArgumentList(); string xslFile = param0.ToString(); string Baseline = Path.Combine("baseline", param1.ToString()); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject("urn-myobject", obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("ExtData.xml") == 1)) + + if ((LoadXSL(xslFile, xslInputType, readerType) == 1) && (Transform_ArgList("ExtData.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2525,19 +3323,67 @@ namespace System.Xml.Tests } //[Variation(id = 41, Desc = "Calling extension function from select in xsl:variable and variable is used for incrementing an integer", Params = new object[] { "variable2.xsl", "variable2.txt" })] - [InlineData("variable2.xsl", "variable2.txt")] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable2.xsl", "variable2.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 42, Desc = "Calling extension function from select in xsl:variable but variable is never used", Params = new object[] { "variable3.xsl", "variable3.txt" })] - [InlineData("variable3.xsl", "variable3.txt")] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable3.xsl", "variable3.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 43, Desc = "Calling extension function from select in global xsl:variable but variable is never used", Params = new object[] { "variable4.xsl", "variable4.txt" })] - [InlineData("variable4.xsl", "variable4.txt")] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("variable4.xsl", "variable4.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 44, Desc = "Calling extension function from select in xsl:param and parameter is used for incrementing an integer", Params = new object[] { "param2.xsl", "param2.txt" })] - [InlineData("param2.xsl", "param2.txt")] + [InlineData("param2.xsl", "param2.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param2.xsl", "param2.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 45, Desc = "Calling extension function from select in xsl:param but parameter is never used", Params = new object[] { "param3.xsl", "param3.txt" })] - [InlineData("param3.xsl", "param3.txt")] + [InlineData("param3.xsl", "param3.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param3.xsl", "param3.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] //[Variation(id = 46, Desc = "Calling extension function from select in global xsl:param but parameter is never used", Params = new object[] { "param4.xsl", "param4.txt" })] - [InlineData("param4.xsl", "param4.txt")] + [InlineData("param4.xsl", "param4.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("param4.xsl", "param4.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void AddExtObject41(object param0, object param1) + public void AddExtObject41(object param0, object param1, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { /* * In these variations, the XSLT calls the extension function Increment from XSLT. @@ -2548,10 +3394,10 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); string xslFile = param0.ToString(); string Baseline = "baseline" + Path.DirectorySeparatorChar + param1.ToString(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject("urn-myobject", obj); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("ExtData.xml") == 1)) + + if ((LoadXSL(xslFile, xslInputType, readerType) == 1) && (Transform_ArgList("ExtData.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2607,9 +3453,12 @@ namespace System.Xml.Tests } //[Variation(id = 1, Desc = "Basic Verification Test", Pri = 1, Param = "RemoveParam1.txt")] - [InlineData("RemoveParam1.txt")] + [InlineData("RemoveParam1.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam1.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam1.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("RemoveParam1.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam1(object param) + public void RemoveParam1(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { m_xsltArg = new XsltArgumentList(); @@ -2632,7 +3481,7 @@ namespace System.Xml.Tests } _baseline = Path.Combine("baseline", (string)param); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(_baseline, "out.xml"); return; @@ -2657,15 +3506,18 @@ namespace System.Xml.Tests } //[Variation("Param name is empty string", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam3(object param) + public void RemoveParam3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); m_xsltArg.RemoveParam(szEmpty, szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2675,15 +3527,18 @@ namespace System.Xml.Tests } //[Variation("Param name is non-existent", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam4(object param) + public void RemoveParam4(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); m_xsltArg.RemoveParam(szSimple, szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2693,15 +3548,18 @@ namespace System.Xml.Tests } //[Variation("Invalid Param name", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam5(object param) + public void RemoveParam5(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); m_xsltArg.RemoveParam(szInvalid, szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2711,9 +3569,12 @@ namespace System.Xml.Tests } //[Variation("Very long param name", Param = "showParamLongName.txt")] - [InlineData("showParamLongName.txt")] + [InlineData("showParamLongName.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParamLongName.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParamLongName.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParamLongName.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam6(object param) + public void RemoveParam6(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -2721,7 +3582,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam(szLongString, szEmpty, "Test1"); m_xsltArg.RemoveParam(szLongString, szEmpty); - if ((LoadXSL("showParamLongName.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParamLongName.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2747,9 +3608,12 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is empty string", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam8(object param) + public void RemoveParam8(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -2757,7 +3621,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myArg1", szEmpty, "Test1"); m_xsltArg.RemoveParam("myArg1", szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2767,9 +3631,12 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is non-existent", Param = "RemoveParam9.txt")] - [InlineData("RemoveParam9.txt")] + [InlineData("RemoveParam9.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam9.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam9.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("RemoveParam9.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam9(object param) + public void RemoveParam9(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -2777,7 +3644,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myArg1", szEmpty, "Test1"); m_xsltArg.RemoveParam("myArg1", "http://www.xsltTest.com"); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2787,9 +3654,12 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam10(object param) + public void RemoveParam10(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -2797,7 +3667,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myArg1", szLongString, "Test1"); m_xsltArg.RemoveParam("myArg1", szLongString); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -2807,9 +3677,12 @@ namespace System.Xml.Tests } //[Variation("Different Data Types", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam11(object param) + public void RemoveParam11(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); @@ -3002,7 +3875,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3012,9 +3885,12 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity", Param = "RemoveParam12.txt")] - [InlineData("RemoveParam12.txt")] + [InlineData("RemoveParam12.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam12.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam12.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("RemoveParam12.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam12(object param) + public void RemoveParam12(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3025,7 +3901,7 @@ namespace System.Xml.Tests m_xsltArg.RemoveParam("myArg1 ", szEmpty); // perform a transform for kicks and ensure all is ok. - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3035,9 +3911,12 @@ namespace System.Xml.Tests } //[Variation("Whitespace", Param = "RemoveParam13.txt")] - [InlineData("RemoveParam13.txt")] + [InlineData("RemoveParam13.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam13.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("RemoveParam13.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("RemoveParam13.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam13(object param) + public void RemoveParam13(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); int i = 1; @@ -3071,7 +3950,7 @@ namespace System.Xml.Tests } // perform a transform for kicks and ensure all is ok. - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3081,9 +3960,12 @@ namespace System.Xml.Tests } //[Variation("Call Multiple Times", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] [Theory] - public void RemoveParam14(object param) + public void RemoveParam14(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3093,7 +3975,7 @@ namespace System.Xml.Tests for (int i = 0; i < 500; i++) m_xsltArg.RemoveParam("myArg1", szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3124,8 +4006,6 @@ namespace System.Xml.Tests //[TestCase(Name = "XsltArgumentList - RemoveExtensionObject : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] public class CArgRemoveExtObj : XsltApiTestCaseBase2 { - ///private PermissionSet nonePermSet = new PermissionSet(PermissionState.None); - private ITestOutputHelper _output; public CArgRemoveExtObj(ITestOutputHelper output) : base(output) { @@ -3133,21 +4013,23 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 1)] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj1() + public void RemoveExtObj1(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); m_xsltArg.RemoveExtensionObject(szDefaultNS); - ///CodeAccessPermission.RevertPermitOnly(); try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -3178,19 +4060,22 @@ namespace System.Xml.Tests } //[Variation("Call Multiple Times", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj3(object param) + public void RemoveExtObj3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); MyObject obj = new MyObject(10, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); for (int i = 0; i < 500; i++) m_xsltArg.RemoveExtensionObject(szDefaultNS); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3200,18 +4085,21 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is non-existent", Param = "MyObjectDef.txt")] - [InlineData("myObjectDef.txt")] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj4(object param) + public void RemoveExtObj4(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); MyObject obj = new MyObject(4, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject(szDefaultNS, obj); m_xsltArg.RemoveExtensionObject(szSimple); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3221,20 +4109,23 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj5() + public void RemoveExtObj5(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { m_xsltArg = new XsltArgumentList(); MyObject obj = new MyObject(5, _output); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject("urn:" + szLongNS, obj); m_xsltArg.RemoveExtensionObject("urn:" + szLongNS); - ///CodeAccessPermission.RevertPermitOnly(); + try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -3245,14 +4136,17 @@ namespace System.Xml.Tests } //[Variation("Different Data Types", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj6(object param) + public void RemoveExtObj6(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); MyObject obj = new MyObject(6, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject("urn:my-object", obj); m_xsltArg.RemoveExtensionObject("urn:my-object"); @@ -3270,8 +4164,8 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject("urn:my-object", false); m_xsltArg.RemoveExtensionObject("urn:my-object"); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3281,22 +4175,25 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity", Param = "MyObjectDef.txt")] - [InlineData("myObjectDef.txt")] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("myObjectDef.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj7(object param) + public void RemoveExtObj7(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(7, _output); m_xsltArg = new XsltArgumentList(); string Baseline = Path.Combine("baseline", (string)param); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.AddExtensionObject("urn:my-object", obj); m_xsltArg.RemoveExtensionObject("URN:MY-OBJECT"); m_xsltArg.RemoveExtensionObject("urn:My-Object"); m_xsltArg.RemoveExtensionObject("urn-my:object"); m_xsltArg.RemoveExtensionObject("urn:my-object "); - ///CodeAccessPermission.RevertPermitOnly(); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3306,13 +4203,16 @@ namespace System.Xml.Tests } //[Variation("Whitespace")] - [InlineData()] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj8() + public void RemoveExtObj8(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { int i = 1; m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + foreach (String str in szWhiteSpace) { MyObject obj = new MyObject(i, _output); @@ -3327,12 +4227,11 @@ namespace System.Xml.Tests } i++; } - ///CodeAccessPermission.RevertPermitOnly(); try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) + Transform_ArgList("fruits.xml", outputType, navType, true); } catch (System.Xml.Xsl.XsltException) { @@ -3343,18 +4242,21 @@ namespace System.Xml.Tests } //[Variation("Using default XSLT namespace", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Reader, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] + [InlineData("showParam.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void RemoveExtObj9(object param) + public void RemoveExtObj9(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); MyObject obj = new MyObject(10, _output); m_xsltArg = new XsltArgumentList(); - ///nonePermSet.PermitOnly(); ; + m_xsltArg.RemoveExtensionObject(szDefaultNS); - ///CodeAccessPermission.RevertPermitOnly(); + // ensure we can still do a transform - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3378,9 +4280,9 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 1, Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear1(object param) + public void Clear1(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3395,7 +4297,7 @@ namespace System.Xml.Tests if (retObj != null) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3405,15 +4307,15 @@ namespace System.Xml.Tests } //[Variation("Clear with nothing loaded", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear2(object param) + public void Clear2(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); m_xsltArg.Clear(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3423,9 +4325,9 @@ namespace System.Xml.Tests } //[Variation("Clear Params", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear3(object param) + public void Clear3(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3440,7 +4342,7 @@ namespace System.Xml.Tests if (retObj != null) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3450,9 +4352,9 @@ namespace System.Xml.Tests } //[Variation("Clear Extension Objects")] - [InlineData()] + [InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear4() + public void Clear4(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { MyObject obj = new MyObject(26, _output); m_xsltArg = new XsltArgumentList(); @@ -3466,11 +4368,11 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("myObjectDef.xsl") == 1)) + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml"); + Transform_ArgList("fruits.xml", outputType, navType); } catch (System.Xml.Xsl.XsltException) { @@ -3482,9 +4384,9 @@ namespace System.Xml.Tests } //[Variation("Clear Many Objects", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear5(object param) + public void Clear5(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3515,11 +4417,9 @@ namespace System.Xml.Tests } } - // _output.WriteLine(retObj.GetType()); - m_xsltArg.Clear(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3529,9 +4429,9 @@ namespace System.Xml.Tests } //[Variation("Clear Multiple Times", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear6(object param) + public void Clear6(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3547,7 +4447,7 @@ namespace System.Xml.Tests if (retObj != null) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3557,9 +4457,9 @@ namespace System.Xml.Tests } //[Variation("Loading one object, but clearing another", Param = "ClearParam7.txt")] - [InlineData("ClearParam7.txt")] + [InlineData("ClearParam7.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear7(object param) + public void Clear7(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3572,7 +4472,7 @@ namespace System.Xml.Tests m_2.Clear(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) == 1) && (Transform_ArgList("fruits.xml", outputType, navType) == 1)) { VerifyResult(Baseline, _strOutFile); return; @@ -3582,9 +4482,9 @@ namespace System.Xml.Tests } //[Variation("Clear after objects have been \"Removed\"", Param = "showParam.txt")] - [InlineData("showParam.txt")] + [InlineData("showParam.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)] [Theory] - public void Clear8(object param) + public void Clear8(object param, XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType) { string Baseline = Path.Combine("baseline", (string)param); m_xsltArg = new XsltArgumentList(); @@ -3596,7 +4496,7 @@ namespace System.Xml.Tests retObj = m_xsltArg.RemoveParam("myArg1", szEmpty); m_xsltArg.Clear(); - if ((LoadXSL("showParam.xsl") != 1) || (Transform_ArgList("fruits.xml") != 1)) + if ((LoadXSL("showParam.xsl", xslInputType, readerType) != 1) || (Transform_ArgList("fruits.xml", outputType, navType) != 1)) Assert.True(false); VerifyResult(Baseline, _strOutFile); @@ -3607,11 +4507,11 @@ namespace System.Xml.Tests m_xsltArg.RemoveExtensionObject(szDefaultNS); m_xsltArg.Clear(); - if ((LoadXSL("myObjectDef.xsl") == 1)) + if ((LoadXSL("myObjectDef.xsl", xslInputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml"); + Transform_ArgList("fruits.xml", outputType, navType); } catch (System.Xml.Xsl.XsltException) { @@ -3757,62 +4657,63 @@ namespace System.Xml.Tests } //[Variation(id = 1, Desc = "Call Current without MoveNext")] - [ActiveIssue(9873)] [InlineData()] [Theory] public void NodeIter1() { - if (_isInProc) - return; //TEST_SKIPPED; - - XslCompiledTransform xslt = new XslCompiledTransform(); + var e = Assert.ThrowsAny<XsltException>(() => + { + XslCompiledTransform xslt = new XslCompiledTransform(); - XsltArgumentList xslArg = new XsltArgumentList(); - XmlUrlResolver ur = new XmlUrlResolver(); - Uri uriSource = ur.ResolveUri(null, FullFilePath("sample.xsd")); - xslArg.AddParam("sourceUri", String.Empty, uriSource.ToString()); + XsltArgumentList xslArg = new XsltArgumentList(); + XmlUrlResolver ur = new XmlUrlResolver(); + Uri uriSource = ur.ResolveUri(null, FullFilePath("sample.xsd")); + xslArg.AddParam("sourceUri", String.Empty, uriSource.ToString()); - xslt.Load(FullFilePath("xsd2cs1.xsl"), new XsltSettings(true, true), new XmlUrlResolver()); + xslt.Load(FullFilePath("xsd2cs1.xsl"), new XsltSettings(true, true), new XmlUrlResolver()); + XPathDocument doc = new XPathDocument(FullFilePath("sample.xsd")); + StringWriter sw = new StringWriter(); + try + { + xslt.Transform(doc, xslArg, sw); + sw.Dispose(); + _output.WriteLine("No exception is thrown when .Current is called before .MoveNext on XPathNodeIterator"); + Assert.True(false); + } + catch (System.InvalidOperationException ex) + { + _output.WriteLine(ex.ToString()); + return; + } + }); - XPathDocument doc = new XPathDocument(FullFilePath("sample.xsd")); - StringWriter sw = new StringWriter(); - try - { - xslt.Transform(doc, xslArg, sw); - sw.Dispose(); - _output.WriteLine("No exception is thrown when .Current is called before .MoveNext on XPathNodeIterator"); - Assert.True(false); - } - catch (System.InvalidOperationException ex) - { - _output.WriteLine(ex.ToString()); - return; - } + Assert.Equal("Compiling JScript/CSharp scripts is not supported", e.InnerException.Message); } //[Variation(id = 2, Desc = "Call Current after MoveNext")] - [ActiveIssue(9873)] [InlineData()] [Theory] public void NodeIter2() { - if (_isInProc) - return; //TEST_SKIPPED; + var e = Assert.ThrowsAny<XsltException>(() => + { + XslCompiledTransform xslt = new XslCompiledTransform(); - XslCompiledTransform xslt = new XslCompiledTransform(); + XsltArgumentList xslArg = new XsltArgumentList(); + XmlUrlResolver ur = new XmlUrlResolver(); + Uri uriSource = ur.ResolveUri(null, FullFilePath("sample.xsd")); + xslArg.AddParam("sourceUri", String.Empty, uriSource.ToString()); - XsltArgumentList xslArg = new XsltArgumentList(); - XmlUrlResolver ur = new XmlUrlResolver(); - Uri uriSource = ur.ResolveUri(null, FullFilePath("sample.xsd")); - xslArg.AddParam("sourceUri", String.Empty, uriSource.ToString()); + xslt.Load(FullFilePath("xsd2cs2.xsl"), new XsltSettings(true, true), new XmlUrlResolver()); - xslt.Load(FullFilePath("xsd2cs2.xsl"), new XsltSettings(true, true), new XmlUrlResolver()); + XPathDocument doc = new XPathDocument(FullFilePath("sample.xsd")); + StringWriter sw = new StringWriter(); + xslt.Transform(doc, xslArg, sw); + sw.Dispose(); + return; + }); - XPathDocument doc = new XPathDocument(FullFilePath("sample.xsd")); - StringWriter sw = new StringWriter(); - xslt.Transform(doc, xslArg, sw); - sw.Dispose(); - return; + Assert.Equal("Compiling JScript/CSharp scripts is not supported", e.InnerException.Message); } } } diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs index 71a86e03bb..1df71c169d 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; using XmlCoreTest.Common; @@ -28,7 +26,7 @@ namespace System.Xml.Tests Init(null); } - public /*override*/ new void Init(object objParam) + public new void Init(object objParam) { // Get parameter info _strPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltApiV2\"); diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs index b278705853..69265ea40a 100644 --- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs +++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltSettings.cs @@ -5,7 +5,6 @@ using Xunit; using Xunit.Abstractions; using System.IO; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; @@ -25,16 +24,8 @@ namespace System.Xml.Tests private string _xmlFile = string.Empty; private string _xslFile = string.Empty; - private bool _debug = false; - private void Init(string xmlFile, string xslFile) { - //if (Param.ToString() == "Debug") - //{ - // xsl = new XslCompiledTransform(true); - // _debug = true; - //} - //else _xsl = new XslCompiledTransform(); _xmlFile = FullFilePath(xmlFile); @@ -56,7 +47,6 @@ namespace System.Xml.Tests Assert.Equal(actual, expected); } - [ActiveIssue(9873)] //[Variation(id = 1, Desc = "Test the script block with EnableScript, should work", Pri = 0, Params = new object[] { "XsltSettings.xml", "XsltSettings1.xsl", false, true })] [InlineData(1, "XsltSettings.xml", "XsltSettings1.xsl", false, true)] //[Variation(id = 4, Desc = "Test the script block with TrustedXslt, should work", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings1.xsl", true, true })] @@ -66,9 +56,10 @@ namespace System.Xml.Tests //[Variation(id = 11, Desc = "Test the combination of script and document function with EnableScript, only script should work", Pri = 2, Params = new object[] { "XsltSettings.xml", "XsltSettings3.xsl", false, true })] [InlineData(11, "XsltSettings.xml", "XsltSettings3.xsl", false, true)] [Theory] - public void XsltSettings1__1ActiveIssue9873(object param0, object param1, object param2, object param3, object param4) + public void XsltSettings1_1_ContainsScript(object param0, object param1, object param2, object param3, object param4) { - XsltSettings1_1(param0, param1, param2, param3, param4); + var e = Assert.ThrowsAny<XsltException>(() => XsltSettings1_1(param0, param1, param2, param3, param4)); + Assert.Equal("Compiling JScript/CSharp scripts is not supported", e.InnerException.Message); } //[Variation(id = 15, Desc = "Test 1 with Default settings, should fail", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings1.xsl", false, true, false, false })] @@ -79,9 +70,11 @@ namespace System.Xml.Tests [InlineData(19, "XsltSettings.xml", "XsltSettings3.xsl", true, true, false, false)] //[Variation(id = 20, Desc = "Test 10 with TrustedXslt override, should work", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings3.xsl", false, false, true, true })] [InlineData(20, "XsltSettings.xml", "XsltSettings3.xsl", false, false, true, true)] - public void XsltSettings1_2_ActiveIssue9873(object param0, object param1, object param2, object param3, object param4, object param5, object param6) + [Theory] + public void XsltSettings1_2_ContainsScript(object param0, object param1, object param2, object param3, object param4, object param5, object param6) { - XsltSettings1_2(param0, param1, param2, param3, param4, param5, param6); + var e = Assert.ThrowsAny<XsltException>(() => XsltSettings1_2(param0, param1, param2, param3, param4, param5, param6)); + Assert.Equal("Compiling JScript/CSharp scripts is not supported", e.InnerException.Message); } //[Variation(id = 5, Desc = "Test the document function with EnableDocumentFunction, should work", Pri = 0, Params = new object[] { "XsltSettings.xml", "XsltSettings2.xsl", true, false })] @@ -91,7 +84,7 @@ namespace System.Xml.Tests [Theory] public void XsltSettings1_1_ExternalURI(object param0, object param1, object param2, object param3, object param4) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); XsltSettings1_1(param0, param1, param2, param3, param4); } @@ -101,7 +94,7 @@ namespace System.Xml.Tests [Theory] public void XsltSettings1_2_ExternalURI(object param0, object param1, object param2, object param3, object param4, object param5, object param6) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); XsltSettings1_2(param0, param1, param2, param3, param4, param5, param6); } @@ -137,24 +130,6 @@ namespace System.Xml.Tests // In Proc Skip // XsltSettings - Debug (1-20) // XsltSettings - Retail (1,4,9,11,15,16,19,20) - if (_isInProc) - { - if (_debug) - return; //TEST_SKIPPED; - else - { - switch ((int)param0) - { - case 1: - case 4: - case 9: - case 11: - return; //TEST_SKIPPED; - // default: - //just continue; - } - } - } XsltSettings xs = new XsltSettings((bool)param3, (bool)param4); _xsl.Load(_xslFile, xs, new XmlUrlResolver()); @@ -225,28 +200,6 @@ namespace System.Xml.Tests { Init(param1.ToString(), param2.ToString()); - // In Proc Skip - // XsltSettings - Debug (1-20) - // XsltSettings - Retail (1,4,9,11,15,16,19,20) - if (_isInProc) - { - if (_debug) - return; //TEST_SKIPPED; - else - { - switch ((int)param0) - { - case 15: - case 16: - case 19: - case 20: - return; //TEST_SKIPPED; - // default: - //just continue; - } - } - } - XsltSettings xs = new XsltSettings((bool)param3, (bool)param4); _xsl.Load(_xslFile, xs, new XmlUrlResolver()); @@ -308,10 +261,6 @@ namespace System.Xml.Tests { Init(param0.ToString(), param1.ToString()); - if (_isInProc) - if (_debug) - return; //TEST_SKIPPED; - XsltSettings xs = new XsltSettings((bool)param2, (bool)param3); XPathDocument doc = new XPathDocument(_xslFile); _xsl.Load(doc, xs, new XmlUrlResolver()); @@ -330,43 +279,31 @@ namespace System.Xml.Tests } //[Variation(id = 25, Desc = "Disable DocumentFunction and Malicious stylesheet has document(url) opening a URL to an external system", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings9.xsl", false, false })] - //[InlineData("XsltSettings.xml", "XsltSettings9.xsl", false, false)] + [InlineData("XsltSettings.xml", "XsltSettings9.xsl", false, false)] //[Variation(id = 26, Desc = "Disable DocumentFunction and Malicious stylesheet has document(nodeset) opens union of all URLs referenced", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings10.xsl", false, false })] [InlineData("XsltSettings.xml", "XsltSettings10.xsl", false, false)] //[Variation(id = 27, Desc = "Disable DocumentFunction and Malicious stylesheet has document(url, nodeset) nodeset is a base URL to 1st arg", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings11.xsl", false, false })] - //[InlineData("XsltSettings.xml", "XsltSettings11.xsl", false, false)] + [InlineData("XsltSettings.xml", "XsltSettings11.xsl", false, false)] //[Variation(id = 28, Desc = "Disable DocumentFunction and Malicious stylesheet has document(nodeset, nodeset) 2nd arg is a base URL to 1st arg", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings12.xsl", false, false })] [InlineData("XsltSettings.xml", "XsltSettings12.xsl", false, false)] //[Variation(id = 29, Desc = "Disable DocumentFunction and Malicious stylesheet has document(''), no threat but just to verify if its considered", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings13.xsl", false, false })] [InlineData("XsltSettings.xml", "XsltSettings13.xsl", false, false)] //[Variation(id = 30, Desc = "Disable DocumentFunction and Stylesheet includes another stylesheet with document() function", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings14.xsl", false, false })] - //[InlineData("XsltSettings.xml", "XsltSettings14.xsl", false, false)] + [InlineData("XsltSettings.xml", "XsltSettings14.xsl", false, false)] //[Variation(id = 31, Desc = "Disable DocumentFunction and Stylesheet has an entity reference to doc(), ENTITY s document('foo.xml')", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings15.xsl", false, false })] - //[InlineData("XsltSettings.xml", "XsltSettings15.xsl", false, false)] + [InlineData("XsltSettings.xml", "XsltSettings15.xsl", false, false)] [Theory] public void XsltSettings3(object param0, object param1, object param2, object param3) { Init(param0.ToString(), param1.ToString()); - if (_isInProc) - if (_debug) - return; //TEST_SKIPPED; - XsltSettings xs = new XsltSettings((bool)param2, (bool)param3); XPathDocument doc = new XPathDocument(_xslFile); _xsl.Load(doc, xs, new XmlUrlResolver()); - try - { - StringWriter sw = Transform(); - _output.WriteLine("Execution of the document function was allowed even when XsltSettings.EnableDocumentFunction is false"); - Assert.True(false); - } - catch (XsltException ex) - { - _output.WriteLine(ex.ToString()); - return; - } + StringWriter sw; + var e = Assert.ThrowsAny<XsltException>(() => sw = Transform()); + Assert.Contains("Execution of the 'document()' function was prohibited. Use the XsltSettings.EnableDocumentFunction property to enable it.", e.Message); } } }
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CThreads.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CThreads.cs index ac8c2bcec9..5b4fdcb2f7 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CThreads.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CThreads.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using System; using System.Collections.Generic; using Xunit; using Xunit.Abstractions; diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXmlCache.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXmlCache.cs index f30f7bb66c..8027ec4840 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXmlCache.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXmlCache.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Xunit; using Xunit.Abstractions; using System; using System.IO; @@ -167,10 +166,6 @@ abstract public class CXmlBase return rChild; } - - // - // Private Methods and Properties - // } public class CXmlAttribute : CXmlBase @@ -327,13 +322,6 @@ public class CXmlNode : CXmlBase string DocTypePublic = null; string DocTypeSystem = null; - /* - // Display of Indent information - if (this.LocalName == string.Empty) - _output.WriteLine("Node={0}, Indent={1}, Mixed={2}",this.NodeType, this.Flags & NodeFlags.Indent, this.Flags & NodeFlags.MixedContent); - else - _output.WriteLine("Node={0}, Indent={1}, Mixed={2}",this.LocalName, this.Flags & NodeFlags.Indent, this.Flags & NodeFlags.MixedContent); - */ switch (this.NodeType) { case XmlNodeType.CDATA: @@ -746,7 +734,6 @@ public class CXmlCache _eWhitespaceMode = ((XmlTextReader)rXmlReader).WhitespaceHandling; _fNamespaces = ((XmlTextReader)rXmlReader).Namespaces; _eValidationMode = ValidationType.None; - // _eEntityMode = ((XmlValidatingReader)rXmlReader).EntityHandling; } #pragma warning disable 0618 if (rXmlReader is XmlValidatingReader) @@ -1112,10 +1099,8 @@ public class CXmlCache case XmlNodeType.EntityReference: if (_eValidationMode == ValidationType.DTD) { - // _rXmlReader.EntityHandling = EntityHandling.ExpandEntities; _rXmlReader.ResolveEntity(); Process(rNewNode); - // _rXmlReader.EntityHandling = _eEntityMode; } break; diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTArgumentList.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTArgumentList.cs index 0467043dd3..5ac22f717b 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTArgumentList.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTArgumentList.cs @@ -4,13 +4,11 @@ using Xunit; using Xunit.Abstractions; -using System; using System.Collections.Generic; -//using System.Dynamic; using System.IO; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; +using System.Dynamic; namespace System.Xml.Tests { @@ -73,7 +71,7 @@ namespace System.Xml.Tests //[Variation(Desc = "Tuple.XsltArgumentList.AddParam/AddExtensionObject", Param = 1)] [InlineData(1)] //[Variation(Desc = "DynamicObject.XsltArgumentList.AddParam/AddExtensionObject", Param = 2)] - //[InlineData(2)] + [InlineData(2)] //[Variation(Desc = "Guid.XsltArgumentList.AddParam/AddExtensionObject", Param = 3)] [InlineData(3)] //[Variation(Desc = "Dictionary.XsltArgumentList.AddParam/AddExtensionObject", Param = 4)] @@ -87,7 +85,7 @@ namespace System.Xml.Tests switch (param) { case 1: t = Tuple.Create(1, "Melitta", 7.5); break; - //case 2: t = new TestDynamicObject(); break; + case 2: t = new TestDynamicObject(); break; case 3: t = new Guid(); break; case 4: t = new Dictionary<string, object>(); break; } @@ -111,13 +109,13 @@ namespace System.Xml.Tests return; } - //public class TestDynamicObject : DynamicObject - //{ - // public dynamic GetDynamicObject() - // { - // return new Dictionary<string, object>(); - // } - //} + public class TestDynamicObject : DynamicObject + { + public dynamic GetDynamicObject() + { + return new Dictionary<string, object>(); + } + } //[Variation("Param name is null")] [InlineData()] @@ -277,29 +275,6 @@ namespace System.Xml.Tests return; } - /* - * This test is no more valid. - * MDAC Bug # 88407 fix now allows ANY characters in URI - //[Variation("Invalid Namespace URI")] - [InlineData()] - [Theory] - public void GetParam11() - { - m_xsltArg = new XsltArgumentList(); - - try - { - m_xsltArg.AddParam("myArg1", szInvalid, "Test11"); - } - catch (System.UriFormatException) - { - return; - } - _output.WriteLine("Did not throw System.UriFormatException for invalid namespace System.Xml.Tests"); - Assert.True(false); - } - */ - //[Variation("Different Data Types")] [InlineData()] [Theory] @@ -613,361 +588,6 @@ namespace System.Xml.Tests } /***********************************************************/ - /* XsltArgumentList.GetExtensionObject */ - /***********************************************************/ - - // TODO: Fix security issue - ////[TestCase(Name="XsltArgumentList - GetExtensionObject", Desc="XsltArgumentList.GetExtensionObject")] - - //public class CArgGetExtObj : XsltApiTestCaseBase - //{ - // //[Variation(Desc="Basic Verification Test",Pri=0)] - // [InlineData()] - // public int GetExtObject1() - // { - // MyObject obj = new MyObject(1); - // m_xsltArg = new XsltArgumentList(); - - // m_xsltArg.AddExtensionObject(szDefaultNS, obj); - // retObj = m_xsltArg.GetExtensionObject(szDefaultNS); - - // _output.WriteLine("Retrieved value: {0}", ((MyObject)retObj).MyValue()); - // if(((MyObject)retObj).MyValue() != obj.MyValue()) - // { - // _output.WriteLine("Set and retrieved value appear to be different"); - // Assert.True(false); - // } - - // if((LoadXSL("myObjectDef.xsl") == TEST_PASS) && (Transform_ArgList("fruits.xml") == TEST_PASS) && - // (CheckResult(430.402026847)== TEST_PASS)) - // return; - // else - // Assert.True(false); - // } - - // //[Variation("Namespace URI = null")] - // [InlineData()] - // public int GetExtObject2() - // { - // m_xsltArg = new XsltArgumentList(); - - // try - // { - // m_xsltArg.GetExtensionObject(null); - // } - // catch(System.ArgumentNullException) - // { - // return; - // } - // _output.WriteLine("ArgumentNullException not thrown for null namespace System.Xml.Tests"); - // return; - // } - - // //[Variation("Namespace URI is empty string")] - // [InlineData()] - // public int GetExtObject3() - // { - // m_xsltArg = new XsltArgumentList(); - - // try - // { - // retObj = m_xsltArg.GetExtensionObject(szEmpty); - // } - // catch(Exception e) - // { - // _output.WriteLine(e.ToString()); - // Assert.True(false); - // } - - // if((LoadXSL("showParam.xsl") == TEST_PASS) && (Transform_ArgList("fruits.xml") == TEST_PASS) && - // (CheckResult(466.5112789241)== TEST_PASS)) - // return; - // else - // Assert.True(false); - // } - - // //[Variation("Namespace URI non-existent")] - // [InlineData()] - // public int GetExtObject4() - // { - // m_xsltArg = new XsltArgumentList(); - - // retObj = m_xsltArg.GetExtensionObject(szDefaultNS); - - // if(retObj != null) - // { - // _output.WriteLine("Did not return a NULL value for a non-existent URI"); - // Assert.True(false); - // } - // try - // { - // if((LoadXSL("myObjectDef.xsl") == TEST_PASS)) - // Transform_ArgList("fruits.xml"); - // } - // catch(System.Xml.Xsl.XsltException) - // { - // return; - // } - // _output.WriteLine("Did not throw exception for an invalid transform"); - // Assert.True(false); - // } - - // //[Variation("Very long namespace System.Xml.Tests")] - // [InlineData()] - // public int GetExtObject5() - // { - // m_xsltArg = new XsltArgumentList(); - // MyObject obj = new MyObject(5); - - // m_xsltArg.AddExtensionObject(szLongNS, obj); - // retObj = m_xsltArg.GetExtensionObject(szLongNS); - - // if(((MyObject)retObj).MyValue() != obj.MyValue()) - // { - // _output.WriteLine("Set and retrieved value appear to be different"); - // Assert.True(false); - // } - - // if((LoadXSL("MyObjectLongNS.xsl") == TEST_PASS) && (Transform_ArgList("fruits.xml") == TEST_PASS) && - // (CheckResult(522.0563223871)== TEST_PASS)) - // return; - // else - // Assert.True(false); - // } - - // /* - // * This test is no more valid. - // * MDAC Bug # 88407 fix now allows ANY characters in URI - // //[Variation("Invalid namespace System.Xml.Tests")] - // [InlineData()] - // public int GetExtObject6() - // { - // m_xsltArg = new XsltArgumentList(); - // MyObject obj = new MyObject(6); - - // try - // { - // m_xsltArg.AddExtensionObject(szInvalid, obj); - // } - // catch (System.UriFormatException) - // { - // return; - // } - // _output.WriteLine("Did not throw System.UriFormatException for invalid namespace System.Xml.Tests"); - // Assert.True(false); - // } - // */ - - // //[Variation("Different Data Types")] - // [InlineData()] - // public int GetExtObject7() - // { - // m_xsltArg = new XsltArgumentList(); - // String obj = "0.00"; - - // // string - // m_xsltArg.AddExtensionObject("myArg1", obj); - // retObj = m_xsltArg.GetExtensionObject("myArg1"); - // _output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", "0.00", retObj); - // if( retObj.ToString() != "0.00") - // { - // _output.WriteLine("Failed to add/get a value for {0} of type {1}", "0.00", "string"); - // _output.WriteLine("Retrieved: {0} ", retObj); - // Assert.True(false); - // } - - // int i = 8; - - // m_xsltArg.AddExtensionObject("myArg2", i); - // retObj = m_xsltArg.GetExtensionObject("myArg2"); - // _output.WriteLine("Added Value:{0}\nRetrieved Value:{1}", i, retObj); - // if(!i.Equals(retObj)) - // { - // _output.WriteLine("Failed to add/get a value for {0} with conversion from int to double", i); - // _output.WriteLine("Retrieved: {0}", retObj.ToString()); - // Assert.True(false); - // } - - // //must also be same instance!!! - // if(i != (int)retObj) - // Assert.True(false); - - // Boolean bF = (1==0); - - // m_xsltArg.AddExtensionObject("myArg3", bF); - // retObj = m_xsltArg.GetExtensionObject("myArg3"); - // _output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", bF.ToString(), retObj); - // if( !bF.Equals(retObj)) - // { - // _output.WriteLine("Failed to add/get a value for {0} of type {1}", bF.ToString(), "boolean"); - // _output.WriteLine("Retrieved: {0} ", retObj); - // Assert.True(false); - // } - - // Boolean bT = (1==1); - - // m_xsltArg.AddExtensionObject("myArg4", bT); - // retObj = m_xsltArg.GetExtensionObject("myArg4"); - // _output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", bT.ToString(), retObj); - // if( !bT.Equals(retObj)) - // { - // _output.WriteLine("Failed to add/get a value for {0} of type {1}", bT.ToString(), "boolean"); - // _output.WriteLine("Retrieved: {0} ", retObj); - // Assert.True(false); - // } - // return; - // } - - // //[Variation("Case sensitivity")] - // [InlineData()] - // public int GetExtObject8() - // { - // MyObject obj = new MyObject(8); - // m_xsltArg = new XsltArgumentList(); - - // m_xsltArg.AddExtensionObject("urn:my-object", obj); - - // retObj = m_xsltArg.GetExtensionObject("urn:my-object"); - // if(((MyObject)retObj).MyValue() != obj.MyValue()) - // { - // _output.WriteLine("Set and retrieved value appear to be different"); - // Assert.True(false); - // } - - // retObj = m_xsltArg.GetExtensionObject("URN:MY-OBJECT"); - // if(retObj != null) - // { - // _output.WriteLine("Set and retrieved value appear to be different for URN:MY-OBJECT"); - // Assert.True(false); - // } - - // retObj = m_xsltArg.GetExtensionObject("urn:My-Object"); - // if(retObj != null) - // { - // _output.WriteLine("Set and retrieved value appear to be different for urn:My-Object"); - // Assert.True(false); - // } - - // retObj = m_xsltArg.GetExtensionObject("urn-my:object"); - // if(retObj != null) - // { - // _output.WriteLine("Set and retrieved value appear to be different for urn-my:object"); - // Assert.True(false); - // } - - // if((LoadXSL("myObjectDef.xsl") == TEST_PASS) && (Transform_ArgList("fruits.xml") == TEST_PASS) && - // (CheckResult(430.402026847)== TEST_PASS)) - // return; - // else - // Assert.True(false); - // } - - // //[Variation("Whitespace")] - // [InlineData()] - // public int GetExtObject9() - // { - // int i=1; - // m_xsltArg = new XsltArgumentList(); - - // foreach(String str in szWhiteSpace) - // { - // MyObject obj = new MyObject(i); - - // m_xsltArg.AddExtensionObject(szDefaultNS + str, obj); - // retObj = m_xsltArg.GetExtensionObject(szDefaultNS + str); - // if(((MyObject)retObj).MyValue() != i) - // { - // _output.WriteLine("Error processing {0} test for whitespace arg", i); - // Assert.True(false); - // } - // i++; - // } - - // try - // { - // if((LoadXSL("myObjectDef.xsl") == TEST_PASS)) - // Transform_ArgList("fruits.xml"); - // } - // catch(System.Xml.Xsl.XsltException) - // { - // return; - // } - // _output.WriteLine("Did not throw expected exception: System.Xml.Xsl.XsltException"); - // Assert.True(false); - // } - - // //[Variation("Call after object has been removed")] - // [InlineData()] - // public int GetExtObject10() - // { - // MyObject obj = new MyObject(10); - // m_xsltArg = new XsltArgumentList(); - - // m_xsltArg.AddExtensionObject(szDefaultNS, obj); - // m_xsltArg.RemoveExtensionObject(szDefaultNS); - // retObj = m_xsltArg.GetExtensionObject(szDefaultNS); - - // if(retObj != null) - // { - // _output.WriteLine("Did not retrieve a NULL value for a non-existent object returned"); - // Assert.True(false); - // } - - // try - // { - // if((LoadXSL("myObjectDef.xsl") == TEST_PASS)) - // Transform_ArgList("fruits.xml"); - // } - // catch(System.Xml.Xsl.XsltException) - // { - // return; - // } - // _output.WriteLine("Did not throw expected exception: System.Xml.Xsl.XsltException"); - // Assert.True(false); - // } - - // //[Variation("Call multiple times")] - // [InlineData()] - // public int GetExtObject11() - // { - // MyObject obj = new MyObject(11); - // m_xsltArg = new XsltArgumentList(); - - // m_xsltArg.AddExtensionObject(szDefaultNS, obj); - - // for(int i=0; i < 500; i++) - // { - // retObj = m_xsltArg.GetExtensionObject(szDefaultNS); - // if(((MyObject)retObj).MyValue() != obj.MyValue()) - // { - // _output.WriteLine("Set and retrieved value appear to be different after {i} tries", i); - // Assert.True(false); - // } - // } - // if((LoadXSL("myObjectDef.xsl") == TEST_PASS) && (Transform_ArgList("fruits.xml") == TEST_PASS) && - // (CheckResult(430.402026847)== TEST_PASS)) - // return; - // else - // Assert.True(false); - // } - - // //[Variation("Using XSL Namespace")] - // [InlineData()] - // public int GetExtObject12() - // { - // m_xsltArg = new XsltArgumentList(); - - // retObj = m_xsltArg.GetExtensionObject(szDefaultNS); - // if(retObj != null) - // { - // _output.WriteLine("Did not retrieve null value when using namespace {0}", szXslNS); - // Assert.True(false); - // } - // return; - // } - //} - - /***********************************************************/ /* XsltArgumentList.AddParam */ /***********************************************************/ @@ -992,9 +612,20 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 0)] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam1() + public void AddParam1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -1012,7 +643,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1060,9 +691,20 @@ namespace System.Xml.Tests } //[Variation("Very Long Param Name")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam4() + public void AddParam4(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1</result>"; @@ -1075,7 +717,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParamLongName.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParamLongName.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1123,9 +765,20 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is empty string")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam7() + public void AddParam7(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test7 @@ -1144,7 +797,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test7") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1154,9 +807,20 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam8() + public void AddParam8(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1174,7 +838,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test8") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1183,33 +847,21 @@ namespace System.Xml.Tests Assert.True(false); } - /* - * This test is no more valid. - * MDAC Bug # 88407 fix now allows ANY characters in URI - //[Variation("Invalid Namespace URI")] - [InlineData()] - [Theory] - public void AddParam9() - { - m_xsltArg = new XsltArgumentList(); - - try - { - m_xsltArg.AddParam("myArg1", szInvalid, "Test1"); - } - catch (System.UriFormatException) - { - return; - } - _output.WriteLine("Did not throw System.UriFormatException for invalid namespace System.Xml.Tests"); - Assert.True(false); - } - */ - //[Variation("Objects as different Data Types")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam10() + public void AddParam10(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.My Custom Object has a value of 10 @@ -1224,7 +876,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myArg1", szEmpty, m); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1254,9 +906,20 @@ namespace System.Xml.Tests } //[Variation("Object with same name, different namespace System.Xml.Tests")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam12() + public void AddParam12(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -1287,7 +950,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1297,9 +960,20 @@ namespace System.Xml.Tests } //[Variation("Object with same namespace System.Xml.Tests, different name")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam13() + public void AddParam13(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -1330,7 +1004,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test1") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1340,9 +1014,20 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam14() + public void AddParam14(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -1378,7 +1063,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test3") Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1407,9 +1092,20 @@ namespace System.Xml.Tests } //[Variation("Add/remove object many times")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam16() + public void AddParam16(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1455,7 +1151,7 @@ namespace System.Xml.Tests retObj = m_xsltArg.GetParam("myArg2", szEmpty); if (retObj.ToString() != ("Test1")) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1465,9 +1161,20 @@ namespace System.Xml.Tests } //[Variation("Whitespace in URI and param")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam17() + public void AddParam17(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test @@ -1521,7 +1228,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1531,9 +1238,20 @@ namespace System.Xml.Tests } //[Variation("Adding many objects")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam18() + public void AddParam18(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -1554,7 +1272,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1564,9 +1282,20 @@ namespace System.Xml.Tests } //[Variation("Add same object many times")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam19() + public void AddParam19(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1595,7 +1324,7 @@ namespace System.Xml.Tests retObj = m_xsltArg.GetParam("myArg2", szEmpty); if (retObj.ToString() != ("Test1")) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1605,9 +1334,20 @@ namespace System.Xml.Tests } //[Variation("Using Different XSLT namespace")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam20() + public void AddParam20(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj1=""urn:http://www.w3.org/1999/XSL/Transform"" xmlns:myObj2=""urn:tmp"" xmlns:myObj3=""urn:my-object"" xmlns:myObj4=""urn:MY-OBJECT""> 1.Test1 @@ -1643,7 +1383,7 @@ namespace System.Xml.Tests if (retObj.ToString() != "Test4") Assert.True(false); - if ((LoadXSL("showParamNS.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParamNS.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1663,20 +1403,31 @@ namespace System.Xml.Tests } //[Variation("Parameters should not be cached")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject32() + public void AddExtObject32(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected1 = @"<?xml version=""1.0"" encoding=""utf-8""?><out>Param: first</out>"; string expected2 = @"<?xml version=""1.0"" encoding=""utf-8""?><out>Param: second</out>"; - if (LoadXSL("test_Param.xsl") == 1) + if (LoadXSL("test_Param.xsl", inputType, readerType) == 1) { m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("myParam1", szEmpty, "first"); // Transform once - if (Transform_ArgList("foo.xml") == 1) + if (Transform_ArgList("foo.xml", transformType, docType) == 1) { VerifyResult(expected1); @@ -1684,7 +1435,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myParam1", szEmpty, "second"); // Transform again to make sure that parameter from first transform are not cached - if (Transform_ArgList("foo.xml") == 1) + if (Transform_ArgList("foo.xml", transformType, docType) == 1) { VerifyResult(expected2); return; @@ -1722,75 +1473,299 @@ namespace System.Xml.Tests //global param is xsl:param local param is xsl:param //[Variation(id = 1, Pri = 2, Desc = "No param sent, global param used, local param exists with a default value", Params = new object[] { "AddParameterA1.xsl", "default local" })] - [InlineData("AddParameterA1.xsl", "default local")] + [InlineData("AddParameterA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 2, Pri = 2, Desc = "No param sent, global param used, local param exists with no default value", Params = new object[] { "AddParameterA2.xsl", "" })] - [InlineData("AddParameterA2.xsl", "")] + [InlineData("AddParameterA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 3, Pri = 2, Desc = "No param sent, global param used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterA3.xsl", "default global" })] - [InlineData("AddParameterA3.xsl", "default global")] + [InlineData("AddParameterA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 4, Pri = 2, Desc = "No param sent, global param used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterA4.xsl", "with-param" })] - [InlineData("AddParameterA4.xsl", "with-param")] + [InlineData("AddParameterA4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 5, Pri = 2, Desc = "No param sent, global param used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterA5.xsl", "" })] - [InlineData("AddParameterA5.xsl", "")] + [InlineData("AddParameterA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 6, Pri = 2, Desc = "No param sent, global param used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterA6.xsl", "default global" })] - [InlineData("AddParameterA6.xsl", "default global")] + [InlineData("AddParameterA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 7, Pri = 2, Desc = "No param sent, global param used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterA7.xsl", "default global" })] - [InlineData("AddParameterA7.xsl", "default global")] + [InlineData("AddParameterA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //global param is xsl:variable local param is xsl:param //[Variation(id = 8, Pri = 2, Desc = "No param sent, global variable used, local param exists with a default value", Params = new object[] { "AddParameterDA1.xsl", "default local" })] - [InlineData("AddParameterDA1.xsl", "default local")] + [InlineData("AddParameterDA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 9, Pri = 2, Desc = "No param sent, global variable used, local param exists with no default value", Params = new object[] { "AddParameterDA2.xsl", "" })] - [InlineData("AddParameterDA2.xsl", "")] + [InlineData("AddParameterDA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 10, Pri = 2, Desc = "No param sent, global variable used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterDA3.xsl", "default global" })] - [InlineData("AddParameterDA3.xsl", "default global")] + [InlineData("AddParameterDA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 11, Pri = 2, Desc = "No param sent, global variable used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterDA4.xsl", "with-param" })] - [InlineData("AddParameterDA4.xsl", "with-param")] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 12, Pri = 2, Desc = "No param sent, global variable used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterDA5.xsl", "" })] - [InlineData("AddParameterDA5.xsl", "")] + [InlineData("AddParameterDA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 13, Pri = 2, Desc = "No param sent, global variable used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterDA6.xsl", "default global" })] - [InlineData("AddParameterDA6.xsl", "default global")] + [InlineData("AddParameterDA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 14, Pri = 2, Desc = "No param sent, global variable used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterDA7.xsl", "default global" })] - [InlineData("AddParameterDA7.xsl", "default global")] + [InlineData("AddParameterDA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //global param is xsl:param local param is xsl:variable //[Variation(id = 15, Pri = 2, Desc = "No param sent, global param used, local variable exists with a default value", Params = new object[] { "AddParameterEA1.xsl", "default local" })] - [InlineData("AddParameterEA1.xsl", "default local")] + [InlineData("AddParameterEA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 16, Pri = 2, Desc = "No param sent, global param used, local variable exists with no default value", Params = new object[] { "AddParameterEA2.xsl", "" })] - [InlineData("AddParameterEA2.xsl", "")] + [InlineData("AddParameterEA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 17, Pri = 2, Desc = "No param sent, global param used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterEA3.xsl", "default global" })] - [InlineData("AddParameterEA3.xsl", "default global")] + [InlineData("AddParameterEA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 18, Pri = 2, Desc = "No param sent, global param used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterEA4.xsl", "default local" })] - [InlineData("AddParameterEA4.xsl", "default local")] + [InlineData("AddParameterEA4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 19, Pri = 2, Desc = "No param sent, global param used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterEA5.xsl", "" })] - [InlineData("AddParameterEA5.xsl", "")] + [InlineData("AddParameterEA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 20, Pri = 2, Desc = "No param sent, global param used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterEA6.xsl", "default global" })] - [InlineData("AddParameterEA6.xsl", "default global")] + [InlineData("AddParameterEA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 21, Pri = 2, Desc = "No param sent, global param used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterEA7.xsl", "default global" })] - [InlineData("AddParameterEA7.xsl", "default global")] + [InlineData("AddParameterEA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //global param is xsl:variable local param is xsl:variable //[Variation(id = 22, Pri = 2, Desc = "No param sent, global variable used, local variable exists with a default value", Params = new object[] { "AddParameterFA1.xsl", "default local" })] - [InlineData("AddParameterFA1.xsl", "default local")] + [InlineData("AddParameterFA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 23, Pri = 2, Desc = "No param sent, global variable used, local variable exists with no default value", Params = new object[] { "AddParameterFA2.xsl", "" })] - [InlineData("AddParameterFA2.xsl", "")] + [InlineData("AddParameterFA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 24, Pri = 2, Desc = "No param sent, global variable used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterFA3.xsl", "default global" })] - [InlineData("AddParameterFA3.xsl", "default global")] + [InlineData("AddParameterFA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 25, Pri = 2, Desc = "No param sent, global variable used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterFA4.xsl", "default local" })] - [InlineData("AddParameterFA4.xsl", "default local")] + [InlineData("AddParameterFA4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 26, Pri = 2, Desc = "No param sent, global variable used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterFA5.xsl", "" })] - [InlineData("AddParameterFA5.xsl", "")] + [InlineData("AddParameterFA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 27, Pri = 2, Desc = "No param sent, global variable used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterFA6.xsl", "default global" })] - [InlineData("AddParameterFA6.xsl", "default global")] + [InlineData("AddParameterFA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 28, Pri = 2, Desc = "No param sent, global variable used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterFA7.xsl", "default global" })] - [InlineData("AddParameterFA7.xsl", "default global")] + [InlineData("AddParameterFA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFA7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam1(object param0, object param1) + public void AddParam1(object param0, object param1, InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { m_xsltArg = new XsltArgumentList(); string xslFile = param0.ToString(); string expected = "<result>" + param1.ToString() + "</result>"; - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("AddParameter.xml") == 1)) + if ((LoadXSL(xslFile, inputType, readerType) == 1) && (Transform_ArgList("AddParameter.xml", transformType, docType) == 1)) VerifyResult(expected); else Assert.True(false); @@ -1800,69 +1775,293 @@ namespace System.Xml.Tests //global param is xsl:param local param is xsl:param //[Variation(id = 29, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value", Params = new object[] { "AddParameterB1.xsl", "default local" })] - [InlineData("AddParameterB1.xsl", "default local")] + [InlineData("AddParameterB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 30, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value", Params = new object[] { "AddParameterB2.xsl", "" })] - [InlineData("AddParameterB2.xsl", "")] + [InlineData("AddParameterB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 31, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterB3.xsl", "outside param" })] - [InlineData("AddParameterB3.xsl", "outside param")] + [InlineData("AddParameterB3.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 32, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterB4.xsl", "with-param" })] - [InlineData("AddParameterB4.xsl", "with-param")] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 33, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterB5.xsl", "" })] - [InlineData("AddParameterB5.xsl", "")] + [InlineData("AddParameterB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 34, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterB6.xsl", "outside param" })] - [InlineData("AddParameterB6.xsl", "outside param")] + [InlineData("AddParameterB6.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 35, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterB7.xsl", "outside param" })] - [InlineData("AddParameterB7.xsl", "outside param")] + [InlineData("AddParameterB7.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //global param is xsl:variable local param is xsl:param //[Variation(id = 36, Pri = 2, Desc = "Param sent, global variable used, local param exists with a default value", Params = new object[] { "AddParameterDB1.xsl", "default local" })] - [InlineData("AddParameterDB1.xsl", "default local")] + [InlineData("AddParameterDB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 37, Pri = 2, Desc = "Param sent, global variable used, local param exists with no default value", Params = new object[] { "AddParameterDB2.xsl", "" })] - [InlineData("AddParameterDB2.xsl", "")] + [InlineData("AddParameterDB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 38, Pri = 2, Desc = "Param sent, global variable used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterDB3.xsl", "default global" })] - [InlineData("AddParameterDB3.xsl", "default global")] + [InlineData("AddParameterDB3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 39, Pri = 2, Desc = "Param sent, global variable used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterDB4.xsl", "with-param" })] - [InlineData("AddParameterDB4.xsl", "with-param")] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 40, Pri = 2, Desc = "Param sent, global variable used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterDB5.xsl", "" })] - [InlineData("AddParameterDB5.xsl", "")] + [InlineData("AddParameterDB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 41, Pri = 2, Desc = "Param sent, global variable used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterDB6.xsl", "default global" })] - [InlineData("AddParameterDB6.xsl", "default global")] + [InlineData("AddParameterDB6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 42, Pri = 2, Desc = "Param sent, global variable used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterDB7.xsl", "default global" })] - [InlineData("AddParameterDB7.xsl", "default global")] + [InlineData("AddParameterDB7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterDB7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //global param is xsl:param local param is xsl:variable //[Variation(id = 43, Pri = 2, Desc = "Param sent, global param used, local variable exists with a default value", Params = new object[] { "AddParameterEB1.xsl", "default local" })] - [InlineData("AddParameterEB1.xsl", "default local")] + [InlineData("AddParameterEB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 44, Pri = 2, Desc = "Param sent, global param used, local variable exists with no default value", Params = new object[] { "AddParameterEB2.xsl", "" })] - [InlineData("AddParameterEB2.xsl", "")] + [InlineData("AddParameterEB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 45, Pri = 2, Desc = "Param sent, global param used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterEB3.xsl", "outside param" })] - [InlineData("AddParameterEB3.xsl", "outside param")] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB3.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 46, Pri = 2, Desc = "Param sent, global param used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterEB4.xsl", "default local" })] - [InlineData("AddParameterEB4.xsl", "default local")] + [InlineData("AddParameterEB4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 47, Pri = 2, Desc = "Param sent, global param used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterEB5.xsl", "" })] - [InlineData("AddParameterEB5.xsl", "")] + [InlineData("AddParameterEB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 48, Pri = 2, Desc = "Param sent, global param used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterEB6.xsl", "outside param" })] - [InlineData("AddParameterEB6.xsl", "outside param")] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB6.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 49, Pri = 2, Desc = "Param sent, global param used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterEB7.xsl", "outside param" })] - [InlineData("AddParameterEB7.xsl", "outside param")] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterEB7.xsl", "outside param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //global param is xsl:variable local param is xsl:variable //[Variation(id = 50, Pri = 2, Desc = "Param sent, global variable used, local variable exists with a default value", Params = new object[] { "AddParameterFB1.xsl", "default local" })] - [InlineData("AddParameterFB1.xsl", "default local")] + [InlineData("AddParameterFB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 51, Pri = 2, Desc = "Param sent, global variable used, local variable exists with no default value", Params = new object[] { "AddParameterFB2.xsl", "" })] - [InlineData("AddParameterFB2.xsl", "")] + [InlineData("AddParameterFB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 52, Pri = 2, Desc = "Param sent, global variable used, local variable doesn't exist but reference to param exists", Params = new object[] { "AddParameterFB3.xsl", "default global" })] - [InlineData("AddParameterFB3.xsl", "default global")] + [InlineData("AddParameterFB3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB3.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 53, Pri = 2, Desc = "Param sent, global variable used, local variable exists with a default value and with-param sends a value", Params = new object[] { "AddParameterFB4.xsl", "default local" })] - [InlineData("AddParameterFB4.xsl", "default local")] + [InlineData("AddParameterFB4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB4.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 54, Pri = 2, Desc = "Param sent, global variable used, local variable exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterFB5.xsl", "" })] - [InlineData("AddParameterFB5.xsl", "")] + [InlineData("AddParameterFB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 55, Pri = 2, Desc = "Param sent, global variable used, local variable doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterFB6.xsl", "default global" })] - [InlineData("AddParameterFB6.xsl", "default global")] + [InlineData("AddParameterFB6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB6.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 56, Pri = 2, Desc = "Param sent, global variable used, local variable doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterFB7.xsl", "default global" })] - [InlineData("AddParameterFB7.xsl", "default global")] + [InlineData("AddParameterFB7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterFB7.xsl", "default global", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam2(object param0, object param1) + public void AddParam2(object param0, object param1, InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string xslFile = param0.ToString(); string expected = "<result>" + param1.ToString() + "</result>"; @@ -1870,7 +2069,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", "", "outside param"); - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("AddParameter.xml") == 1)) + if ((LoadXSL(xslFile, inputType, readerType) == 1) && (Transform_ArgList("AddParameter.xml", transformType, docType) == 1)) VerifyResult(expected); else Assert.True(false); @@ -1879,21 +2078,77 @@ namespace System.Xml.Tests //All the below variations, empty param is sent from client code //global param is xsl:param local param is xsl:param //[Variation(id = 57, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value", Params = new object[] { "AddParameterB1.xsl", "default local" })] - [InlineData("AddParameterB1.xsl", "default local")] + [InlineData("AddParameterB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB1.xsl", "default local", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 58, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value", Params = new object[] { "AddParameterB2.xsl", "" })] - [InlineData("AddParameterB2.xsl", "")] + [InlineData("AddParameterB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB2.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 59, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist but reference to param exists", Params = new object[] { "AddParameterB3.xsl", "" })] - [InlineData("AddParameterB3.xsl", "")] + [InlineData("AddParameterB3.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB3.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 60, Pri = 2, Desc = "Param sent, global param used, local param exists with a default value and with-param sends a value", Params = new object[] { "AddParameterB4.xsl", "with-param" })] - [InlineData("AddParameterB4.xsl", "with-param")] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB4.xsl", "with-param", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 61, Pri = 2, Desc = "Param sent, global param used, local param exists with no default value and with-param doesn't send a value", Params = new object[] { "AddParameterB5.xsl", "" })] - [InlineData("AddParameterB5.xsl", "")] + [InlineData("AddParameterB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB5.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 62, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends a value", Params = new object[] { "AddParameterB6.xsl", "" })] - [InlineData("AddParameterB6.xsl", "")] + [InlineData("AddParameterB6.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB6.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] //[Variation(id = 63, Pri = 2, Desc = "Param sent, global param used, local param doesn't exist, reference to param, with-param sends no value", Params = new object[] { "AddParameterB7.xsl", "" })] - [InlineData("AddParameterB7.xsl", "")] + [InlineData("AddParameterB7.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData("AddParameterB7.xsl", "", InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddParam3(object param0, object param1) + public void AddParam3(object param0, object param1, InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string xslFile = param0.ToString(); string expected = "<result>" + param1.ToString() + "</result>"; @@ -1901,7 +2156,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", "", ""); - if ((LoadXSL(xslFile) == 1) && (Transform_ArgList("AddParameter.xml") == 1)) + if ((LoadXSL(xslFile, inputType, readerType) == 1) && (Transform_ArgList("AddParameter.xml", transformType, docType) == 1)) VerifyResult(expected); else Assert.True(false); @@ -1934,9 +2189,20 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 0)] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject1() + public void AddExtObject1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> 1.Test1 @@ -1947,7 +2213,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1989,9 +2255,20 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject4() + public void AddExtObject4(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""http://www.miocrosoft.com/this/is/a/very/long/namespace/uri/to/do/the/api/testing/for/xslt/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/0123456789/""> 1.Test1 @@ -2003,7 +2280,7 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject(szLongNS, obj); - if ((LoadXSL("myObjectLongNS.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectLongNS.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2013,9 +2290,20 @@ namespace System.Xml.Tests } //[Variation("Different Data Types")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject6() + public void AddExtObject6(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> @@ -2096,7 +2384,7 @@ namespace System.Xml.Tests retObj = m_xsltArg.GetExtensionObject("myArg6"); _output.WriteLine("Added Value:{0}\nRetrieved Value: {1}", bT.ToString(), retObj); - if ((LoadXSL("MyObject_DataTypes.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_DataTypes.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2128,9 +2416,20 @@ namespace System.Xml.Tests } //[Variation("Case sensitivity")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject8() + public void AddExtObject8(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> 1.Test1 @@ -2152,7 +2451,7 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject("urn:My-Object", obj); m_xsltArg.AddExtensionObject("urn-my:object", obj); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2182,9 +2481,20 @@ namespace System.Xml.Tests } //[Variation("Unitialized and NULL return values from the methods in the extension object")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject10() + public void AddExtObject10(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> @@ -2195,7 +2505,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_Null.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_Null.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2205,9 +2515,20 @@ namespace System.Xml.Tests } //[Variation("Add many objects")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject11() + public void AddExtObject11(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> 1.Test1 @@ -2224,7 +2545,7 @@ namespace System.Xml.Tests MyObject obj = new MyObject(i, _output); m_xsltArg.AddExtensionObject(szDefaultNS + i, obj); } - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2234,9 +2555,20 @@ namespace System.Xml.Tests } //[Variation("Whitespace")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject12() + public void AddExtObject12(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { int i = 1; m_xsltArg = new XsltArgumentList(); @@ -2249,8 +2581,8 @@ namespace System.Xml.Tests } try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1)) + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -2282,9 +2614,20 @@ namespace System.Xml.Tests } //[Variation("Add and Remove multiple times")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject14() + public void AddExtObject14(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> 1.Test1 @@ -2301,7 +2644,7 @@ namespace System.Xml.Tests } m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2311,9 +2654,20 @@ namespace System.Xml.Tests } //[Variation("Namespace URI non-existent")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject15() + public void AddExtObject15(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { MyObject obj = new MyObject(15, _output); m_xsltArg = new XsltArgumentList(); @@ -2321,8 +2675,8 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject(szSimple, obj); try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1)) + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -2333,9 +2687,20 @@ namespace System.Xml.Tests } //[Variation("Accessing Private and protected Items")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject16() + public void AddExtObject16(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); @@ -2343,22 +2708,22 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject(szDefaultNS, obj); try { - LoadXSL("MyObject_PrivateAccess.xsl"); - Transform_ArgList("fruits.xml", true); + LoadXSL("MyObject_PrivateAccess.xsl", inputType, readerType); + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { try { - LoadXSL("MyObject_ProtectedAccess.xsl"); - Transform_ArgList("fruits.xml", true); + LoadXSL("MyObject_ProtectedAccess.xsl", inputType, readerType); + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { try { - LoadXSL("MyObject_DefaultAccess.xsl"); - Transform_ArgList("fruits.xml", true); + LoadXSL("MyObject_DefaultAccess.xsl", inputType, readerType); + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -2370,9 +2735,20 @@ namespace System.Xml.Tests } //[Variation("Writing To Output")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject17() + public void AddExtObject17(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> Here:End @@ -2382,7 +2758,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_ConsoleWrite.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_ConsoleWrite.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2392,9 +2768,20 @@ namespace System.Xml.Tests } //[Variation("Recursive Functions")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject18() + public void AddExtObject18(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> Recursive Function Returning the factorial of five:120</result>"; @@ -2403,7 +2790,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_Recursion.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_Recursion.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2413,9 +2800,20 @@ namespace System.Xml.Tests } //[Variation("Overloaded Functions")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject19() + public void AddExtObject19(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> Overloaded Double: Int Overlaod @@ -2426,7 +2824,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_Overloads.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_Overloads.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2436,9 +2834,20 @@ namespace System.Xml.Tests } //[Variation("Function-exists tests")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject20() + public void AddExtObject20(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> DoNothing Function Test Pass @@ -2456,7 +2865,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_FnExists.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_FnExists.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2466,9 +2875,20 @@ namespace System.Xml.Tests } //[Variation("Argument Tests")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject21() + public void AddExtObject21(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> @@ -2481,7 +2901,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_Arguments.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_Arguments.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2491,9 +2911,20 @@ namespace System.Xml.Tests } //[Variation("Methods returning void and valid types")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject22() + public void AddExtObject22(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> Get A String:Hello world @@ -2508,7 +2939,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_ReturnValidTypes.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_ReturnValidTypes.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2541,20 +2972,31 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject25() + public void AddExtObject25(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { MyObject obj = new MyObject(25, _output); m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if (LoadXSL("MyObject_CaseSensitive.xsl") == 1) + if (LoadXSL("MyObject_CaseSensitive.xsl", inputType, readerType) == 1) { try { - Transform_ArgList("fruits.xml"); - CheckResult(419.3031944636); + Transform_ArgList("fruits.xml", transformType, docType); + CheckResult(419.3031944636, transformType); } catch (System.Xml.Xsl.XsltException) { @@ -2566,19 +3008,30 @@ namespace System.Xml.Tests } //[Variation("Object namespace System.Xml.Tests found")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject26() + public void AddExtObject26(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { MyObject obj = new MyObject(26, _output); m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_NotFoundNS.xsl") == 1)) + if ((LoadXSL("MyObject_NotFoundNS.xsl", inputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml", true); + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -2590,9 +3043,20 @@ namespace System.Xml.Tests } //[Variation("Maintaining State")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject27() + public void AddExtObject27(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> A:27 @@ -2608,7 +3072,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_KeepingState.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_KeepingState.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2618,9 +3082,20 @@ namespace System.Xml.Tests } //[Variation("Deliberately Messing Up the Stylesheet")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject28() + public void AddExtObject28(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> @@ -2635,7 +3110,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_KillerStrings.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("MyObject_KillerStrings.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2645,19 +3120,30 @@ namespace System.Xml.Tests } //[Variation("Function not found in Object")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject29() + public void AddExtObject29(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { MyObject obj = new MyObject(29, _output); m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject(szDefaultNS, obj); - if ((LoadXSL("MyObject_NotFound.xsl") == 1)) + if ((LoadXSL("MyObject_NotFound.xsl", inputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml", true); + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -2681,9 +3167,20 @@ namespace System.Xml.Tests } //[Variation("Extension objects should not be cached during Transform()")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void AddExtObject32() + public void AddExtObject32(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected1 = @"<?xml version=""1.0"" encoding=""utf-8""?><out xmlns:id=""id"" xmlns:cap=""capitalizer""> ID: first @@ -2693,14 +3190,14 @@ namespace System.Xml.Tests ID: second Capitalized ID: SECOND</out>"; - if (LoadXSL("Bug78587.xsl") == 1) + if (LoadXSL("Bug78587.xsl", inputType, readerType) == 1) { m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject("id", new Id("first")); m_xsltArg.AddExtensionObject("capitalizer", new Capitalizer()); // Transform once - if (Transform_ArgList("Bug78587.xml") == 1) + if (Transform_ArgList("Bug78587.xml", transformType, docType) == 1) { VerifyResult(expected1); @@ -2709,7 +3206,7 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject("capitalizer", new Capitalizer()); // Transform again to make sure that extension objects from first transform are not cached - if (Transform_ArgList("Bug78587.xml") == 1) + if (Transform_ArgList("Bug78587.xml", transformType, docType) == 1) { VerifyResult(expected2); return; @@ -2738,9 +3235,12 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 0)] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam1() + public void RemoveParam1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -2770,7 +3270,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2795,9 +3295,12 @@ namespace System.Xml.Tests } //[Variation("Param name is empty string")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam3() + public void RemoveParam3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -2810,7 +3313,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.RemoveParam(szEmpty, szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2820,9 +3323,12 @@ namespace System.Xml.Tests } //[Variation("Param name is non-existent")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam4() + public void RemoveParam4(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -2835,7 +3341,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.RemoveParam(szSimple, szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2845,9 +3351,12 @@ namespace System.Xml.Tests } //[Variation("Invalid Param name")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam5() + public void RemoveParam5(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -2860,7 +3369,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.RemoveParam(szInvalid, szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2870,9 +3379,12 @@ namespace System.Xml.Tests } //[Variation("Very long param name")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam6() + public void RemoveParam6(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified</result>"; @@ -2882,7 +3394,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam(szLongString, szEmpty, "Test1"); m_xsltArg.RemoveParam(szLongString, szEmpty); - if ((LoadXSL("showParamLongName.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParamLongName.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2908,9 +3420,12 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is empty string")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam8() + public void RemoveParam8(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -2925,7 +3440,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myArg1", szEmpty, "Test1"); m_xsltArg.RemoveParam("myArg1", szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2935,9 +3450,12 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is non-existent")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam9() + public void RemoveParam9(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -2952,7 +3470,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myArg1", szEmpty, "Test1"); m_xsltArg.RemoveParam("myArg1", "http://www.xsltTest.com"); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2962,9 +3480,12 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam10() + public void RemoveParam10(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -2979,7 +3500,7 @@ namespace System.Xml.Tests m_xsltArg.AddParam("myArg1", szLongString, "Test1"); m_xsltArg.RemoveParam("myArg1", szLongString); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2989,9 +3510,12 @@ namespace System.Xml.Tests } //[Variation("Different Data Types")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam11() + public void RemoveParam11(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3190,7 +3714,7 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3200,9 +3724,12 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam12() + public void RemoveParam12(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -3220,7 +3747,7 @@ namespace System.Xml.Tests m_xsltArg.RemoveParam("myArg1 ", szEmpty); // perform a transform for kicks and ensure all is ok. - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3230,9 +3757,12 @@ namespace System.Xml.Tests } //[Variation("Whitespace")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam13() + public void RemoveParam13(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test @@ -3273,7 +3803,7 @@ namespace System.Xml.Tests } // perform a transform for kicks and ensure all is ok. - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3283,9 +3813,12 @@ namespace System.Xml.Tests } //[Variation("Call Multiple Times")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void RemoveParam14() + public void RemoveParam14(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3302,7 +3835,7 @@ namespace System.Xml.Tests for (int i = 0; i < 500; i++) m_xsltArg.RemoveParam("myArg1", szEmpty); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3341,9 +3874,12 @@ namespace System.Xml.Tests } //[Variation(Desc = "Basic Verification Test", Pri = 0)] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj1() + public void RemoveExtObj1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { MyObject obj = new MyObject(1, _output); m_xsltArg = new XsltArgumentList(); @@ -3353,8 +3889,8 @@ namespace System.Xml.Tests try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1)) + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -3385,9 +3921,12 @@ namespace System.Xml.Tests } //[Variation("Call Multiple Times")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj3() + public void RemoveExtObj3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3405,7 +3944,7 @@ namespace System.Xml.Tests for (int i = 0; i < 500; i++) m_xsltArg.RemoveExtensionObject(szDefaultNS); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3415,9 +3954,12 @@ namespace System.Xml.Tests } //[Variation("Namespace URI is non-existent")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj4() + public void RemoveExtObj4(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> 1.Test1 @@ -3430,7 +3972,7 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject(szDefaultNS, obj); m_xsltArg.RemoveExtensionObject(szSimple); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3440,9 +3982,12 @@ namespace System.Xml.Tests } //[Variation("Very long namespace System.Xml.Tests")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj5() + public void RemoveExtObj5(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { m_xsltArg = new XsltArgumentList(); MyObject obj = new MyObject(5, _output); @@ -3452,8 +3997,8 @@ namespace System.Xml.Tests try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1)) + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -3464,9 +4009,12 @@ namespace System.Xml.Tests } //[Variation("Different Data Types")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj6() + public void RemoveExtObj6(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3497,7 +4045,7 @@ namespace System.Xml.Tests m_xsltArg.AddExtensionObject("urn:my-object", false); m_xsltArg.RemoveExtensionObject("urn:my-object"); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3507,9 +4055,12 @@ namespace System.Xml.Tests } //[Variation("Case Sensitivity")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj7() + public void RemoveExtObj7(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result xmlns:myObj=""urn:my-object""> 1.Test1 @@ -3526,7 +4077,7 @@ namespace System.Xml.Tests m_xsltArg.RemoveExtensionObject("urn-my:object"); m_xsltArg.RemoveExtensionObject("urn:my-object "); - if ((LoadXSL("myObjectDef.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3536,9 +4087,12 @@ namespace System.Xml.Tests } //[Variation("Whitespace")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj8() + public void RemoveExtObj8(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { int i = 1; m_xsltArg = new XsltArgumentList(); @@ -3560,8 +4114,8 @@ namespace System.Xml.Tests try { - if ((LoadXSL("myObjectDef.xsl") == 1)) - Transform_ArgList("fruits.xml", true); + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1)) + Transform_ArgList("fruits.xml", true, transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -3572,9 +4126,12 @@ namespace System.Xml.Tests } //[Variation("Using default XSLT namespace - Bug305503")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void RemoveExtObj9() + public void RemoveExtObj9(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3590,7 +4147,7 @@ namespace System.Xml.Tests m_xsltArg.RemoveExtensionObject(szDefaultNS); // ensure we can still do a transform - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3613,10 +4170,10 @@ namespace System.Xml.Tests _output = output; } - //[Variation(Desc = "Basic Verification Test", Pri = 0)] - [InlineData()] + //[Variation(Desc = "Basic Verification Test", Pri = 0)][InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear1() + public void Clear1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3638,7 +4195,7 @@ namespace System.Xml.Tests if (retObj != null) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3648,9 +4205,9 @@ namespace System.Xml.Tests } //[Variation("Clear with nothing loaded")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear2() + public void Clear2(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3663,7 +4220,7 @@ namespace System.Xml.Tests m_xsltArg = new XsltArgumentList(); m_xsltArg.Clear(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3673,9 +4230,9 @@ namespace System.Xml.Tests } //[Variation("Clear Params")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear3() + public void Clear3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3697,7 +4254,7 @@ namespace System.Xml.Tests if (retObj != null) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3707,9 +4264,9 @@ namespace System.Xml.Tests } //[Variation("Clear Extension Objects")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear4() + public void Clear4(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { MyObject obj = new MyObject(26, _output); m_xsltArg = new XsltArgumentList(); @@ -3723,11 +4280,11 @@ namespace System.Xml.Tests Assert.True(false); } - if ((LoadXSL("myObjectDef.xsl") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml"); + Transform_ArgList("fruits.xml", transformType, docType); } catch (System.Xml.Xsl.XsltException) { @@ -3739,9 +4296,9 @@ namespace System.Xml.Tests } //[Variation("Clear Many Objects")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear5() + public void Clear5(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3781,7 +4338,7 @@ namespace System.Xml.Tests m_xsltArg.Clear(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3791,9 +4348,9 @@ namespace System.Xml.Tests } //[Variation("Clear Multiple Times")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear6() + public void Clear6(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3816,7 +4373,7 @@ namespace System.Xml.Tests if (retObj != null) Assert.True(false); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3826,9 +4383,9 @@ namespace System.Xml.Tests } //[Variation("Loading one object, but clearing another")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear7() + public void Clear7(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.Test1 @@ -3848,7 +4405,7 @@ namespace System.Xml.Tests m_2.Clear(); - if ((LoadXSL("showParam.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -3858,9 +4415,9 @@ namespace System.Xml.Tests } //[Variation("Clear after objects have been \"Removed\"")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] [Theory] - public void Clear8() + public void Clear8(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -3879,7 +4436,7 @@ namespace System.Xml.Tests retObj = m_xsltArg.RemoveParam("myArg1", szEmpty); m_xsltArg.Clear(); - if ((LoadXSL("showParam.xsl") != 1) || (Transform_ArgList("fruits.xml") != 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) != 1) || (Transform_ArgList("fruits.xml", transformType, docType) != 1)) Assert.True(false); VerifyResult(expected); @@ -3890,11 +4447,11 @@ namespace System.Xml.Tests m_xsltArg.RemoveExtensionObject(szDefaultNS); m_xsltArg.Clear(); - if ((LoadXSL("myObjectDef.xsl") == 1)) + if ((LoadXSL("myObjectDef.xsl", inputType, readerType) == 1)) { try { - Transform_ArgList("fruits.xml"); + Transform_ArgList("fruits.xml", transformType, docType); } catch (System.Xml.Xsl.XsltException) { diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs index 1944a65c65..bab4a2c646 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransform.cs @@ -1,14 +1,12 @@ + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Xunit; using Xunit.Abstractions; -using System; using System.Collections; using System.IO; -using System.Security; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; @@ -371,20 +369,31 @@ namespace System.Xml.Tests } //[Variation("Set XmlResolver property to null, load style sheet with import/include, should not affect transform")] - [InlineData()] - [Theory] - public void XmlResolver1() - { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void XmlResolver1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) + { + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; try { - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1) { xslt.XmlResolver = null; - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -403,19 +412,30 @@ namespace System.Xml.Tests } //[Variation("Set XmlResolver property to null, load style sheet with document function, should not resolve during transform")] - [InlineData()] - [Theory] - public void XmlResolver2() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void XmlResolver2(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result></result>"; // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", inputType, readerType) == 1) { xslt.XmlResolver = null; - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -430,9 +450,20 @@ namespace System.Xml.Tests } //[Variation("Default XmlResolver, load style sheet with document function, should resolve during transform")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "SQLBU Defect Tracking Bug 430834: Skipping when input type is URI, see bug for more details.")] - public void XmlResolver3() + public void XmlResolver3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> @@ -441,9 +472,9 @@ namespace System.Xml.Tests //if (MyInputType() == InputType.URI) // return TEST_SKIPPED; - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", inputType, readerType) == 1) { - if ((Transform("fruits.xml") == 1) && (CheckResult(377.8217373898) == 1)) + if ((Transform("fruits.xml", transformType, docType) == 1) && (CheckResult(377.8217373898, transformType) == 1)) return; } else @@ -455,10 +486,20 @@ namespace System.Xml.Tests } //[Variation("document() has absolute URI")] - [ActiveIssue(14071)] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "When style sheet URI = Intranet zone, XmlSecureResolver does not resolve document function")] - public void XmlResolver7() + public void XmlResolver7(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // Skip this test for Load(URI) // Reason: When style sheet URI = Intranet zone, XmlSecureResolver does not resolve document function @@ -470,12 +511,13 @@ namespace System.Xml.Tests try { - if (!Directory.Exists("c:\\temp")) + string tempDir = Path.GetTempPath(); + if (!Directory.Exists(tempDir)) { - Directory.CreateDirectory("c:\\temp"); + Directory.CreateDirectory(tempDir); } string xmlFile = FullFilePath("xmlResolver_document_function.xml"); - File.Copy(xmlFile, @"c:\temp\xmlResolver_document_function.xml", true); + File.Copy(xmlFile, Path.Combine(tempDir, "xmlResolver_document_function.xml"), true); } catch (Exception e) { @@ -484,9 +526,9 @@ namespace System.Xml.Tests return; //return TEST_SKIPPED; } - if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl") == 1) + if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl", inputType, readerType) == 1) { - if ((Transform("fruits.xml") == 1) && (CheckResult(377.8217373898) == 1)) + if ((Transform("fruits.xml", transformType, docType) == 1) && (CheckResult(377.8217373898, transformType) == 1)) return; else { @@ -527,13 +569,15 @@ namespace System.Xml.Tests } //[Variation("Call Load with null value")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric1() + public void LoadGeneric1(InputType inputType, ReaderType readerType) { try { - LoadXSL(null); + LoadXSL(null, inputType, readerType); } catch (System.ArgumentException) { @@ -545,21 +589,32 @@ namespace System.Xml.Tests } //[Variation("Load with valid, then invalid, then valid again")] - [InlineData()] - [Theory] - public void LoadGeneric2() - { - if (LoadXSL("showParam.xsl") == 1) + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric2(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) + { + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { - LoadXSL("IDontExist.xsl"); + LoadXSL("IDontExist.xsl", inputType, readerType); } catch (System.IO.FileNotFoundException) { try { - Transform("fruits.xml"); + Transform("fruits.xml", transformType, docType); } catch (System.InvalidOperationException e) { @@ -577,9 +632,20 @@ namespace System.Xml.Tests } //[Variation("Load an invalid, then a valid and transform")] - [InlineData()] - [Theory] - public void LoadGeneric3() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -591,11 +657,11 @@ namespace System.Xml.Tests try { - LoadXSL("IDontExist.xsl"); + LoadXSL("IDontExist.xsl", inputType, readerType); } catch (System.IO.FileNotFoundException) { - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -606,9 +672,20 @@ namespace System.Xml.Tests } //[Variation("Call several overloaded functions")] - [InlineData()] - [Theory] - public void LoadGeneric4() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric4(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -618,26 +695,26 @@ namespace System.Xml.Tests 5.No Value Specified 6.No Value Specified</result>"; - if (MyInputType() != InputType.Reader) - LoadXSL("showParamLongName.xsl", InputType.Reader); - if (MyInputType() != InputType.URI) - LoadXSL("showParamLongName.xsl", InputType.URI); - if (MyInputType() != InputType.Navigator) - LoadXSL("showParamLongName.xsl", InputType.Navigator); + if (inputType != InputType.Reader) + LoadXSL("showParamLongName.xsl", InputType.Reader, readerType); + if (inputType != InputType.URI) + LoadXSL("showParamLongName.xsl", InputType.URI, readerType); + if (inputType != InputType.Navigator) + LoadXSL("showParamLongName.xsl", InputType.Navigator, readerType); - if ((LoadXSL("showParam.xsl") == 0) || (Transform("fruits.xml") == 0)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 0) || (Transform("fruits.xml", transformType, docType) == 0)) Assert.True(false); VerifyResult(expected); - if (MyInputType() != InputType.Navigator) - LoadXSL("showParamLongName.xsl", InputType.Navigator); - if (MyInputType() != InputType.URI) - LoadXSL("showParamLongName.xsl", InputType.URI); - if (MyInputType() != InputType.Reader) - LoadXSL("showParamLongName.xsl", InputType.Reader); + if (inputType != InputType.Navigator) + LoadXSL("showParamLongName.xsl", InputType.Navigator, readerType); + if (inputType != InputType.URI) + LoadXSL("showParamLongName.xsl", InputType.URI, readerType); + if (inputType != InputType.Reader) + LoadXSL("showParamLongName.xsl", InputType.Reader, readerType); - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -647,9 +724,20 @@ namespace System.Xml.Tests } //[Variation("Call same overloaded Load() many times then transform")] - [InlineData()] - [Theory] - public void LoadGeneric5() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric5(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -661,13 +749,13 @@ namespace System.Xml.Tests for (int i = 0; i < 100; i++) { - if (LoadXSL("showParam.xsl") != 1) + if (LoadXSL("showParam.xsl", inputType, readerType) != 1) { _output.WriteLine("Failed to load stylesheet showParam.xsl on the {0} attempt", i); Assert.True(false); } } - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -676,13 +764,15 @@ namespace System.Xml.Tests } //[Variation("Call load with non-existing stylesheet")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric6() + public void LoadGeneric6(InputType inputType, ReaderType readerType) { try { - LoadXSL("IDontExist.xsl"); + LoadXSL("IDontExist.xsl", inputType, readerType); } catch (System.IO.FileNotFoundException) { @@ -693,22 +783,33 @@ namespace System.Xml.Tests } //[Variation("Verify that style sheet is closed properly after Load - Shared Read Access")] - [InlineData()] - [Theory] - public void LoadGeneric7() - { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric7(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) + { + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; FileStream s2; // check immediately after load and after transform - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1) { s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.Read, FileShare.Read); s2.Dispose(); - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.Read, FileShare.Read); @@ -719,49 +820,34 @@ namespace System.Xml.Tests Assert.True(false); } - /* - //[Variation("Verify that style sheet is closed properly after Load - ReadWrite Access")] - [InlineData()] - [Theory] - public void LoadGeneric8() - { - FileStream s2; - - // check immediately after load and after transform - - if(LoadXSL("XmlResolver_Main.xsl") == TEST_PASS) - { - s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - if((Transform("fruits.xml") == TEST_PASS) && (CheckResult(428.8541842246)== TEST_PASS)) - { - s2 = new FileStream(FullFilePath("XmlResolver_Main.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - return; - } - } - _output.WriteLine("Appeared to not close style sheet file properly after loading."); - Assert.True(false); - } - */ - //[Variation("Verify that included files are closed properly after Load - Read Access")] - [InlineData()] - [Theory] - public void LoadGeneric9() - { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric9(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) + { + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; FileStream s2; // check immediately after load and after transform - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1) { s2 = new FileStream(FullFilePath("XmlResolver_Sub.xsl"), FileMode.Open, FileAccess.Read); s2.Dispose(); - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); s2 = new FileStream(FullFilePath("XmlResolver_Include.xsl"), FileMode.Open, FileAccess.Read, FileShare.Read); @@ -773,51 +859,37 @@ namespace System.Xml.Tests Assert.True(false); } - /* - //[Variation("Verify that included files are closed properly after Load - ReadWrite Access")] - [InlineData()] - [Theory] - public void LoadGeneric10() - { - FileStream s2; - - // check immediately after load and after transform - if(LoadXSL("XmlResolver_Main.xsl") == TEST_PASS) - { - s2 = new FileStream(FullFilePath("XmlResolver_sub.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - if((Transform("fruits.xml") == TEST_PASS) && (CheckResult(428.8541842246)== TEST_PASS)) - { - s2 = new FileStream(FullFilePath("XmlResolver_Include.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - return; - } - } - _output.WriteLine("Appeared to not close file properly after loading."); - Assert.True(false); - } - */ - //[Variation("Load stylesheet with entity reference: Bug #68450 ")] - [InlineData()] - [Theory] - public void LoadGeneric11() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric11(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><Book> Name </Book>"; - if (MyDocType().ToString() == "DataDocument") + if (docType.ToString() == "DataDocument") // Skip the test for DataDocument return; else { - if (LoadXSL("books_entity_ref.xsl", InputType.Reader) != 1) + if (LoadXSL("books_entity_ref.xsl", InputType.Reader, readerType) != 1) { _output.WriteLine("Failed to load stylesheet books_entity_ref.xsl"); Assert.True(false); } - if ((LoadXSL("books_entity_ref.xsl") == 1) && (Transform("books_entity_ref.xml") == 1)) + if ((LoadXSL("books_entity_ref.xsl", inputType, readerType) == 1) && (Transform("books_entity_ref.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -827,15 +899,17 @@ namespace System.Xml.Tests } //[Variation("Load with invalid stylesheet and verify that file is closed properly")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric12() + public void LoadGeneric12(InputType inputType, ReaderType readerType) { Stream strmTemp; try { - int i = LoadXSL("xslt_error.xsl"); + int i = LoadXSL("xslt_error.xsl", inputType, readerType); } catch (System.Xml.Xsl.XsltCompileException) { @@ -882,13 +956,15 @@ namespace System.Xml.Tests } //[Variation("Call Load with null source value and null resolver")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric1() + public void LoadGeneric1(InputType inputType, ReaderType readerType) { try { - LoadXSL_Resolver(null, null); + LoadXSL_Resolver(null, null, inputType, readerType); } catch (System.ArgumentException) { @@ -900,13 +976,15 @@ namespace System.Xml.Tests } //[Variation("Call Load with null source value and valid resolver")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric2() + public void LoadGeneric2(InputType inputType, ReaderType readerType) { try { - LoadXSL_Resolver(null, new XmlUrlResolver()); + LoadXSL_Resolver(null, new XmlUrlResolver(), inputType, readerType); } catch (System.ArgumentException) { @@ -918,9 +996,20 @@ namespace System.Xml.Tests } //[Variation("Call Load with null XmlResolver, style sheet does not have include/import, should not error")] - [InlineData()] - [Theory] - public void LoadGeneric3() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -930,9 +1019,9 @@ namespace System.Xml.Tests 5.No Value Specified 6.No Value Specified</result>"; - if (LoadXSL_Resolver("showParam.xsl", null) == 1) + if (LoadXSL_Resolver("showParam.xsl", null, inputType, readerType) == 1) { - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -948,13 +1037,15 @@ namespace System.Xml.Tests } //[Variation("Call Load with null XmlResolver and style sheet has import/include, should fail")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric4() + public void LoadGeneric4(InputType inputType, ReaderType readerType) { try { - LoadXSL_Resolver("XmlResolver_Main.xsl", null); + LoadXSL_Resolver("XmlResolver_Main.xsl", null, inputType, readerType); } catch (System.Xml.Xsl.XsltCompileException e) { @@ -966,9 +1057,11 @@ namespace System.Xml.Tests } //[Variation("Call Load with null custom resolver and style sheet has import/include, should fail")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory(Skip = "By design bug #84957: Skip this test for Load(url, resolver)")] - public void LoadGeneric5() + public void LoadGeneric5(InputType inputType, ReaderType readerType) { // By design bug #84957: Skip this test for Load(url, resolver) //if (MyInputType() == InputType.URI) @@ -980,7 +1073,7 @@ namespace System.Xml.Tests CustomNullResolver myResolver = new CustomNullResolver(null); try { - LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver); + LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver, inputType, readerType); } catch (System.Xml.Xsl.XsltCompileException e) { @@ -992,9 +1085,20 @@ namespace System.Xml.Tests } //[Variation("Call Load with null custom resolver and style sheet has no import/include, should not error")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "By design bug #84957: Skip this test for Load(url, resolver)")] - public void LoadGeneric6() + public void LoadGeneric6(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // By design bug #84957: Skip this test for Load(url, resolver) @@ -1005,9 +1109,9 @@ namespace System.Xml.Tests //} CustomNullResolver myResolver = new CustomNullResolver(null); - if (LoadXSL_Resolver("showParam.xsl", myResolver) == 1) + if (LoadXSL_Resolver("showParam.xsl", myResolver, inputType, readerType) == 1) { - if ((Transform("fruits.xml") == 1) && (CheckResult(466.5112789241) == 1)) + if ((Transform("fruits.xml", transformType, docType) == 1) && (CheckResult(466.5112789241, transformType) == 1)) return; else Assert.True(false); @@ -1020,9 +1124,20 @@ namespace System.Xml.Tests } //[Variation("Style sheet has import/include, call Load first with custom null resolver and then default resolver, should not fail")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "By design bug #84957: Skip this test for Load(url, resolver)")] - public void LoadGeneric7() + public void LoadGeneric7(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // By design bug #84957: Skip this test for Load(url, resolver) @@ -1036,14 +1151,14 @@ namespace System.Xml.Tests try { - LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver); + LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver, inputType, readerType); } catch (System.Xml.Xsl.XsltCompileException e) { CheckExpectedError(e.InnerException, "System.Data.Sqlxml", "Xslt_CantResolve", new string[] { new Uri(FullFilePath("XmlResolver_Include.xsl", false)).ToString() }); - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1) { - if ((Transform("fruits.xml") == 1) && (CheckResult(428.8541842246) == 1)) + if ((Transform("fruits.xml", transformType, docType) == 1) && (CheckResult(428.8541842246, transformType) == 1)) return; else Assert.True(false); @@ -1058,9 +1173,20 @@ namespace System.Xml.Tests } //[Variation("Style sheet has import/include, call Load first with default resolver and then with custom null resolver, should fail")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "By design bug #84957: Skip this test for Load(url, resolver)")] - public void LoadGeneric8() + public void LoadGeneric8(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // By design bug #84957: Skip this test for Load(url, resolver) @@ -1072,11 +1198,11 @@ namespace System.Xml.Tests CustomNullResolver myResolver = new CustomNullResolver(null); - if ((LoadXSL("XmlResolver_Main.xsl") == 1)) + if ((LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1)) { try { - LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver); + LoadXSL_Resolver("XmlResolver_Main.xsl", myResolver, inputType, readerType); } catch (System.Xml.Xsl.XsltCompileException e) { @@ -1091,17 +1217,28 @@ namespace System.Xml.Tests } //[Variation("Load with resolver with credentials, then load XSL that does not need cred.")] - [InlineData()] - [Theory] - public void LoadGeneric9() - { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric9(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) + { + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; - if ((LoadXSL_Resolver("XmlResolver_Main.xsl", GetDefaultCredResolver()) == 1)) + if ((LoadXSL_Resolver("XmlResolver_Main.xsl", GetDefaultCredResolver(), inputType, readerType) == 1)) { - if ((LoadXSL("XmlResolver_Main.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1) && (Transform("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1116,9 +1253,20 @@ namespace System.Xml.Tests } //[Variation("Call Load() many times with null resolver then perform a transform")] - [InlineData()] - [Theory] - public void LoadGeneric10() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric10(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1130,13 +1278,13 @@ namespace System.Xml.Tests for (int i = 0; i < 100; i++) { - if (LoadXSL_Resolver("showParam.xsl", null) != 1) + if (LoadXSL_Resolver("showParam.xsl", null, inputType, readerType) != 1) { _output.WriteLine("Failed to load stylesheet showParam.xsl on the {0} attempt", i); Assert.True(false); } } - if ((LoadXSL_Resolver("showParam.xsl", null) == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL_Resolver("showParam.xsl", null, inputType, readerType) == 1) && (Transform("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1145,13 +1293,15 @@ namespace System.Xml.Tests } //[Variation("Call Load with null Resolver, file does not exist")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void LoadGeneric11() + public void LoadGeneric11(InputType inputType, ReaderType readerType) { try { - LoadXSL_Resolver("IDontExist.xsl", null); + LoadXSL_Resolver("IDontExist.xsl", null, inputType, readerType); } catch (System.IO.FileNotFoundException) { @@ -1162,22 +1312,33 @@ namespace System.Xml.Tests } //[Variation("Load non existing stylesheet with null resolver and try to transform")] - [InlineData()] - [Theory] - public void LoadGeneric12() - { - if (LoadXSL_Resolver("showParam.xsl", null) == 1) + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void LoadGeneric12(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) + { + if (LoadXSL_Resolver("showParam.xsl", null, inputType, readerType) == 1) { try { - LoadXSL_Resolver("IDontExist.xsl", null); + LoadXSL_Resolver("IDontExist.xsl", null, inputType, readerType); } catch (System.IO.FileNotFoundException) { //no stylesheet loaded, should throw error try { - Transform("fruits.xml"); + Transform("fruits.xml", transformType, docType); } catch (System.InvalidOperationException e2) { @@ -1213,16 +1374,19 @@ namespace System.Xml.Tests } //[Variation("Basic check for usage of credentials on resolver, load XSL that needs cred. with correct resolver")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void LoadUrlResolver1() + public void LoadUrlResolver1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out>Red50Orange25</out>"; // XsltResolverTestMain.xsl is placed in IIS virtual directory // which requires integrated Windows NT authentication - if ((LoadXSL_Resolver(("XmlResolver/XsltResolverTestMain.xsl"), GetDefaultCredResolver()) == 1) && - (Transform("fruits.xml") == 1)) + if ((LoadXSL_Resolver(("XmlResolver/XsltResolverTestMain.xsl"), GetDefaultCredResolver(), inputType, readerType) == 1) && + (Transform("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1232,13 +1396,13 @@ namespace System.Xml.Tests } //[Variation("Load XSL that needs cred. with null resolver, should fail")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrlResolver2() + public void LoadUrlResolver2(InputType inputType, ReaderType readerType) { try { - LoadXSL_Resolver(("XmlResolver/XsltResolverTestMain.xsl"), null); + LoadXSL_Resolver(("XmlResolver/XsltResolverTestMain.xsl"), null, inputType, readerType); } catch (System.Xml.Xsl.XsltException) { @@ -1250,52 +1414,13 @@ namespace System.Xml.Tests } //[Variation("Call Load with null source value")] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrlResolver3() + public void LoadUrlResolver3(InputType inputType, ReaderType readerType) { try { - LoadXSL_Resolver(null, new XmlUrlResolver()); - } - catch (System.ArgumentException) - { - // System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri) throws ArgumentException - return; - } - _output.WriteLine("Did not throw an exception for null argument!"); - Assert.True(false); - } - } - - /****************************************************************************************/ - /* XslTransform.Load(Reader/Navigator,XmlResolver,Evidence) - Integrity */ - /****************************************************************************************/ - - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Reader, Reader", Desc = "READER,READER")] - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Reader, Stream", Desc = "READER,STREAM")] - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Reader, Writer", Desc = "READER,WRITER")] - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Reader, TextWriter", Desc = "READER,TEXTWRITER")] - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Navigator, Reader", Desc = "NAVIGATOR,READER")] - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Navigator, Stream", Desc = "NAVIGATOR,STREAM")] - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Navigator, Writer", Desc = "NAVIGATOR,WRITER")] - //[TestCase(Name = "XsltTransform.Load(,XmlResolver,Evidence) : Navigator, TextWriter", Desc = "NAVIGATOR,TEXTWRITER")] - public class CLoadReaderResolverEvidenceTest : XsltApiTestCaseBase - { - private ITestOutputHelper _output; - public CLoadReaderResolverEvidenceTest(ITestOutputHelper output) : base(output) - { - _output = output; - } - - //[Variation("Call Load with null source value, null evidence")] - [InlineData()] - [Theory(Skip = "URI does not apply in this case, as Load(Url, Resolver) computes evidence from the Url")] - public void LoadGeneric1() - { - /*try - { - LoadXSL_Resolver_Evidence(null, new XmlUrlResolver(), null); + LoadXSL_Resolver(null, new XmlUrlResolver(), inputType, readerType); } catch (System.ArgumentException) { @@ -1303,50 +1428,7 @@ namespace System.Xml.Tests return; } _output.WriteLine("Did not throw an exception for null argument!"); - Assert.True(false);*/ - } - - //[Variation("Call Load with style sheet that has script, pass null evidence, should throw security exception")] - [InlineData()] - [Theory(Skip = "")] - public void LoadGeneric2() - { - /* - try - { - LoadXSL_Resolver_Evidence("scripting_unsafe_object.xsl", new XmlUrlResolver(), null); - } - catch(System.Security.Policy.PolicyException e) - { - _output.WriteLine(e.ToString()); - return; - } - _output.WriteLine("Did not throw a security exception for null evidence!"); Assert.True(false); - */ - //return TEST_SKIPPED; - } - - //[Variation("Call Load with style sheet that has script, pass correct evidence")] - [InlineData()] - [Theory(Skip = "Not InProc")] - public void LoadGeneric3() - { - //if (_isInProc) - // return TEST_SKIPPED; - - /*Evidence evidence = new Evidence(); - evidence.AddHost(new Zone(SecurityZone.MyComputer)); - try - { - LoadXSL_Resolver_Evidence("scripting_unsafe_object.xsl", new XmlUrlResolver(), evidence); - } - catch (System.Security.Policy.PolicyException) - { - _output.WriteLine("Should not throw a security exception for correct evidence!"); - Assert.True(false); - } - return;*/ } } @@ -1364,13 +1446,13 @@ namespace System.Xml.Tests } //[Variation("Call Load with an invalid uri")] - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl1() + public void LoadUrl1(ReaderType readerType) { try { - LoadXSL("IDontExist.xsl", InputType.URI); + LoadXSL("IDontExist.xsl", InputType.URI, readerType); } catch (System.IO.FileNotFoundException) { @@ -1381,13 +1463,13 @@ namespace System.Xml.Tests } //[Variation("Load file with empty string")] - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl2() + public void LoadUrl2(ReaderType readerType) { try { - LoadXSL(szEmpty, InputType.URI); + LoadXSL(szEmpty, InputType.URI, readerType); } catch (System.ArgumentException) { @@ -1399,13 +1481,13 @@ namespace System.Xml.Tests } //[Variation("Load with \".\"")] - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl3() + public void LoadUrl3(ReaderType readerType) { try { - LoadXSL(".", InputType.URI); + LoadXSL(".", InputType.URI, readerType); } catch (System.UnauthorizedAccessException) { @@ -1416,13 +1498,13 @@ namespace System.Xml.Tests } //[Variation("Load with \"..\"")] - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl() + public void LoadUrl(ReaderType readerType) { try { - LoadXSL("..", InputType.URI); + LoadXSL("..", InputType.URI, readerType); } catch (System.UnauthorizedAccessException) { @@ -1434,13 +1516,13 @@ namespace System.Xml.Tests //[Variation("Load with \"\\\\\"")] [PlatformSpecific(TestPlatforms.Windows)] //Not a valid path on Unix - [InlineData()] + [InlineData(ReaderType.XmlValidatingReader)] [Theory] - public void LoadUrl5() + public void LoadUrl5(ReaderType readerType) { try { - LoadXSL("\\\\", InputType.URI); + LoadXSL("\\\\", InputType.URI, readerType); } catch (System.ArgumentException) { @@ -1450,44 +1532,6 @@ namespace System.Xml.Tests _output.WriteLine("Exception not generated for non-existent file parameter name"); Assert.True(false); } - - /* - - //[Variation("Call Load with style sheet that has script, pass Url which does not have correct evidence, should fail")] - [InlineData()] - [Theory] - public void LoadUrl6() - { - try - { - LoadXSL_Resolver(FullHttpPath("XmlResolver/scripting_unsafe_object.xsl"), GetDefaultCredResolver()); - } - catch(System.Security.Policy.PolicyException) - { - return; - } - _output.WriteLine("Should throw a security exception for incorrect evidence!"); - Assert.True(false); - } - - //[Variation("Call Load with style sheet that has script, pass Url which has correct evidence, should pass")] - [InlineData()] - [Theory] - public void LoadUrl7() - { - try - { - LoadXSL("scripting_unsafe_object.xsl"); - } - catch(System.Security.Policy.PolicyException) - { - _output.WriteLine("Should not throw a security exception for correct evidence!"); - Assert.True(false); - } - return; - } - - */ } /***********************************************************/ @@ -1504,9 +1548,9 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test")] - [InlineData()] + [InlineData(TransformType.Stream, DocType.XPathDocument)] [Theory] - public void LoadNavigator1() + public void LoadNavigator1(TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1531,7 +1575,7 @@ namespace System.Xml.Tests xrLoad.Dispose(); xslt.Load(xdTemp); - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -1540,9 +1584,9 @@ namespace System.Xml.Tests } //[Variation("Create Navigator and navigate away from root")] - [InlineData()] + [InlineData(TransformType.Stream, DocType.XPathDocument)] [Theory] - public void LoadNavigator2() + public void LoadNavigator2(TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1563,7 +1607,7 @@ namespace System.Xml.Tests xP.MoveToNext(); xslt.Load(xP); - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -1572,9 +1616,9 @@ namespace System.Xml.Tests } //[Variation("Basic check for usage of credentials on resolver, load XSL that needs cred. with correct resolver")] - [InlineData()] + [InlineData(TransformType.Stream, DocType.XPathDocument)] [Theory] - public void LoadNavigator3() + public void LoadNavigator3(TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out>Red50Orange25</out>"; @@ -1588,7 +1632,7 @@ namespace System.Xml.Tests XPathNavigator xP = ((IXPathNavigable)xdTemp).CreateNavigator(); xslt.Load(xP, GetDefaultCredResolver()); - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -1598,9 +1642,9 @@ namespace System.Xml.Tests } //[Variation("Regression case for bug 80768")] - [InlineData()] + [InlineData(TransformType.Stream)] [Theory(Skip = "Not InProc")] - public void LoadNavigator4() + public void LoadNavigator4(TransformType transformType) { //if (_isInProc) // return TEST_SKIPPED; @@ -1619,7 +1663,7 @@ namespace System.Xml.Tests xslt.Transform(xn, null, fs); fs.Dispose(); - if (CheckResult(383.0855503831) == 1) + if (CheckResult(383.0855503831, transformType) == 1) return; else Assert.True(false); @@ -1640,9 +1684,9 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test")] - [InlineData()] + [InlineData(TransformType.Stream, DocType.XPathDocument)] [Theory] - public void LoadXmlReader1() + public void LoadXmlReader1(TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1675,7 +1719,7 @@ namespace System.Xml.Tests } if (fTEST_FAIL) Assert.True(false); - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -1838,9 +1882,9 @@ namespace System.Xml.Tests } //[Variation("Basic check for usage of credentials on resolver, load XSL that needs cred. with correct resolver")] - [InlineData()] + [InlineData(TransformType.Stream, DocType.XPathDocument)] [Theory] - public void LoadXmlReader7() + public void LoadXmlReader7(TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out>Red50Orange25</out>"; @@ -1852,7 +1896,7 @@ namespace System.Xml.Tests xslt.Load(xrLoad, GetDefaultCredResolver()); xrLoad.Dispose(); - if (Transform("fruits.xml") == 1) + if (Transform("fruits.xml", transformType, docType) == 1) { VerifyResult(expected); return; @@ -1887,9 +1931,20 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test")] - [InlineData()] - [Theory] - public void TransformGeneric1() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void TransformGeneric1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1899,7 +1954,7 @@ namespace System.Xml.Tests 5.No Value Specified 6.No Value Specified</result>"; - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -1909,9 +1964,20 @@ namespace System.Xml.Tests } //[Variation("Load and Transform multiple times")] - [InlineData()] - [Theory] - public void TransformGeneric2() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void TransformGeneric2(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1923,7 +1989,7 @@ namespace System.Xml.Tests for (int i = 0; i < 5; i++) { - if ((LoadXSL("showParam.xsl") != 1) || (Transform("fruits.xml") != 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) != 1) || (Transform("fruits.xml", transformType, docType) != 1)) Assert.True(false); VerifyResult(expected); } @@ -1931,9 +1997,20 @@ namespace System.Xml.Tests } //[Variation("Load once, Transform many times")] - [InlineData()] - [Theory] - public void TransformGeneric3() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void TransformGeneric3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -1943,11 +2020,11 @@ namespace System.Xml.Tests 5.No Value Specified 6.No Value Specified</result>"; - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { for (int i = 0; i < 100; i++) { - if (Transform("fruits.xml") != 1) + if (Transform("fruits.xml", transformType, docType) != 1) { _output.WriteLine("Test failed to transform after {0} iterations", i); Assert.True(false); @@ -1960,16 +2037,27 @@ namespace System.Xml.Tests } //[Variation("Call Transform without loading")] - [InlineData()] - [Theory] - public void TransformGeneric4() + [InlineData(TransformType.Reader, DocType.XPathDocument)] + [InlineData(TransformType.Stream, DocType.XPathDocument)] + [InlineData(TransformType.Writer, DocType.XPathDocument)] + [InlineData(TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(TransformType.Reader, DocType.XPathDocument)] + [InlineData(TransformType.Writer, DocType.XPathDocument)] + [InlineData(TransformType.Stream, DocType.XPathDocument)] + [InlineData(TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(TransformType.Reader, DocType.XPathDocument)] + [InlineData(TransformType.Writer, DocType.XPathDocument)] + [InlineData(TransformType.Stream, DocType.XPathDocument)] + [InlineData(TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void TransformGeneric4(TransformType transformType, DocType docType) { #pragma warning disable 0618 xslt = new XslTransform(); #pragma warning restore 0618 try { - Transform("fruits.xml"); + Transform("fruits.xml", transformType, docType); } catch (System.InvalidOperationException e) { @@ -1981,13 +2069,24 @@ namespace System.Xml.Tests } //[Variation("Closing XSL and XML files used in transform, Read access")] - [InlineData()] - [Theory] - public void TransformGeneric5() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void TransformGeneric5(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { FileStream s2; - if ((LoadXSL("showParam.xsl") == 1) && (Transform("fruits.xml") == 1)) + if ((LoadXSL("showParam.xsl", inputType, readerType) == 1) && (Transform("fruits.xml", transformType, docType) == 1)) { s2 = new FileStream(FullFilePath("showParam.xsl"), FileMode.Open, FileAccess.Read); s2.Dispose(); @@ -2001,38 +2100,26 @@ namespace System.Xml.Tests Assert.True(false); } - /* - //[Variation("Closing XSL and XML files used in transform, ReadWrite access")] - [InlineData()] - [Theory] - public void TransformGeneric6() - { - FileStream s2; - - if((LoadXSL("showParam.xsl") == TEST_PASS) && (Transform("fruits.xml") == TEST_PASS)) - { - s2 = new FileStream(FullFilePath("showParam.xsl"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - - s2 = new FileStream(FullFilePath("fruits.xml"), FileMode.Open, FileAccess.ReadWrite); - s2.Dispose(); - - return; - } - _output.WriteLine("Encountered errors performing transform and could not verify if files were closed"); - Assert.True(false); - } - */ - //[Variation("Bug358103 - ArgumentOutOfRangeException in forwards-compatible mode for <foo bar='{+1}'/>")] - [InlineData()] - [Theory] - public void TransformGeneric7() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void TransformGeneric7(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { try { - LoadXSL("ForwardComp2.xsl"); - Transform("data.xml", true); + LoadXSL("ForwardComp2.xsl", inputType, readerType); + Transform("data.xml", true, transformType, docType); } catch (XsltException) { @@ -2070,19 +2157,30 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver, load style sheet with import/include, should not affect transform")] - [InlineData()] - [Theory] - public void XmlResolver1() - { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void XmlResolver1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) + { + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; try { - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1) { - if (TransformResolver("fruits.xml", null) == 1) + if (TransformResolver("fruits.xml", transformType, docType, null) == 1) { VerifyResult(expected); return; @@ -2100,18 +2198,29 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver, load style sheet with document function, should not resolve during transform")] - [InlineData()] - [Theory] - public void XmlResolver2() + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [Theory] + public void XmlResolver2(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result></result>"; // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", inputType, readerType) == 1) { - if (TransformResolver("fruits.xml", null) == 1) + if (TransformResolver("fruits.xml", transformType, docType, null) == 1) { VerifyResult(expected); return; @@ -2126,9 +2235,20 @@ namespace System.Xml.Tests } //[Variation("Default XmlResolver, load style sheet with document function, should resolve during transform")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "SQLBU Defect Tracking Bug 430834: Skipping when input type is URI, see bug for more details.")] - public void XmlResolver3() + public void XmlResolver3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> @@ -2137,9 +2257,9 @@ namespace System.Xml.Tests //if (MyInputType() == InputType.URI) // return TEST_SKIPPED; - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", inputType, readerType) == 1) { - if ((Transform("fruits.xml") == 1) && (CheckResult(377.8217373898) == 1)) + if ((Transform("fruits.xml", transformType, docType) == 1) && (CheckResult(377.8217373898, transformType) == 1)) return; } else @@ -2151,10 +2271,20 @@ namespace System.Xml.Tests } //[Variation("document() has absolute URI")] - [ActiveIssue(14071)] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Reader, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Writer, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "When style sheet URI = Intranet zone, XmlSecureResolver does not resolve document function")] - public void XmlResolver5() + public void XmlResolver5(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // Skip this test for Load(URI) // Reason: When style sheet URI = Intranet zone, XmlSecureResolver does not resolve document function @@ -2166,12 +2296,13 @@ namespace System.Xml.Tests try { - if (!Directory.Exists("c:\\temp")) + string tempDir = Path.GetTempPath(); + if (!Directory.Exists(tempDir)) { - Directory.CreateDirectory("c:\\temp"); + Directory.CreateDirectory(tempDir); } string xmlFile = FullFilePath("xmlResolver_document_function.xml"); - File.Copy(xmlFile, @"c:\temp\xmlResolver_document_function.xml", true); + File.Copy(xmlFile, Path.Combine(tempDir, "xmlResolver_document_function.xml"), true); } catch (Exception e) { @@ -2180,9 +2311,9 @@ namespace System.Xml.Tests return; //return TEST_SKIPPED; } - if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl") == 1) + if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl", inputType, readerType) == 1) { - if ((TransformResolver("fruits.xml", new XmlUrlResolver()) == 1) && (CheckResult(377.8217373898) == 1)) + if ((TransformResolver("fruits.xml", transformType, docType, new XmlUrlResolver()) == 1) && (CheckResult(377.8217373898, transformType) == 1)) return; else { @@ -2214,9 +2345,11 @@ namespace System.Xml.Tests } //[Variation("Basic Verification Test")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr1() + public void TransformStrStr1(InputType inputType, ReaderType readerType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -2228,7 +2361,7 @@ namespace System.Xml.Tests String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { CallTransform(xslt, szFullFilename, _strOutFile); VerifyResult(expected); @@ -2238,11 +2371,13 @@ namespace System.Xml.Tests } //[Variation("Input is null")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr2() + public void TransformStrStr2(InputType inputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2256,13 +2391,15 @@ namespace System.Xml.Tests } //[Variation("Output file is null")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr3() + public void TransformStrStr3(InputType inputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2278,11 +2415,13 @@ namespace System.Xml.Tests } //[Variation("Input is nonexisting file")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr4() + public void TransformStrStr4(InputType inputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2299,13 +2438,15 @@ namespace System.Xml.Tests //[Variation("Output file is invalid")] [PlatformSpecific(TestPlatforms.Windows)] //Output file name is valid on Unix - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr5() + public void TransformStrStr5(InputType inputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2321,11 +2462,13 @@ namespace System.Xml.Tests } //[Variation("Input is empty string")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr6() + public void TransformStrStr6(InputType inputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2341,13 +2484,15 @@ namespace System.Xml.Tests } //[Variation("Output file is empty string")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr7() + public void TransformStrStr7(InputType inputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2363,9 +2508,11 @@ namespace System.Xml.Tests } //[Variation("Call Transform many times")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr8() + public void TransformStrStr8(InputType inputType, ReaderType readerType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result> 1.No Value Specified @@ -2379,7 +2526,7 @@ namespace System.Xml.Tests for (int i = 0; i < 50; i++) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { CallTransform(xslt, szFullFilename, _strOutFile); try @@ -2418,11 +2565,13 @@ namespace System.Xml.Tests } //[Variation("Output to unreachable destination")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr10() + public void TransformStrStr10(InputType inputType, ReaderType readerType) { - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2439,12 +2588,14 @@ namespace System.Xml.Tests } //[Variation("Input filename is \'.\', \'..\', and \'\\\\\'")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr11() + public void TransformStrStr11(InputType inputType, ReaderType readerType) { int iCount = 0; - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2482,13 +2633,15 @@ namespace System.Xml.Tests } //[Variation("Output filename is \'.\' and \'..\')] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr12() + public void TransformStrStr12(InputType inputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); int iCount = 0; - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { try { @@ -2518,13 +2671,15 @@ namespace System.Xml.Tests //[Variation("Output filename is \'\\\\\'")] [PlatformSpecific(TestPlatforms.Windows)] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr12_win() + public void TransformStrStr12_win(InputType inputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { Assert.Throws<System.ArgumentException>(() => xslt.Transform(szFullFilename, "\\\\")); return; @@ -2535,14 +2690,16 @@ namespace System.Xml.Tests } //[Variation("Closing files after transform")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStr13() + public void TransformStrStr13(InputType inputType, ReaderType readerType) { String szFullFilename = FullFilePath("fruits.xml"); Stream strmTemp; - if (LoadXSL("showParam.xsl") == 1) + if (LoadXSL("showParam.xsl", inputType, readerType) == 1) { CallTransform(xslt, szFullFilename, _strOutFile); @@ -2562,29 +2719,6 @@ namespace System.Xml.Tests } Assert.True(false); } - - /* - //[Variation("Transform(test.xml, test.xml)")] - [InlineData()] - [Theory] - public void TransformStrStr14() - { - String szFullFilename = FullFilePath("Bug75295.xml"); - - // Copy this file to current directory - File.Delete("out.xml"); - File.Copy(szFullFilename, "out.xml"); - - if(LoadXSL("Bug75295.xsl") == TEST_PASS) - { - xslt.Transform("out.xml", "out.xml"); - - if (CheckResult(270.5223692973) == TEST_PASS) - return; - } - Assert.True(false); - } - */ } /***********************************************************/ @@ -2603,18 +2737,20 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver, load style sheet with import/include, should not affect transform")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStrResolver1() + public void TransformStrStrResolver1(InputType inputType, ReaderType readerType) { - AppContext.SetSwitch("Switch.System.Xml.DontProhibitDefaultResolver", true); + AppContext.SetSwitch("Switch.System.Xml.AllowDefaultResolver", true); string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result><fruit>Apple</fruit><fruit>orange</fruit></result>"; String szFullFilename = FullFilePath("fruits.xml"); try { - if (LoadXSL("XmlResolver_Main.xsl") == 1) + if (LoadXSL("XmlResolver_Main.xsl", inputType, readerType) == 1) { CallTransform(xslt, szFullFilename, "out.xml", null); VerifyResult(expected); @@ -2630,16 +2766,18 @@ namespace System.Xml.Tests } //[Variation("Pass null XmlResolver, load style sheet with document function, should not resolve during transform")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader)] [Theory] - public void TransformStrStrResolver2() + public void TransformStrStrResolver2(InputType inputType, ReaderType readerType) { // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><result></result>"; String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", inputType, readerType) == 1) { CallTransform(xslt, szFullFilename, "out.xml", null); VerifyResult(expected); @@ -2654,9 +2792,11 @@ namespace System.Xml.Tests } //[Variation("Pass XmlUrlResolver, load style sheet with document function, should resolve during transform")] - [InlineData()] + [InlineData(InputType.Reader, ReaderType.XmlValidatingReader, TransformType.Stream)] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.Stream)] [Theory(Skip = "SQLBU Defect Tracking Bug 430834: Skipping when input type is URI, see bug for more details.")] - public void TransformStrStrResolver3() + public void TransformStrStrResolver3(InputType inputType, ReaderType readerType, TransformType transformType) { // "xmlResolver_document_function.xsl" contains // <xsl:for-each select="document('xmlResolver_document_function.xml')//elem"> @@ -2667,10 +2807,10 @@ namespace System.Xml.Tests String szFullFilename = FullFilePath("fruits.xml"); - if (LoadXSL("xmlResolver_document_function.xsl") == 1) + if (LoadXSL("xmlResolver_document_function.xsl", inputType, readerType) == 1) { CallTransform(xslt, szFullFilename, "out.xml", new XmlUrlResolver()); - if (CheckResult(377.8217373898) == 1) + if (CheckResult(377.8217373898, transformType) == 1) return; } else @@ -2694,9 +2834,10 @@ namespace System.Xml.Tests } //[Variation("Local parameter gets overwritten with global param value", Pri = 1)] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void var1() + public void var1(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out> param1 (correct answer is 'local-param1-arg'): local-param1-arg @@ -2706,7 +2847,7 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", string.Empty, "global-param1-arg"); - if ((LoadXSL("paramScope.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("paramScope.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2716,9 +2857,10 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg } //[Variation("Local parameter gets overwritten with global variable value", Pri = 1)] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void var2() + public void var2(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?><out> param1 (correct answer is 'local-param1-arg'): local-param1-arg @@ -2728,7 +2870,7 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg m_xsltArg = new XsltArgumentList(); m_xsltArg.AddParam("param1", string.Empty, "global-param1-arg"); - if ((LoadXSL("varScope.xsl") == 1) && (Transform_ArgList("fruits.xml") == 1)) + if ((LoadXSL("varScope.xsl", inputType, readerType) == 1) && (Transform_ArgList("fruits.xml", transformType, docType) == 1)) { VerifyResult(expected); return; @@ -2738,9 +2880,10 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg } //[Variation("Subclassed XPathNodeIterator returned from an extension object or XsltFunction is not accepted by XPath", Pri = 1)] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory(Skip = "SQLBU Defect Tracking Bug 430834: Skipping when input type is URI, see bug for more details.")] - public void var3() + public void var3(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { // SQLBU Defect Tracking Bug 430834: Skipping when input type is URI, see bug for more details. //if (MyInputType() == InputType.URI) @@ -2749,16 +2892,17 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg m_xsltArg = new XsltArgumentList(); m_xsltArg.AddExtensionObject("http://foo.com", new MyXsltExtension()); - if ((LoadXSL("Bug111075.xsl") == 1) && (Transform_ArgList("Bug111075.xml") == 1) && (CheckResult(444.7202431861) == 1)) + if ((LoadXSL("Bug111075.xsl", inputType, readerType) == 1) && (Transform_ArgList("Bug111075.xml", transformType, docType) == 1) && (CheckResult(444.7202431861, transformType) == 1)) return; else Assert.True(false); } //[Variation("Iterator using for-each over a variable is not reset correctly while using msxsl:node-set()", Pri = 1)] - [InlineData()] + [InlineData(InputType.URI, ReaderType.XmlValidatingReader, TransformType.Stream, DocType.XPathDocument)] + [InlineData(InputType.Navigator, ReaderType.XmlValidatingReader, TransformType.TextWriter, DocType.XPathDocument)] [Theory] - public void var4() + public void var4(InputType inputType, ReaderType readerType, TransformType transformType, DocType docType) { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> Node Count: {3} @@ -2767,7 +2911,7 @@ param2 (correct answer is 'local-param2-arg'): local-param2-arg Correct Output: (1)(2)(3) Incorrect Output: [1][2][3]"; - if ((LoadXSL("Bug109644.xsl") == 1) && (Transform("foo.xml") == 1)) + if ((LoadXSL("Bug109644.xsl", inputType, readerType) == 1) && (Transform("foo.xml", transformType, docType) == 1)) { Assert.Equal(expected, File.ReadAllText("out.xml")); return; diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs index af2869b75d..bc0b366b82 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs @@ -4,9 +4,7 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; using XmlCoreTest.Common; @@ -37,7 +35,7 @@ namespace System.Xml.Tests #pragma warning disable 0618 xsltSameInstance = new XslTransform(); #pragma warning restore 0618 - _strPath = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltApi\"); + _strPath = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "XsltApi"); return; } @@ -113,13 +111,13 @@ namespace System.Xml.Tests public override void Load(string _strXslFile, string _strXmlFile) { #pragma warning disable 0618 - XmlValidatingReader xrData = new XmlValidatingReader(new XmlTextReader(_strPath + _strXmlFile)); + XmlValidatingReader xrData = new XmlValidatingReader(new XmlTextReader(Path.Combine(_strPath, _strXmlFile))); #pragma warning restore 0618 _xd = new XPathDocument(xrData, XmlSpace.Preserve); xrData.Dispose(); #pragma warning disable 0618 - XmlValidatingReader xrTemp = new XmlValidatingReader(new XmlTextReader(_strPath + _strXslFile)); + XmlValidatingReader xrTemp = new XmlValidatingReader(new XmlTextReader(Path.Combine(_strPath, _strXslFile))); #pragma warning restore 0618 xrTemp.ValidationType = ValidationType.None; xrTemp.EntityHandling = EntityHandling.ExpandEntities; @@ -153,13 +151,13 @@ namespace System.Xml.Tests public override void Load(string _strXslFile, string _strXmlFile) { #pragma warning disable 0618 - XmlValidatingReader xrData = new XmlValidatingReader(new XmlTextReader(_strPath + _strXmlFile)); + XmlValidatingReader xrData = new XmlValidatingReader(new XmlTextReader(Path.Combine(_strPath, _strXmlFile))); #pragma warning restore 0618 _xd = new XPathDocument(xrData, XmlSpace.Preserve); xrData.Dispose(); #pragma warning disable 0618 - XmlValidatingReader xrTemp = new XmlValidatingReader(new XmlTextReader(_strPath + _strXslFile)); + XmlValidatingReader xrTemp = new XmlValidatingReader(new XmlTextReader(Path.Combine(_strPath, _strXslFile))); xrTemp.ValidationType = ValidationType.None; xrTemp.EntityHandling = EntityHandling.ExpandEntities; xsltSameInstance.Load(xrTemp); diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs index e606815d90..57e1f1e5bf 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs @@ -249,9 +249,9 @@ namespace System.Xml.Tests string _strXmlFile = ((object[])args)[2].ToString(); if (_strXslFile.Substring(0, 5) != "http:") - _strXslFile = _strPath + _strXslFile; + _strXslFile = Path.Combine(_strPath, _strXslFile); if (_strXmlFile.Substring(0, 5) != "http:") - _strXmlFile = _strPath + _strXmlFile; + _strXmlFile = Path.Combine(_strPath, _strXmlFile); #pragma warning disable 0618 XmlValidatingReader xrData = new XmlValidatingReader(new XmlTextReader(_strXmlFile)); diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltChecksum.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltChecksum.cs index 68a1f9fa08..a76e0f431c 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltChecksum.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltChecksum.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Xunit; using Xunit.Abstractions; using System; using System.Globalization; diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/DataHelper.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/DataHelper.cs index 90a973cc54..ab84a3b8f4 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/DataHelper.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/DataHelper.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Xunit; using Xunit.Abstractions; using System; using System.Globalization; diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/ExceptionVerifier.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/ExceptionVerifier.cs index f5730d0526..cfff436861 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/ExceptionVerifier.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/ExceptionVerifier.cs @@ -3,16 +3,13 @@ // See the LICENSE file in the project root for more information. using System.Linq; -using Xunit; using Xunit.Abstractions; -using System; using System.Collections; using System.Globalization; using System.IO; using System.Reflection; using System.Resources; using System.Text.RegularExpressions; -using System.Xml; namespace System.Xml.Tests { @@ -113,16 +110,9 @@ namespace System.Xml.Tests _asm = dom.GetType().GetTypeInfo().Assembly; } break; - //case "SYSTEM.DATA": - //{ - // var ds = new DataSet(); - // asm = ds.GetType().Assembly; - //} - // break; default: - throw new FileLoadException("Cannot load assembly from " + GetRuntimeInstallDir() + assemblyName + ".dll"); - //asm = Assembly.LoadFrom(GetRuntimeInstallDir() + assemblyName + ".dll"); - //break; + _asm = Assembly.LoadFrom(GetRuntimeInstallDir() + assemblyName + ".dll"); + break; } if (_asm == null) @@ -186,7 +176,6 @@ namespace System.Xml.Tests } resReader.Dispose(); } - //break; } } @@ -220,8 +209,7 @@ namespace System.Xml.Tests "\n===== Original Exception Message =====\n" + _ex.Message + "\n===== Resource Id =====\n" + fInfo.GetValue(_ex) + "\n===== HelpLink =====\n" + _ex.HelpLink + - "\n===== Source =====\n" + _ex.Source /*+ - "\n===== TargetSite =====\n" + ex.TargetSite + "\n"*/); + "\n===== Source =====\n" + _ex.Source); _output.WriteLine( "\n===== InnerException =====\n" + _ex.InnerException + diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/MyNavigator.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/MyNavigator.cs index 997ad1fb0e..bc3d365c64 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/MyNavigator.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/MyNavigator.cs @@ -172,7 +172,6 @@ public class MyNavigator : XPathNavigator //[PermissionSetAttribute(SecurityAction.Deny, Name = "FullTrust")] public override XPathExpression Compile(string xpath) { - //XPathDocument xn = new XPathDocument(_strFileName); if (xpath.IndexOf("custom", 0, xpath.Length) >= 0) xpath = "custom:dangerous()"; diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/Program.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/Program.cs deleted file mode 100644 index 8252e1c5a2..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using ModuleCore; - -namespace XslCompiledTransformTests -{ - internal class Program - { - public static int Main() - { - var args = @"DocType:XmlDocument trace:false Host:None"; - return 100 + TestRunner.Execute(args); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs index 50c31cd05e..c26bf1bbf1 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/XSLTransform.cs @@ -4,11 +4,8 @@ using Xunit; using Xunit.Abstractions; -using System; using System.IO; -using System.Net; using System.Text; -using System.Xml; using System.Xml.XmlDiff; using System.Xml.XPath; using System.Xml.Xsl; @@ -66,11 +63,7 @@ namespace System.Xml.Tests private string _strPath; // Path of the data files private string _httpPath; // HTTP Path of the data files - private InputType _nInput; // reader, url, or navigator private bool _fTrace; // Should we write out the results of the transform? - private TransformType _nTransform; // Type of XSL Transform to do - private DocType _docType; // Data document type - private ReaderType _readerType; // Reader type // Other global variables protected string _strOutFile = "out.xml"; // File to create when using write transforms @@ -93,26 +86,6 @@ namespace System.Xml.Tests this.Init(null); } - public InputType MyInputType() - { - return _nInput; - } - - public TransformType MyTransformType() - { - return _nTransform; - } - - public DocType MyDocType() - { - return _docType; - } - - public ReaderType MyReaderType() - { - return _readerType; - } - public TransformType GetTransformType(String s) { if (s.EndsWith(",READER")) @@ -134,7 +107,6 @@ namespace System.Xml.Tests public XmlUrlResolver GetDefaultCredResolver() { XmlUrlResolver myDefaultCredResolver = new XmlUrlResolver(); - //myDefaultCredResolver.Credentials = CredentialCache.DefaultCredentials; return myDefaultCredResolver; } @@ -190,21 +162,10 @@ namespace System.Xml.Tests } } - public String InitStringValue(String str) - { - return String.Empty; - } - public void Init(object objParam) { - // Get input and transform type from attribute - _nInput = GetInputType(String.Empty); - _nTransform = GetTransformType(String.Empty); - // Get parameter info from runtime variables passed to LTM - _fTrace = (InitStringValue("trace").ToUpper() == "TRUE"); - _docType = GetDocType(InitStringValue("doctype")); - _readerType = GetReaderType(InitStringValue("readertype")); + _fTrace = false; // FullFilePath and FullHttpPath attempt to normalize file paths, however // as an extra step we can normalize them here, when they are first read @@ -299,12 +260,7 @@ namespace System.Xml.Tests // -------------------------------------------------------------------------------------------------------------- // LoadXSL // ------------------------------------------------------------------------------------------------------------- - public int LoadXSL(String _strXslFile) - { - return LoadXSL(_strXslFile, _nInput); - } - - public int LoadXSL(String _strXslFile, InputType inputType) + public int LoadXSL(string _strXslFile, InputType inputType, ReaderType readerType) { _strXslFile = FullFilePath(_strXslFile); #pragma warning disable 0618 @@ -319,7 +275,7 @@ namespace System.Xml.Tests break; case InputType.Reader: - switch (_readerType) + switch (readerType) { case ReaderType.XmlTextReader: XmlTextReader trTemp = new XmlTextReader(_strXslFile); @@ -401,14 +357,14 @@ namespace System.Xml.Tests // -------------------------------------------------------------------------------------------------------------- // LoadXSL_Resolver // ------------------------------------------------------------------------------------------------------------- - public int LoadXSL_Resolver(String _strXslFile, XmlResolver xr) + public int LoadXSL_Resolver(string _strXslFile, XmlResolver xr, InputType inputType, ReaderType readerType) { _strXslFile = FullFilePath(_strXslFile); #pragma warning disable 0618 xslt = new XslTransform(); #pragma warning restore 0618 - switch (_nInput) + switch (inputType) { case InputType.URI: _output.WriteLine("Loading style sheet as URI {0}", _strXslFile); @@ -416,7 +372,7 @@ namespace System.Xml.Tests break; case InputType.Reader: - switch (_readerType) + switch (readerType) { case ReaderType.XmlTextReader: XmlTextReader trTemp = new XmlTextReader(_strXslFile); @@ -494,97 +450,6 @@ namespace System.Xml.Tests return 1; } - // -------------------------------------------------------------------------------------------------------------- - // LoadXSL_Resolver_Evidence - // ------------------------------------------------------------------------------------------------------------- - /*public int LoadXSL_Resolver_Evidence(String _strXslFile, XmlResolver xr, Evidence e) - { - _strXslFile = FullFilePath(_strXslFile); -#pragma warning disable 0618 - xslt = new XslTransform(); -#pragma warning restore 0618 - - switch (_nInput) - { - case InputType.Reader: - switch (_readerType) - { - case ReaderType.XmlTextReader: - XmlTextReader trTemp = new XmlTextReader(_strXslFile); - try - { - _output.WriteLine("Loading style sheet as XmlTextReader {0}", _strXslFile); - xslt.Load(trTemp, xr, e); - } - catch (Exception ex) - { - throw (ex); - } - finally - { - if (trTemp != null) - trTemp.Dispose(); - } - break; - - case ReaderType.XmlNodeReader: - XmlDocument docTemp = new XmlDocument(); - docTemp.Load(_strXslFile); - XmlNodeReader nrTemp = new XmlNodeReader(docTemp); - try - { - _output.WriteLine("Loading style sheet as XmlNodeReader {0}", _strXslFile); - xslt.Load(nrTemp, xr, e); - } - catch (Exception ex) - { - throw (ex); - } - finally - { - if (nrTemp != null) - nrTemp.Dispose(); - } - break; - - case ReaderType.XmlValidatingReader: - default: -#pragma warning disable 0618 - XmlValidatingReader vrTemp = new XmlValidatingReader(new XmlTextReader(_strXslFile)); -#pragma warning restore 0618 - vrTemp.ValidationType = ValidationType.None; - vrTemp.EntityHandling = EntityHandling.ExpandEntities; - try - { - _output.WriteLine("Loading style sheet as XmlValidatingReader {0}", _strXslFile); - xslt.Load(vrTemp, xr, e); - } - catch (Exception ex) - { - throw (ex); - } - finally - { - if (vrTemp != null) - vrTemp.Dispose(); - } - break; - } - break; - - case InputType.Navigator: -#pragma warning disable 0618 - XmlValidatingReader xrLoad = new XmlValidatingReader(new XmlTextReader(_strXslFile)); -#pragma warning restore 0618 - XPathDocument xdTemp = new XPathDocument(xrLoad, XmlSpace.Preserve); - xrLoad.Dispose(); - _output.WriteLine("Loading style sheet as Navigator {0}", _strXslFile); - xslt.Load(xdTemp.CreateNavigator(), xr, e); - break; - } - return 1; - }*/ - //VerifyResult public void VerifyResult(string expectedValue) { @@ -636,28 +501,35 @@ namespace System.Xml.Tests } #pragma warning restore 0618 - public int Transform(String szXmlFile) + public int Transform(string szXmlFile, TransformType transformType, DocType docType) { // Default value of errorCase is false - return Transform(szXmlFile, false); + return Transform(szXmlFile, false, transformType, docType); } - public int Transform(String szXmlFile, bool errorCase) + public int Transform(string szXmlFile, bool errorCase, TransformType transformType, DocType docType) { lock (s_outFileMemoryLock) { szXmlFile = FullFilePath(szXmlFile); _output.WriteLine("Loading XML {0}", szXmlFile); - IXPathNavigable xd = LoadXML(szXmlFile, _docType); + IXPathNavigable xd = LoadXML(szXmlFile, docType); _output.WriteLine("Executing transform"); xrXSLT = null; Stream strmTemp = null; - switch (_nTransform) + switch (transformType) { case TransformType.Reader: xrXSLT = xslt.Transform(xd, null); + + using (FileStream outFile = new FileStream(_strOutFile, FileMode.Create, FileAccess.ReadWrite)) + using (XmlWriter writer = XmlWriter.Create(outFile)) + { + writer.WriteNode(xrXSLT, true); + } + if (errorCase) { try @@ -726,11 +598,6 @@ namespace System.Xml.Tests { throw (ex); } - finally - { - if (tw != null) - tw.Dispose(); - } break; } return 1; @@ -741,28 +608,35 @@ namespace System.Xml.Tests // Transform_ArgList // ------------------------------------------------------------------------------------------------------------- - public int Transform_ArgList(String szXmlFile) + public int Transform_ArgList(string szXmlFile, TransformType transformType, DocType docType) { // Default value of errorCase is false - return Transform_ArgList(szXmlFile, false); + return Transform_ArgList(szXmlFile, false, transformType, docType); } - public int Transform_ArgList(String szXmlFile, bool errorCase) + public int Transform_ArgList(string szXmlFile, bool errorCase, TransformType transformType, DocType docType) { lock (s_outFileMemoryLock) { szXmlFile = FullFilePath(szXmlFile); _output.WriteLine("Loading XML {0}", szXmlFile); - IXPathNavigable xd = LoadXML(szXmlFile, _docType); + IXPathNavigable xd = LoadXML(szXmlFile, docType); _output.WriteLine("Executing transform"); xrXSLT = null; Stream strmTemp = null; - switch (_nTransform) + switch (transformType) { case TransformType.Reader: xrXSLT = xslt.Transform(xd, m_xsltArg); + + using (FileStream outFile = new FileStream(_strOutFile, FileMode.Create, FileAccess.ReadWrite)) + using (XmlWriter writer = XmlWriter.Create(outFile)) + { + writer.WriteNode(xrXSLT, true); + } + if (errorCase) { try @@ -831,13 +705,6 @@ namespace System.Xml.Tests { throw (ex); } - finally - { - if (tw != null) - { - tw.Dispose(); - } - } break; } return 1; @@ -848,29 +715,36 @@ namespace System.Xml.Tests // TransformResolver // ------------------------------------------------------------------------------------------------------------- - public int TransformResolver(String szXmlFile, XmlResolver xr) + public int TransformResolver(string szXmlFile, TransformType transformType, DocType docType, XmlResolver xr) { // Default value of errorCase is false - return TransformResolver(szXmlFile, xr, false); + return TransformResolver(szXmlFile, xr, false, transformType, docType); } - public int TransformResolver(String szXmlFile, XmlResolver xr, bool errorCase) + public int TransformResolver(string szXmlFile, XmlResolver xr, bool errorCase, TransformType transformType, DocType docType) { lock (s_outFileMemoryLock) { szXmlFile = FullFilePath(szXmlFile); _output.WriteLine("Loading XML {0}", szXmlFile); - IXPathNavigable xd = LoadXML(szXmlFile, _docType); + IXPathNavigable xd = LoadXML(szXmlFile, docType); _output.WriteLine("Executing transform"); xrXSLT = null; Stream strmTemp = null; - switch (_nTransform) + switch (transformType) { case TransformType.Reader: xrXSLT = xslt.Transform(xd, null, xr); + + using (FileStream outFile = new FileStream(_strOutFile, FileMode.Create, FileAccess.ReadWrite)) + using (XmlWriter writer = XmlWriter.Create(outFile)) + { + writer.WriteNode(xrXSLT, true); + } + if (errorCase) { try @@ -939,11 +813,6 @@ namespace System.Xml.Tests { throw (ex); } - finally - { - if (tw != null) - tw.Dispose(); - } break; } return 1; @@ -953,14 +822,14 @@ namespace System.Xml.Tests // -------------------------------------------------------------------------------------------------------------- // CheckResult // ------------------------------------------------------------------------------------------------------------- - public int CheckResult(double szExpResult) + public int CheckResult(double szExpResult, TransformType transformType) { lock (s_outFileMemoryLock) { double checksumActual; CXsltChecksum check = new CXsltChecksum(_fTrace, _output); - if (_nTransform == TransformType.Reader) + if (transformType == TransformType.Reader) checksumActual = check.Calc(xrXSLT); else checksumActual = check.Calc(_strOutFile); diff --git a/src/System.Private.Xml/tests/Xslt/XslTransformApi/cthread.cs b/src/System.Private.Xml/tests/Xslt/XslTransformApi/cthread.cs index bf7008e279..f7760cc601 100644 --- a/src/System.Private.Xml/tests/Xslt/XslTransformApi/cthread.cs +++ b/src/System.Private.Xml/tests/Xslt/XslTransformApi/cthread.cs @@ -4,7 +4,6 @@ //ArrayList -using System; using System.Reflection; using System.Threading; using Xunit; @@ -128,7 +127,6 @@ namespace System.Xml.Tests public virtual void Abort() { - //Internal.Abort(); throw new NotImplementedException(); } @@ -174,9 +172,6 @@ namespace System.Xml.Tests //case TEST_SKIPPED: _output.WriteLine(eTest.Message); return eResult; //were done - - //case TEST_WARNING: - // break; }; } diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/ApiTests/XsltcApiTest.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/ApiTests/XsltcApiTest.cs index 554c591ad8..c95e1f9d65 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/ApiTests/XsltcApiTest.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/ApiTests/XsltcApiTest.cs @@ -4,12 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Reflection; -using System.Xml; using System.Xml.Xsl; using OLEDB.Test.ModuleCore; @@ -57,65 +51,5 @@ namespace System.Xml.Tests throw new CTestFailedException("Did not throw ArgumentException"); } - - /*//[Variation("3", Desc = "Exercise loading from the same class within different threads", Pri = 1)] - [InlineData()] - [Theory] - public void Var3() - { - var xsltList = new SynchronizedCollection<XslCompiledTransform>(); - var rThreads = new CThreads(_output); - - for (int i = 0; i < 10; i++) - { - rThreads.Add(o => - { - var xslt = new XslCompiledTransform(); - xsltList.Add(xslt); - XsltcUtil.LoadFromAssembly(ref xslt, "IdentityTransform"); - return; - }, i.ToString(CultureInfo.InvariantCulture)); - } - - //Wait until they are complete - rThreads.Start(); - rThreads.Wait(); - - return Verify(xsltList); - }*/ - - //[Variation("4", Desc = "XSLCompiledTransform Load(Type) changes the static data of the Type to XmlILCommand", Pri = 1)] - [InlineData()] - //[Theory] //Disabled as it tries to load an assembly which does not exist on CoreFX anymore - public void Var4() - { - var xslt = new XslCompiledTransform(); - - Type t = Assembly.Load(new AssemblyName("TestStylesheet")).GetType("TestStylesheet"); - BindingFlags bindingFlags = BindingFlags.NonPublic | BindingFlags.Static; - - Type beforeLoad = t.GetTypeInfo().GetField("staticData", bindingFlags).GetValue(null).GetType(); - xslt.Load(t); - Type afterLoad = t.GetTypeInfo().GetField("staticData", bindingFlags).GetValue(null).GetType(); - CError.Compare(beforeLoad, afterLoad, "Mismatch in type, before and after load"); - return; - } - - public void Verify(IList<XslCompiledTransform> xsltList) - { - var inputXml = new XmlDocument(); - inputXml.LoadXml("<foo><bar>Hello, world!</bar></foo>"); - - foreach (XslCompiledTransform xslt in xsltList) - { - using (var actualStream = new MemoryStream()) - using (var sw = new StreamWriter(actualStream) { AutoFlush = true }) - { - xslt.Transform(inputXml, null, sw); - - CompareOutput("<?xml version=\"1.0\" encoding=\"utf-8\"?><foo><bar>Hello, world!</bar></foo>", actualStream); - } - } - } } }
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestBasicFunctionality.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestBasicFunctionality.cs index eec881de51..c2fb77de28 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestBasicFunctionality.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestBasicFunctionality.cs @@ -4,8 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; -using System.IO; namespace System.Xml.Tests { @@ -18,83 +16,15 @@ namespace System.Xml.Tests _output = output; } - //[Variation("1", Desc = "Exercise the basic use case, no options", Pri = 1, Params = new object[] { "bft1.xsl", "bft1", "bft1.txt" })] - //[InlineData("bft1.xsl", "bft1", "bft1.txt")] //Skipping this, it tries to load System.dll - //[Variation("2", Desc = "Exercise the basic use case, no options, fully qualified path", Pri = 1, Params = new object[] { @"$(CurrentWorkingDirectory)\bft2.xsl", "bft2", "bft2.txt" })] - //[InlineData(@"$(CurrentWorkingDirectory)\bft2.xsl", "bft2", "bft2.txt")] //Skipping this, it tries to load System.dll - //[Variation("10", Desc = "Exercise the basic use case, 2 stylesheets, 2 classes", Pri = 1, Params = new object[] { "/class:bft10a bft10a.xsl /class:bft10b bft10b.xsl", "bft10a", "bft10.txt" })] - //[InlineData("/class:bft10a bft10a.xsl /class:bft10b bft10b.xsl", "bft10a", "bft10.txt")] //Skipping this, it tries to load System.dll - //[Variation("11", Desc = "Exercise the basic use case, 3 stylesheets, 2 classes", Pri = 2, Params = new object[] { "/class:bft11a bft11a.xsl /class:bft11b bft11b.xsl bft11c.xsl", "bft11a", "bft11.txt" })] - //[InlineData("/class:bft11a bft11a.xsl /class:bft11b bft11b.xsl bft11c.xsl", "bft11a", "bft11.txt")] //Skipping this, it tries to load System.dll - //[Variation("12", Desc = "Exercise the basic use case, many stylesheets 1 class", Pri = 2, Params = new object[] { "/class:bft12az /out:bft12az.dll bft12a.xsl bft12b.xsl bft12c.xsl bft12d.xsl bft12e.xsl bft12f.xsl bft12g.xsl bft12h.xsl bft12i.xsl bft12j.xsl bft12k.xsl bft12l.xsl bft12m.xsl bft12n.xsl bft12o.xsl bft12p.xsl bft12q.xsl bft12r.xsl bft12s.xsl bft12t.xsl bft12u.xsl bft12v.xsl bft12w.xsl bft12x.xsl bft12y.xsl bft12z.xsl", "bft12az", "bft12.txt" })] - //[InlineData("/class:bft12az /out:bft12az.dll bft12a.xsl bft12b.xsl bft12c.xsl bft12d.xsl bft12e.xsl bft12f.xsl bft12g.xsl bft12h.xsl bft12i.xsl bft12j.xsl bft12k.xsl bft12l.xsl bft12m.xsl bft12n.xsl bft12o.xsl bft12p.xsl bft12q.xsl bft12r.xsl bft12s.xsl bft12t.xsl bft12u.xsl bft12v.xsl bft12w.xsl bft12x.xsl bft12y.xsl bft12z.xsl", "bft12az", "bft12.txt")] //Skipping this, it tries to load System.dll - //[Variation("13", Desc = "Exercise the basic use case, same stylesheet twice", Pri = 2, Params = new object[] { "bft13.xsl bft13.xsl", "bft13", "bft13.txt" })] - //[InlineData("bft13.xsl bft13.xsl", "bft13", "bft13.txt")] //Skipping this, it tries to load System.dll - //[Variation("14", Desc = "Exercise the basic use case, same stylesheet twice with 2 different classnames", Pri = 2, Params = new object[] { "/class:bft14a bft14a.xsl /class:bft14b bft14a.xsl", "bft14a", "bft14.txt" })] - //[InlineData("/class:bft14a bft14a.xsl /class:bft14b bft14a.xsl", "bft14a", "bft14.txt")] //Skipping this, it tries to load System.dll - //[Variation("17", Desc = "Exercise a very long stylesheetname with default classname and default assembly name", Pri = 2, Params = new object[] { "bft17012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.xsl", "bft17012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", "bft17.txt" })] - //[InlineData("bft17012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.xsl", "bft17012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789", "bft17.txt")] - //[Variation("19", Desc = "Exercise relative URIs for imported documents", Pri = 1, Params = new object[] { @"bft19.xsl", "bft19", "bft19.txt" })] - //[InlineData(@"bft19.xsl", "bft19", "bft19.txt")] //Skipping this, it tries to load System.dll - //[Variation("20", Desc = "Exercise relative URIs for included documents", Pri = 1, Params = new object[] { @"bft20.xsl", "bft20", "bft20.txt" })] - //[InlineData(@"bft20.xsl", "bft20", "bft20.txt")] //Skipping this, it tries to load System.dll - //[Variation("21", Desc = "Exercise relative URIs for document function", Pri = 1, Params = new object[] { @"/settings:document+ bft21.xsl", "bft21", "bft21.txt" })] - //[InlineData(@"/settings:document+ bft21.xsl", "bft21", "bft21.txt")] //Skipping this, it tries to load System.dll - //[Variation("22", Desc = "Exercise the basic use case, no options, relative path", Pri = 1, Params = new object[] { @".\bft22.xsl", "bft22", "bft22.txt" })] - //[InlineData(@".\bft22.xsl", "bft22", "bft22.txt")] //Skipping this, it tries to load System.dll - //[Variation("23", Desc = "Exercise the basic use case, no options, relative path with fwd slashes", Pri = 1, Params = new object[] { @"./bft23.xsl", "bft23", "bft23.txt" })] - //[InlineData(@"./bft23.xsl", "bft23", "bft23.txt")] //Skipping this, it tries to load System.dll - //[Variation("25", Desc = "Exercise a stylesheet with space in its name", Pri = 1, Params = new object[] { "\"bft 25.xsl\"", "bft 25", "bft25.txt" })] - //[InlineData("\"bft 25.xsl\"", "bft 25", "bft25.txt")] //Skipping this, it tries to load System.dll - //[Variation("26", Desc = "Exercise Cyrillic e in filename", Pri = 1, Params = new object[] { "bft26.xsl", "bft26", "bft26.txt" })] - //[InlineData("bft26.xsl", "bft26", "bft26.txt")] /*sd problems \u0400\u0400\u0400\u0400bft26.xsl, coverage addded to other test cases*/ //Skipping this, it tries to load System.dll - //[Variation("31", Desc = "Exercise options with “-“", Pri = 1, Params = new object[] { "-out:bft31.dll /class:bft31 -debug- bft31.xsl", "bft31", "bft31.txt" })] - //[InlineData("-out:bft31.dll /class:bft31 -debug- bft31.xsl", "bft31", "bft31.txt")] //Skipping this, it tries to load System.dll - [ConditionalTheory(nameof(xsltcExeFound))] - public void Var1(object param0, object param1, object param2) - { - String cmdLine = ReplaceCurrentWorkingDirectory(param0.ToString()); - String asmName = param1 + ".dll"; - String typeName = param1.ToString(); - String pdbName = param1 + ".pdb"; - String baselineFile = param2.ToString(); - - VerifyTest(cmdLine, asmName, true, typeName, pdbName, false, baselineFile, _createFromInputFile); - } - // All variations that are Invalid are run by Var2() - //[Variation("6", Desc = "Exercise the basic use case, invalid input", Pri = 1, Params = new object[] { "/thisisinvalid foo", "bft6.txt" })] - //[InlineData("/thisisinvalid foo", "bft6.txt")] //Skipping this, it tries to load System.dll - //[Variation("7", Desc = "Exercise the basic use case, invalid input", Pri = 1, Params = new object[] { "mystylesheet", "bft7.txt" })] - //[InlineData("mystylesheet", "bft7.txt")] //Skipping this, it tries to load System.dll - //[Variation("8", Desc = "Exercise the basic use case, invalid input", Pri = 1, Params = new object[] { "mystylesheet,xsl", "bft8.txt" })] - //[InlineData("mystylesheet,xsl", "bft8.txt")] //Skipping this, it tries to load System.dll - //[Variation("9", Desc = "Exercise the basic use case, wildcarded stylesheet group", Pri = 1, Params = new object[] { "*.xsl", "bft9.txt", "EnglishOnly" })] - //[InlineData("*.xsl", "bft9.txt"/*, "EnglishOnly"*/)] //Skipping this, it tries to load System.dll //[Variation("15", Desc = "Exercise what would be a circular reference, a primary stylesheet that includes another, followed by the include itself", Pri = 2, Params = new object[] { "bft15a.xsl bft15b.xsl", "bft15.txt", "EnglishOnly" })] [InlineData("bft15a.xsl bft15b.xsl", "bft15.txt"/*, "EnglishOnly"*/)] - //[Variation("16", Desc = "Exercise the basic use case, 2 stylesheets with different extensions", Pri = 2, Params = new object[] { "bft16.xsl bft16.xslt", "bft16.txt" })] - //[InlineData("bft16.xsl bft16.xslt", "bft16.txt")] //Skipping this, it tries to load System.dll - //[Variation("18", Desc = "Exercise what would be a circular reference, a primary stylesheet that imports another, followed by the import itself", Pri = 1, Params = new object[] { "bft18a.xsl bft18b.xsl", "bft18.txt", "EnglishOnly" })] - //[InlineData("bft18a.xsl bft18b.xsl", "bft18.txt"/*, "EnglishOnly"*/)] //Skipping this, it tries to load System.dll - //[Variation("24", Desc = "Exercise what would be a circular reference, a primary stylesheet that imports another, followed by the include itself", Pri = 1, Params = new object[] { "bft24a.xsl bft24b.xsl", "bft24.txt", "EnglishOnly" })] - //[InlineData("bft24a.xsl bft24b.xsl", "bft24.txt"/*, "EnglishOnly"*/)] //Skipping this, it tries to load System.dll //[Variation("27", Desc = "Exercise whitespace before flag values", Pri = 1, Params = new object[] { "/ out:bft27.dll bft27.xsl", "bft27.txt" })] [InlineData("/ out:bft27.dll bft27.xsl", "bft27.txt")] - //[Variation("28", Desc = "Exercise whitespace after flag values", Pri = 1, Params = new object[] { "/out: bft28.dll bft28.xsl", "bft28.txt" })] - //[InlineData("/out: bft28.dll bft28.xsl", "bft28.txt")] //Skipping this, it tries to load System.dll - //[Variation("29", Desc = "Exercise help", Pri = 1, Params = new object[] { "/?", "help.txt" })] - //[InlineData("/?", "help.txt")] //Skipping this, it tries to load System.dll //[Variation("30", Desc = "Exercise help with option values", Pri = 1, Params = new object[] { "bft2.xsl /? bft2.xsl", "help.txt" })] [InlineData("bft2.xsl /? bft2.xsl", "help.txt")] - //[Variation("33", Desc = "Exercise nologo", Pri = 1, Params = new object[] { "/nologo /foo", "bft33.txt" })] - //[InlineData("/nologo /foo", "bft33.txt")] //Skipping this, it tries to load System.dll - //[Variation("34", Desc = "Stylesheet path containing device name", Pri = 1, Params = new object[] { "nul/bft34.xsl", "bft34.txt" })] - //[InlineData("nul/bft34.xsl", "bft34.txt")] //Skipping this, it tries to load System.dll //[Variation("35", Desc = "Device name as stylesheetname", Pri = 1, Params = new object[] { "nul.xsl", "bft35.txt" })] [InlineData("nul.xsl", "bft35.txt")] - //[Variation("36", Desc = "Stylesheet path without name", Pri = 1, Params = new object[] { "..\\", "bft36.txt" })] - //[InlineData("..\\", "bft36.txt")] //Skipping this, it tries to load System.dll //[Variation("37", Desc = "No input source", Pri = 1, Params = new object[] { "/debug+", "bft37.txt" })] [InlineData("/debug+", "bft37.txt")] //[Variation("38", Desc = "Empty string in arguments", Pri = 1, Params = new object[] { "\"\"", "bft38.txt" })] @@ -111,18 +41,5 @@ namespace System.Xml.Tests VerifyTest(cmdLine, baselineFile, _createFromInputFile); } - - //[Variation("5", Desc = "Exercise the basic use case, no input", Pri = 1, Params = new object[] { " ", "bft5.txt" })] - //[InlineData(" ", "bft5.txt")] //Skipping this, it tries to load System.dll - //[Theory] - public void Var3(object param0, object param1) - { - String cmdLine = param0.ToString(); - String baselineFile = _createFromInputFile - ? param1.ToString() - : "help.txt"; - - VerifyTest(cmdLine, baselineFile, _createFromInputFile); - } } }
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs index be51905c57..9614e46c0c 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCaseBase.cs @@ -2,16 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Xunit; using Xunit.Abstractions; -using System; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Text; -using System.Xml; using System.Xml.Xsl; using XmlCoreTest.Common; using OLEDB.Test.ModuleCore; @@ -342,16 +339,6 @@ namespace System.Xml.Tests s_output.WriteLine(e.Message); return false; } - // Turning this off as this causes noise on different platforms like IA64. - // Also since we verify the assembly by loading there is not really a need for this verification. - // if (succeeded && runAssemblyVerification) { - // String peOutput = String.Empty; - // succeeded = XsltVerificationLibrary.VerifyAssemblyUsingPEVerify( - // asmName, - // logger, - // ref peOutput); - // logger.LogMessage("Assembly Verification Result: " + peOutput); - //} } private static byte[] loadFile(string filename) diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestClassname.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestClassname.cs deleted file mode 100644 index ab4abad633..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestClassname.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; -using Xunit.Abstractions; -using System; -using System.IO; - -namespace System.Xml.Tests -{ - // Note: Skipping these tests as they try to load a dll which references System.dll - ////[TestCase(Name = "Classname Tests", Desc = "This Testcase maps to test variations described in 'Classname Functional Tests'")] - //public class XsltcTestClassname : XsltcTestCaseBase - //{ - // private ITestOutputHelper _output; - // public XsltcTestClassname(ITestOutputHelper output) : base(output) - // { - // _output = output; - // } - - // //[Variation("1", Desc = "Exercise the basic use case, a simple valid classname", Pri = 1, Params = new object[] { "/class:MyClass cnt1.xsl", "MyClass", "cnt1.dll", "cnt1.txt" })] - // [InlineData("/class:MyClass cnt1.xsl", "MyClass", "cnt1.dll", "cnt1.txt")] - // //[Variation("2", Desc = "Exercise the basic use case, a fully qualified classname", Pri = 1, Params = new object[] { "/class:XmlCoreTest.MyClass cnt2.xsl", "XmlCoreTest.MyClass", "cnt2.dll", "cnt2.txt" })] - // [InlineData("/class:XmlCoreTest.MyClass cnt2.xsl", "XmlCoreTest.MyClass", "cnt2.dll", "cnt2.txt")] - // //[Variation("4", Desc = "Exercise a C# reserved keyword", Pri = 1, Params = new object[] { "/class:class cnt4.xsl", "class", "cnt4.dll", "cnt4.txt" })] - // [InlineData("/class:class cnt4.xsl", "class", "cnt4.dll", "cnt4.txt")] - // //[Variation("5", Desc = "Exercise an MSIL reserved keyword", Pri = 1, Params = new object[] { "/class:hidebysig cnt5.xsl", "hidebysig", "cnt5.dll", "cnt5.txt" })] - // [InlineData("/class:hidebysig cnt5.xsl", "hidebysig", "cnt5.dll", "cnt5.txt")] - // //[Variation("6", Desc = "Exercise case sensitivity", Pri = 1, Params = new object[] { "/class:MyStyleSheEt cnt6.xsl", "MyStyleSheEt", "cnt6.dll", "cnt6.txt" })] - // [InlineData("/class:MyStyleSheEt cnt6.xsl", "MyStyleSheEt", "cnt6.dll", "cnt6.txt")] - // //[Variation("7", Desc = "Exercise wildcards", Pri = 1, Params = new object[] { "/class:AB? cnt7.xsl", "AB?", "cnt7.dll", "cnt7.txt" })] - // [InlineData("/class:AB? cnt7.xsl", "AB?", "cnt7.dll", "cnt7.txt")] - // //[Variation("8", Desc = "Exercise same classname, one in defautl NS, one in fully-qualified NS", Pri = 1, Params = new object[] { "/class:myclass cnt8a.xsl /class:myns.myclass cnt8b.xsl", "myclass", "cnt8a.dll", "cnt8.txt" })] - // [InlineData("/class:myclass cnt8a.xsl /class:myns.myclass cnt8b.xsl", "myclass", "cnt8a.dll", "cnt8.txt")] - // //[Variation("9", Desc = "Exercise same classname, different namespaces", Pri = 1, Params = new object[] { "/class:ns1.myclass cnt9a.xsl /class:ns2.myclass cnt9b.xsl", "ns1.myclass", "cnt9a.dll", "cnt9.txt" })] - // [InlineData("/class:ns1.myclass cnt9a.xsl /class:ns2.myclass cnt9b.xsl", "ns1.myclass", "cnt9a.dll", "cnt9.txt")] - // //[Variation("10", Desc = "Exercise same namespace, different classnames", Pri = 1, Params = new object[] { "/class:ns.myclass1 cnt10a.xsl /class:ns.myclass2 cnt10b.xsl", "ns.myclass2", "cnt10a.dll", "cnt10.txt" })] - // [InlineData("/class:ns.myclass1 cnt10a.xsl /class:ns.myclass2 cnt10b.xsl", "ns.myclass2", "cnt10a.dll", "cnt10.txt")] - // //[Variation("11", Desc = "Exercise inner class classname", Pri = 2, Params = new object[] { "/class:myclass1 cnt11a.xsl /class:myclass1.myclass2 cnt11b.xsl", "myclass1", "cnt11a.dll", "cnt11.txt" })] - // [InlineData("/class:myclass1 cnt11a.xsl /class:myclass1.myclass2 cnt11b.xsl", "myclass1", "cnt11a.dll", "cnt11.txt")] - // //[Variation("12", Desc = "Exercise inner class classname ordered", Pri = 1, Params = new object[] { "/class:myclass1.myclass2 cnt12b.xsl /class:myclass1 cnt12a.xsl ", "myclass1", "cnt12b.dll", "cnt12.txt" })] - // [InlineData("/class:myclass1.myclass2 cnt12b.xsl /class:myclass1 cnt12a.xsl ", "myclass1", "cnt12b.dll", "cnt12.txt")] - // //[Variation("14", Desc = "Exercise case sensitivity-2", Pri = 1, Params = new object[] { "/class:MyStyleSheEt cnt14.xsl /class:MystylesheeT cnt14b.xsl", "MyStyleSheEt", "cnt14.dll", "cnt14.txt" })] - // [InlineData("/class:MyStyleSheEt cnt14.xsl /class:MystylesheeT cnt14b.xsl", "MyStyleSheEt", "cnt14.dll", "cnt14.txt")] - // //[Variation("16", Desc = "Exercise stylesheet name with multiple dots for default classname ", Pri = 2, Params = new object[] { "ns1.ns2.cnt16.xsl", "ns1.ns2.cnt16", "ns1.ns2.cnt16.dll", "cnt16.txt" })] - // [InlineData("ns1.ns2.cnt16.xsl", "ns1.ns2.cnt16", "ns1.ns2.cnt16.dll", "cnt16.txt")] - // //[Variation("17", Desc = "Exercise stylesheet name with multiple adjacent dots for default classname", Pri = 2, Params = new object[] { "ns1..cnt17.xsl", "ns1..cnt17", "ns1..cnt17.dll", "cnt17.txt" })] - // [InlineData("ns1..cnt17.xsl", "ns1..cnt17", "ns1..cnt17.dll", "cnt17.txt")] - // //[Variation("19", Desc = "Exercise a stylesheet with invalid c# classname", Pri = 1, Params = new object[] { "2-(1)cnt19.xsl", "2-(1)cnt19", "2-(1)cnt19.dll", "cnt19.txt" })] - // [InlineData("2-(1)cnt19.xsl", "2-(1)cnt19", "2-(1)cnt19.dll", "cnt19.txt")] - // //[Variation("21", Desc = "Exercise keyword case sensitivity", Pri = 1, Params = new object[] { "/CLasS:cnt21 cnt21.xsl", "cnt21", "cnt21.dll", "cnt21.txt" })] - // [InlineData("/CLasS:cnt21 cnt21.xsl", "cnt21", "cnt21.dll", "cnt21.txt")] - // //[Variation("22", Desc = "Exercise a space containing classname", Pri = 2, Params = new object[] { "/class:\"cn t22\" cnt22.xsl", "cn t22", "cnt22.dll", "cnt22.txt" })] - // [InlineData("/class:\"cn t22\" cnt22.xsl", "cn t22", "cnt22.dll", "cnt22.txt")] - // //[Variation("23", Desc = "Exercise short form", Pri = 1, Params = new object[] { "-c:myclass cnt23.xsl", "myclass", "cnt23.dll", "cnt23.txt" })] - // [InlineData("-c:myclass cnt23.xsl", "myclass", "cnt23.dll", "cnt23.txt")] - // //[Variation("25", Desc = "Exercise two classnames differentiated only by Cyrillic E", Pri = 1, Params = new object[] { "/class:\u0400cnt25\u0400 cnt25a.xsl /class:cnt25 cnt25b.xsl", "\u0400cnt25\u0400", "cnt25a.dll", "cnt25.txt" })] - // [InlineData("/class:\u0400cnt25\u0400 cnt25a.xsl /class:cnt25 cnt25b.xsl", "\u0400cnt25\u0400", "cnt25a.dll", "cnt25.txt")] - // //[Variation("26", Desc = "Exercise two classnames differentiated only by zero width non breaking space and zero width non joiner", Pri = 1, Params = new object[] { "/class:\uFEFFcnt26\u200B cnt26a.xsl /class:cnt26 cnt26b.xsl", "\uFEFFcnt26\u200B", "cnt26a.dll", "cnt26.txt" })] - // [InlineData("/class:\uFEFFcnt26\u200B cnt26a.xsl /class:cnt26 cnt26b.xsl", "\uFEFFcnt26\u200B", "cnt26a.dll", "cnt26.txt")] - // //[Variation("27", Desc = "Exercise two classnames differentiated only by latin a combined with ring above and \u00e5", Pri = 1, Params = new object[] { "/class:\u0061\u030acnt27 cnt27a.xsl /class:\u00e5cnt27 cnt27b.xsl", "\u0061\u030acnt27", "cnt27a.dll", "cnt27.txt" })] - // [InlineData("/class:\u0061\u030acnt27 cnt27a.xsl /class:\u00e5cnt27 cnt27b.xsl", "\u0061\u030acnt27", "cnt27a.dll", "cnt27.txt")] - // //[Variation("28", Desc = "Exercise two classnames differentiated only by latin small y and IPA block phoenetic y with load", Pri = 1, Params = new object[] { "/class:\u0079cnt28 cnt28a.xsl /class:\u028Fcnt28 cnt28b.xsl", "\u0079cnt28", "cnt28a.dll", "cnt28.txt" })] - // [InlineData("/class:\u0079cnt28 cnt28a.xsl /class:\u028Fcnt28 cnt28b.xsl", "\u0079cnt28", "cnt28a.dll", "cnt28.txt")] - // //[Variation("29", Desc = "Exercise classnames containing (0x03C2), (0x03A3) and (0x03C3), where 2 lower case characters have the same upper case character", Pri = 1, Params = new object[] { "/class:\u03C2\u03A3\u03C3cnt29 cnt29a.xsl /class:\u03A3\u03C2\u03C3cnt29 cnt29b.xsl", "\u03C2\u03A3\u03C3cnt29", "cnt29a.dll", "cnt29.txt" })] - // [InlineData("/class:\u03C2\u03A3\u03C3cnt29 cnt29a.xsl /class:\u03A3\u03C2\u03C3cnt29 cnt29b.xsl", "\u03C2\u03A3\u03C3cnt29", "cnt29a.dll", "cnt29.txt")] - // [Theory] - // public void Var1(object param0, object param1, object param2, object param3) - // { - // String cmdLine = param0.ToString(); - // String asmName = param2.ToString(); - // bool asmCreated = true; - // String typeName = param1.ToString(); - // String pdbName = Path.ChangeExtension(param2.ToString(), ".pdb"); - // bool pdbCreated = false; - // String baselineFile = param3.ToString(); - - // VerifyTest(cmdLine, asmName, asmCreated, typeName, pdbName, pdbCreated, baselineFile, _createFromInputFile); - // } - - // //[Variation("3", Desc = "Exercise an invalid case, empty/no argument", Pri = 1, Params = new object[] { "/class: cnt3.xsl", "cnt3.txt" })] - // [InlineData("/class: cnt3.xsl", "cnt3.txt")] - // //[Variation("13", Desc = "Exercise an invalid case, class specified without colon", Pri = 1, Params = new object[] { "/class cnt13.xsl", "cnt13.txt" })] - // [InlineData("/class cnt13.xsl", "cnt13.txt")] - // //[Variation("15", Desc = "Exercise classname conflict, 2 stylesheets one with default classname and one specifying the same", Pri = 2, Params = new object[] { "cnt15a.xsl /class:cnt15a cnt15b.xsl", "cnt15.txt" })] - // [InlineData("cnt15a.xsl /class:cnt15a cnt15b.xsl", "cnt15.txt")] - // //[Variation("18", Desc = "Exercise the basic use case, 2 stylesheets with different extensions", Pri = 2, Params = new object[] { "cnt18.xsl cnt18.xslt", "cnt18.txt" })] - // [InlineData("cnt18.xsl cnt18.xslt", "cnt18.txt")] - // //[Variation("20", Desc = "Exercise a very long classname", Pri = 2, Params = new object[] { "/class:cnt2001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 cnt20.xsl", "cnt20.txt", "EnglishOnly" })] - // //[InlineData("/class:cnt2001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 cnt20.xsl", "cnt20.txt"/*, "EnglishOnly"*/)] - // //[Variation("24", Desc = "Exercise multiple /class flags for one stylesheet", Pri = 1, Params = new object[] { "/class:A /class:B cnt24.xsl", "cnt24.txt" })] - // [InlineData("/class:A /class:B cnt24.xsl", "cnt24.txt")] - // [Theory] - // public void Var2(object param0, object param1) - // { - // if (ShouldSkip(new object[] { param0, param1 })) - // { - // return; //TEST_SKIPPED; - // } - // String cmdLine = param0.ToString(); - // String baselineFile = param1.ToString(); - - // VerifyTest(cmdLine, baselineFile, _createFromInputFile); - // } - //} -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCompile.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCompile.cs deleted file mode 100644 index b838861c6e..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestCompile.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -//using Xunit; -//using Xunit.Abstractions; -//using System.IO; -//using System.Xml; -//using System.Xml.Xsl; - -// BinCompat TODO: Disabling this for now, as this is loading a dll with no strong name -//namespace System.Xml.Tests -//{ -// //[TestCase(Name = "Compile Time Tests", Desc = "This Testcase maps to test variations described in 'CompileTime Variations Functional Tests'")] -// public class XsltcTestCompile : XsltcTestCaseBase -// { -// private ITestOutputHelper _output; -// public XsltcTestCompile(ITestOutputHelper output) : base(output) -// { -// _output = output; -// } - -// //[Variation("1", Desc = "Test calling XslCompiledTransform(typeof()) instead of using reflection to load the assembly.", Pri = 1)] -// [InlineData()] -// [Theory] -// public void Var1() -// { -// var inputXml = new XmlDocument(); -// inputXml.LoadXml("<foo><bar>Hello, world!</bar></foo>"); - -// var xslt = new XslCompiledTransform(); -// xslt.Load(typeof(TestStylesheet)); - -// using (var actualStream = new MemoryStream()) -// using (var sw = new StreamWriter(actualStream) -// { -// AutoFlush = true -// }) -// { -// xslt.Transform(inputXml, null, sw); - -// CompareOutput("<?xml version=\"1.0\" encoding=\"utf-8\"?>Hello foo!", actualStream); - -// return; -// } -// } -// } -//}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestOut.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestOut.cs deleted file mode 100644 index 2d25120f44..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestOut.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; -using Xunit.Abstractions; -using System; - -namespace System.Xml.Tests -{ - // Note: Skipping these tests as they try to load a dll which references System.dll - ////[TestCase(Name = "Out Option Tests", Desc = "This Testcase maps to test variations described in 'Out Functional Tests'")] - //public class XsltcTestOut : XsltcTestCaseBase - //{ - // private ITestOutputHelper _output; - // public XsltcTestOut(ITestOutputHelper output) : base(output) - // { - // _output = output; - // } - - // //[Variation("1", Desc = "Exercise basic use case, no option specified", Pri = 1, Params = new object[] { "oft1.xsl", "oft1.dll", "yes", "oft1", "oft1.txt" })] - // [InlineData("oft1.xsl", "oft1.dll", "yes", "oft1", "oft1.txt")] - // //[Variation("2", Desc = "Exercise basic use case, no option value", Pri = 1, Params = new object[] { "/out: oft2.xsl", "oft2.dll", "no", "oft2", "oft2.txt" })] - // [InlineData("/out: oft2.xsl", "oft2.dll", "no", "oft2", "oft2.txt")] - // //[Variation("3", Desc = "Exercise basic use case, assembly name different from stylesheet", Pri = 1, Params = new object[] { "/out:MyFoo.dll oft3.xsl", "MyFoo.dll", "yes", "oft3", "oft3.txt" })] - // [InlineData("/out:MyFoo.dll oft3.xsl", "MyFoo.dll", "yes", "oft3", "oft3.txt")] - // //[Variation("4", Desc = "Exercise basic use case, multiple stylesheets, no option specified", Pri = 1, Params = new object[] { "oft4a.xsl oft4b.xsl", "oft4a.dll", "yes", "oft4a", "oft4.txt" })] - // [InlineData("oft4a.xsl oft4b.xsl", "oft4a.dll", "yes", "oft4a", "oft4.txt")] - // //[Variation("5", Desc = "Exercise basic use case, multiple stylesheets, no option specified-2", Pri = 1, Params = new object[] { "oft5b.xsl oft5a.xsl", "oft5b.dll", "yes", "oft5a", "oft5.txt" })] - // [InlineData("oft5b.xsl oft5a.xsl", "oft5b.dll", "yes", "oft5a", "oft5.txt")] - // //[Variation("6", Desc = "Exercise basic use case, multiple stylesheets in one assembly", Pri = 1, Params = new object[] { "/out:oft6.dll oft6a.xsl oft6b.xsl", "oft6.dll", "yes", "oft6a", "oft6.txt" })] - // [InlineData("/out:oft6.dll oft6a.xsl oft6b.xsl", "oft6.dll", "yes", "oft6a", "oft6.txt")] - // //[Variation("7", Desc = "Exercise use case where assembly extension is specified, exe", Pri = 1, Params = new object[] { "/out:oft7.exe oft7.xsl", "oft7.exe", "yes", "oft7", "oft7.txt" })] - // [InlineData("/out:oft7.exe oft7.xsl", "oft7.exe", "yes", "oft7", "oft7.txt")] - // //[Variation("8", Desc = "Exercise use case where assembly extension is specified but different", Pri = 1, Params = new object[] { "/out:myfoo.doc oft8.xsl", "myfoo.doc", "yes", "oft8", "oft8.txt" })] - // [InlineData("/out:myfoo.doc oft8.xsl", "myfoo.doc", "yes", "oft8", "oft8.txt")] - // //[Variation("9", Desc = "Exercise use case, assembly extension is shorter than 3 chars", Pri = 1, Params = new object[] { "/out:oft9.xy oft9.xsl", "oft9.xy", "yes", "oft9", "oft9.txt" })] - // [InlineData("/out:oft9.xy oft9.xsl", "oft9.xy", "yes", "oft9", "oft9.txt")] - // //[Variation("10", Desc = "Exercise use case, assembly extension is longer than 3 chars", Pri = 1, Params = new object[] { "/out:oft10.xyzt oft10.xsl", "oft10.xyzt", "yes", "oft10", "oft10.txt" })] - // [InlineData("/out:oft10.xyzt oft10.xsl", "oft10.xyzt", "yes", "oft10", "oft10.txt")] - // //[Variation("11", Desc = "Exercise a very long assembly name", Pri = 1, Params = new object[] { "/out:oft1101234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.dll oft11.xsl", "oft1101234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.dll", "no", "oft11", "oft11.txt", "EnglishOnly" })] - // //[InlineData("/out:oft1101234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.dll oft11.xsl", "oft1101234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.dll", "no", "oft11", "oft11.txt"/*, "EnglishOnly"*/)] - // //[Variation("12", Desc = "Exercise a case where the output assembly name contains whitespace", Pri = 1, Params = new object[] { "/out:\"oft 12.dll\" oft12.xsl", "oft 12.dll", "yes", "oft12", "oft12.txt" })] - // [InlineData("/out:\"oft 12.dll\" oft12.xsl", "oft 12.dll", "yes", "oft12", "oft12.txt")] - // //[Variation("13", Desc = "Exercise keyword case sensitivity", Pri = 1, Params = new object[] { "/OUt:oft13.dll oft13.xsl", "oft13.dll", "yes", "oft13", "oft13.txt" })] - // [InlineData("/OUt:oft13.dll oft13.xsl", "oft13.dll", "yes", "oft13", "oft13.txt")] - // //[Variation("14", Desc = "Exercise fully qualified output path", Pri = 1, Params = new object[] { @"/out:$(CurrentWorkingDirectory)\oft14.dll oft14.xsl", "oft14.dll", "yes", "oft14", "oft14.txt" })] - // [InlineData(@"/out:$(CurrentWorkingDirectory)\oft14.dll oft14.xsl", "oft14.dll", "yes", "oft14", "oft14.txt")] - // //[Variation("15", Desc = "Exercise relative output path", Pri = 1, Params = new object[] { @"/out:.\oft15.dll oft15.xsl", "oft15.dll", "yes", "oft15", "oft15.txt" })] - // [InlineData(@"/out:.\oft15.dll oft15.xsl", "oft15.dll", "yes", "oft15", "oft15.txt")] - // //[Variation("16", Desc = "Exercise relative output path with forward slash", Pri = 1, Params = new object[] { @"/out:./oft16.dll oft16.xsl", "oft16.dll", "yes", "oft16", "oft16.txt" })] - // [InlineData(@"/out:./oft16.dll oft16.xsl", "oft16.dll", "yes", "oft16", "oft16.txt")] - // //[Variation("18", Desc = "Exercise output to device", Pri = 1, Params = new object[] { "/out:a:\\oft18.dll oft18.xsl", "oft18.dll", "no", "oft18", "oft18.txt", "EnglishOnly" })] - // [InlineData("/out:a:\\oft18.dll oft18.xsl", "oft18.dll", "no", "oft18", "oft18.txt"/*, "EnglishOnly"*/)] - // //[Variation("19", Desc = "Exercise output to null device", Pri = 1, Params = new object[] { "/out:nul.dll oft19.xsl", "nul.dll", "no", "oft19", "oft19.txt" })] - // [InlineData("/out:nul.dll oft19.xsl", "nul.dll", "no", "oft19", "oft19.txt")] - // //[Variation("20", Desc = "Exercise assembly name with invalid chars", Pri = 1, Params = new object[] { "/out:\"oft|20.dll\" oft20.xsl", "oft|20.dll", "no", "oft20", "oft20.txt", "EnglishOnly" })] - // [InlineData("/out:\"oft|20.dll\" oft20.xsl", "oft|20.dll", "no", "oft20", "oft20.txt"/*, "EnglishOnly"*/)] - // //[Variation("21", Desc = "Exercise reserved device name as assembly name", Pri = 1, Params = new object[] { "/out:\"COM1.dll\" oft21.xsl", "COM1.dll", "no", "oft21", "oft21.txt" })] - // [InlineData("/out:\"COM1.dll\" oft21.xsl", "COM1.dll", "no", "oft21", "oft21.txt")] - // //[Variation("23", Desc = "Exercise assembly named ..a", Pri = 1, Params = new object[] { "/out:..oft23 oft23.xsl", "..oft23", "yes", "oft23", "oft23.txt" })] - // [InlineData("/out:..oft23 oft23.xsl", "..oft23", "yes", "oft23", "oft23.txt")] - // //[Variation("24", Desc = "Exercise file path with . in it", Pri = 1, Params = new object[] { "/out:MyFoo.dll oft3.xsl", "MyFoo.dll", "yes", "oft3", "oft3.txt" })] - // //[Variation("25", Desc = "Exercise space containing assembly extension", Pri = 1, Params = new object[] { "/out:\"oft25.d l\" oft25.xsl", "oft25.d l", "yes", "oft25", "oft25.txt" })] - // [InlineData("/out:\"oft25.d l\" oft25.xsl", "oft25.d l", "yes", "oft25", "oft25.txt")] - // //[Variation("26", Desc = "Exercise space containing assembly path", Pri = 1, Params = new object[] { "/out:MyFoo.dll oft3.xsl", "MyFoo.dll", "yes", "oft3", "oft3.txt" })] - // //[Variation("27", Desc = "Exercise multiple /out: flags", Pri = 1, Params = new object[] { "/out:oft27A.dll /out:oft27B.dll oft27.xsl", "oft27B.dll", "yes", "oft27", "oft27.txt" })] - // [InlineData("/out:oft27A.dll /out:oft27B.dll oft27.xsl", "oft27B.dll", "yes", "oft27", "oft27.txt")] - // //[Variation("29", Desc = "Exercise device name containing path", Pri = 1, Params = new object[] { "/out:d:/nul/oft29.dll oft29.xsl", "oft29.dll", "no", "oft29", "oft29.txt", "EnglishOnly" })] - // [InlineData("/out:d:/nul/oft29.dll oft29.xsl", "oft29.dll", "no", "oft29", "oft29.txt"/*, "EnglishOnly"*/)] - // //[Variation("30", Desc = "No directory with intranet path", Pri = 1, Params = new object[] { @"/out:\\foo\bar.dll oft30.xsl", "oft30.dll", "no", "oft30", "oft30.txt" })] - // [InlineData(@"/out:\\foo\bar.dll oft30.xsl", "oft30.dll", "no", "oft30", "oft30.txt")] - // //[Variation("31", Desc = "Invalid intranet path", Pri = 1, Params = new object[] { @"/out:\\foo\foo\bar.dll oft31.xsl", "oft31.dll", "no", "oft31", "oft31.txt", "EnglishOnly" })] - // [InlineData(@"/out:\\foo\foo\bar.dll oft31.xsl", "oft31.dll", "no", "oft31", "oft31.txt"/*, "EnglishOnly"*/)] - // [Theory] - // public virtual void Var1(object param0, object param1, object param2, object param3, object param4) - // { - // if (ShouldSkip(new object[] { param0, param1, param2, param3, param4})) - // { - // return; //TEST_SKIPPED; - // } - // String cmdLine, - // asmName, - // typeName, - // baselineFile; - // bool asmCreated; - - // VarParse(param0, param1, param2, param3, param4, out cmdLine, out asmName, out asmCreated, out typeName, out baselineFile); - - // VerifyTest(cmdLine, asmName, asmCreated, typeName, baselineFile, _createFromInputFile); - // } - - // //[Variation("28", Desc = "Exercise an assembly name composed of zero width chars and Cyrillic E", Pri = 1, Params = new object[] { "/out:\u0400\uFEFF\u200B.\u0400\uFEFF\u200B\u0400 oft28.xsl", "\u0400\uFEFF\u200B.\u0400\uFEFF\u200B\u0400", "yes", "oft28", "oft28.txt" })] - // [InlineData("/out:\u0400\uFEFF\u200B.\u0400\uFEFF\u200B\u0400 oft28.xsl", "\u0400\uFEFF\u200B.\u0400\uFEFF\u200B\u0400", "yes", "oft28", "oft28.txt")] - // [Theory] - // public virtual void Var2(object param0, object param1, object param2, object param3, object param4) - // { - // String cmdLine, - // asmName, - // typeName, - // baselineFile; - // bool asmCreated; - - // VarParse(param0, param1, param2, param3, param4, out cmdLine, out asmName, out asmCreated, out typeName, out baselineFile); - - // VerifyTest(cmdLine, asmName, asmCreated, typeName, String.Empty, false, baselineFile, false, _createFromInputFile); - // } - - // public virtual void VarParse(object param0, object param1, object param2, object param3, object param4, out String cmdLine, out String asmName, out bool asmCreated, out String typeName, out String baselineFile) - // { - // cmdLine = ReplaceCurrentWorkingDirectory(param0.ToString()); - // asmName = param1.ToString(); - // asmCreated = String.Compare(param2.ToString(), "yes", true) == 0; - // typeName = param3.ToString(); - // baselineFile = param4.ToString(); - // } - //} -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestPlatform.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestPlatform.cs index 994d82b1e9..ab05bc9713 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestPlatform.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestPlatform.cs @@ -4,8 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; -using System.Globalization; using System.IO; namespace System.Xml.Tests @@ -19,20 +17,12 @@ namespace System.Xml.Tests _output = output; } - //[Variation("1", Desc = "Exercise basic use case, no option specified", Pri = 1, Params = new object[] { "pft1.xsl", "pft1", "pft1.dll", "pft1.txt" })] - //[InlineData("pft1.xsl", "pft1", "pft1.dll", "pft1.txt")] //Skipping this, it tries to load System.dll //[Variation("3", Desc = "Exercise basic use case, a supported option val", Pri = 1, Params = new object[] { "/platform:x64 pft3.xsl", "", "pft3.dll", "pft3.txt" })] [InlineData("/platform:x64 pft3.xsl", "", "pft3.dll", "pft3.txt")] - //[Variation("7", Desc = "Exercise keyword case sensitivity -1 ", Pri = 1, Params = new object[] { "/PLAtforM:X86 pft7.xsl", "", "pft7.dll", "pft7.txt" })] - //[InlineData("/PLAtforM:X86 pft7.xsl", "", "pft7.dll", "pft7.txt")] //Skipping this, it tries to load System.dll //[Variation("8", Desc = "Exercise keyword case sensitivity -2", Pri = 1, Params = new object[] { "/PLAtforM:ItaNiuM pft8.xsl", "", "pft8.dll", "pft8.txt" })] [InlineData("/PLAtforM:ItaNiuM pft8.xsl", "", "pft8.dll", "pft8.txt")] - //[Variation("9", Desc = "Exercise keyword case sensitivity -3", Pri = 1, Params = new object[] { "/PLAtforM:X64 pft9.xsl", "", "pft9.dll", "pft9.txt" })] - //[InlineData("/PLAtforM:X64 pft9.xsl", "", "pft9.dll", "pft9.txt")] //Skipping this, it tries to load System.dll //[Variation("10", Desc = "Exercise keyword case sensitivity -4", Pri = 1, Params = new object[] { "/PLAtforM:AnyCpU pft10.xsl", "", "pft10.dll", "pft10.txt" })] [InlineData("/PLAtforM:AnyCpU pft10.xsl", "", "pft10.dll", "pft10.txt")] - //[Variation("17", Desc = "Compile an assembly for anycpu and load", Pri = 1, Params = new object[] { "/platform:anycpu pft17.xsl", "pft17", "pft17.dll", "pft17.txt" })] - //[InlineData("/platform:anycpu pft17.xsl", "pft17", "pft17.dll", "pft17.txt")] //Skipping this, it tries to load System.dll [ConditionalTheory(nameof(xsltcExeFound))] public void Var1(object param0, object param1, object param2, object param3) { @@ -51,16 +41,8 @@ namespace System.Xml.Tests [InlineData("/platform: pft2.xsl", "pft2.txt")] //[Variation("4", Desc = "Exercise basic use case, an unsupported option value", Pri = 1, Params = new object[] { "/platform:foo pft4.xsl", "pft4.txt" })] [InlineData("/platform:foo pft4.xsl", "pft4.txt")] - //[Variation("11", Desc = "Exercise basic use case, an unsupported option value -1", Pri = 1, Params = new object[] { "/platform pft11.xsl", "pft11.txt" })] - //[InlineData("/platform pft11.xsl", "pft11.txt")] //Skipping this, it tries to load System.dll //[Variation("12", Desc = "Exercise basic use case, an unsupported option value -2", Pri = 1, Params = new object[] { "/platform: pft12.xsl", "pft12.txt" })] [InlineData("/platform: pft12.xsl", "pft12.txt")] - //[Variation("13", Desc = "Exercise basic use case, an unsupported option value -3", Pri = 1, Params = new object[] { "/platform:* pft13.xsl", "pft13.txt" })] - //[InlineData("/platform:* pft13.xsl", "pft13.txt")] //Skipping this, it tries to load System.dll - //[Variation("14", Desc = "Exercise basic use case, an unsupported option value -4", Pri = 1, Params = new object[] { "/platform:x86x64 pft14.xsl", "pft14.txt" })] - //[InlineData("/platform:x86x64 pft14.xsl", "pft14.txt")] //Skipping this, it tries to load System.dll - //[Variation("15", Desc = "Exercise basic use case, an unsupported option value -5", Pri = 1, Params = new object[] { "/platform:x86,x64 pft15.xsl", "pft15.txt" })] - //[InlineData("/platform:x86,x64 pft15.xsl", "pft15.txt")] //Skipping this, it tries to load System.dll //[Variation("16", Desc = "Exercise basic use case, an unsupported option value -6", Pri = 1, Params = new object[] { "/platform:x86;x64 pft16.xsl", "pft16.txt" })] [InlineData("/platform:x86;x64 pft16.xsl", "pft16.txt")] [ConditionalTheory(nameof(xsltcExeFound))] @@ -72,12 +54,8 @@ namespace System.Xml.Tests VerifyTest(cmdLine, baselineFile, _createFromInputFile); } - //[Variation("18", Desc = "Compile an assembly for machine's platform and load", Pri = 1, Params = new object[] { "pft18.xsl", "pft18.dll", "yes", "pft18", "pft18.pdb", "no", "pft18.txt", "yes" })] - //[InlineData("pft18.xsl", "pft18.dll", "yes", "pft18", "pft18.pdb", "no", "pft18.txt", "yes")] //Skipping this, it tries to load System.dll //[Variation("19", Desc = "Compile an assembly for different platform and load", Pri = 1, Params = new object[] { "pft19.xsl", "pft19.dll", "yes", "", "pft19.pdb", "no", "pft19.txt", "no" })] [InlineData("pft19.xsl", "pft19.dll", "yes", "", "pft19.pdb", "no", "pft19.txt", "no")] - //[Variation("20", Desc = "Exercise multiple /platform: flags", Pri = 1, Params = new object[] { "/platform:X64 pft20.xsl" /*+ " /platform:<current>*/, "pft20.dll", "yes", "pft20", "pft20.pdb", "no", "pft20.txt", "yes" })] - //[InlineData("/platform:X64 pft20.xsl" /*+ " /platform:<current>*/, "pft20.dll", "yes", "pft20", "pft20.pdb", "no", "pft20.txt", "yes")] //Skipping this, it tries to load System.dll [ConditionalTheory(nameof(xsltcExeFound))] public void Var3(object param0, object param1, object param2, object param3, object param4, object param5, object param6, object param7) { diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestSettings.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestSettings.cs index 2efff0291a..39766f8234 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestSettings.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/CommonScenarios/XsltcTestSettings.cs @@ -4,7 +4,6 @@ using Xunit; using Xunit.Abstractions; -using System; namespace System.Xml.Tests { @@ -17,78 +16,36 @@ namespace System.Xml.Tests _output = output; } - //[Variation("1", Desc = "Basic /settings test cases, stylesheet has DTD, where DTD+", Pri = 0, Params = new object[] { "/settings:DTD+ sft1.xsl", "sft1.dll", "yes", "sft1", "sft1.pdb", "no", "sft1.txt" })] - //[InlineData("/settings:DTD+ sft1.xsl", "sft1.dll", "yes", "sft1", "sft1.pdb", "no", "sft1.txt")] //Skipping this, it tries to load System.dll - //[Variation("2", Desc = "Basic /settings test cases, stylesheet has DTD, where DTD-", Pri = 0, Params = new object[] { "/settings:DTD- sft2.xsl", "sft2.dll", "no", "sft2", "sft2.pdb", "no", "sft2.txt" })] - //[InlineData("/settings:DTD- sft2.xsl", "sft2.dll", "no", "sft2", "sft2.pdb", "no", "sft2.txt")] //Skipping this, it tries to load System.dll - //[Variation("3", Desc = "Basic /settings test cases, stylesheet has script, where script+", Pri = 0, Params = new object[] { "/settings:script+ sft3.xsl", "sft3.dll", "yes", "sft3", "sft3.pdb", "no", "sft3.txt" })] - //[InlineData("/settings:script+ sft3.xsl", "sft3.dll", "yes", "sft3", "sft3.pdb", "no", "sft3.txt")] //Skipping this, it tries to load System.dll //[Variation("4", Desc = "Basic /settings test cases, stylesheet has script, where script-", Pri = 0, Params = new object[] { "/settings:script- sft4.xsl", "sft4hack.dll", "no", "sft4", "sft4.pdb", "no", "sft4.txt" })] [InlineData("/settings:script- sft4.xsl", "sft4hack.dll", "no", "sft4", "sft4.pdb", "no", "sft4.txt")] - //[Variation("5", Desc = "Basic /settings test cases, stylesheet has document(), where document+", Pri = 0, Params = new object[] { "/settings:document+ sft5.xsl", "sft5.dll", "yes", "sft5", "sft5.pdb", "no", "sft5.txt" })] - //[InlineData("/settings:document+ sft5.xsl", "sft5.dll", "yes", "sft5", "sft5.pdb", "no", "sft5.txt")] //Skipping this, it tries to load System.dll //[Variation("6", Desc = "Basic /settings test cases, stylesheet has document(), where document-", Pri = 0, Params = new object[] { "/settings:document- sft6.xsl", "sft6hack.dll", "no", "sft6", "sft6.pdb", "no", "sft6.txt" })] [InlineData("/settings:document- sft6.xsl", "sft6hack.dll", "no", "sft6", "sft6.pdb", "no", "sft6.txt")] //[Variation("7", Desc = "Exercise settings with no colon", Pri = 0, Params = new object[] { "/settingsDTD+ sft7.xsl", "sft7.dll", "no", "sft7", "sft7.pdb", "no", "sft7.txt" })] [InlineData("/settingsDTD+ sft7.xsl", "sft7.dll", "no", "sft7", "sft7.pdb", "no", "sft7.txt")] - //[Variation("8", Desc = "Exercise settings with no option value", Pri = 0, Params = new object[] { "/settings: sft8.xsl", "sft8.dll", "yes", "sft8", "sft8.pdb", "no", "sft8.txt" })] - //[InlineData("/settings: sft8.xsl", "sft8.dll", "yes", "sft8", "sft8.pdb", "no", "sft8.txt")] //Skipping this, it tries to load System.dll - //[Variation("9", Desc = "Exercise DTD switch without +/-, stylesheet has DTD", Pri = 0, Params = new object[] { "/settings:DTD sft9.xsl", "sft9.dll", "yes", "sft9", "sft9.pdb", "no", "sft9.txt" })] - //[InlineData("/settings:DTD sft9.xsl", "sft9.dll", "yes", "sft9", "sft9.pdb", "no", "sft9.txt")] //Skipping this, it tries to load System.dll - //[Variation("10", Desc = "Exercise script switch without +/-, stylesheet has script block", Pri = 0, Params = new object[] { "/settings:script sft10.xsl", "sft10.dll", "yes", "sft10", "sft10.pdb", "no", "sft10.txt" })] - //[InlineData("/settings:script sft10.xsl", "sft10.dll", "yes", "sft10", "sft10.pdb", "no", "sft10.txt")] //Skipping this, it tries to load System.dll - //[Variation("11", Desc = "Exercise document switch without +/-, stylesheet has document() function", Pri = 0, Params = new object[] { "/settings:document sft11.xsl", "sft11.dll", "yes", "sft11", "sft11.pdb", "no", "sft11.txt" })] - //[InlineData("/settings:document sft11.xsl", "sft11.dll", "yes", "sft11", "sft11.pdb", "no", "sft11.txt")] //Skipping this, it tries to load System.dll - //[Variation("13", Desc = "Exercise keyword case sensitivity", Pri = 0, Params = new object[] { "/SeTTings:DOCument+ sft13.xsl", "sft13.dll", "yes", "sft13", "sft13.pdb", "no", "sft13.txt" })] - //[InlineData("/SeTTings:DOCument+ sft13.xsl", "sft13.dll", "yes", "sft13", "sft13.pdb", "no", "sft13.txt")] //Skipping this, it tries to load System.dll //[Variation("14", Desc = "Exercise Turkish I problem", Pri = 0, Params = new object[] { "/SETTİNGS:SCRİPT+ sft14.xsl", "sft14.dll", "no", "sft14", "sft14.pdb", "no", "sft14.txt", "EnglishOnly" })] [InlineData("/SETT\u0130NGS:SCR\u0130PT+ sft14.xsl", "sft14.dll", "no", "sft14", "sft14.pdb", "no", "sft14.txt"/*, "EnglishOnly"*/)] //[Variation("15", Desc = "Exercise conflicting +, - symbols", Pri = 0, Params = new object[] { "/settings:script+- sft15.xsl", "sft15.dll", "no", "sft15", "sft15.pdb", "no", "sft15.txt" })] [InlineData("/settings:script+- sft15.xsl", "sft15.dll", "no", "sft15", "sft15.pdb", "no", "sft15.txt")] - //[Variation("27", Desc = "Basic /settings test cases, imported stylesheet has DTD, where DTD+", Pri = 0, Params = new object[] { "/settings:DTD+ sft27.xsl", "sft27.dll", "yes", "sft27", "sft27.pdb", "no", "sft27.txt" })] - //[InlineData("/settings:DTD+ sft27.xsl", "sft27.dll", "yes", "sft27", "sft27.pdb", "no", "sft27.txt")] //Skipping this, it tries to load System.dll //[Variation("28", Desc = "Basic /settings test cases, imported stylesheet has DTD, where DTD-", Pri = 0, Params = new object[] { "/settings:DTD- sft28.xsl", "sft28.dll", "no", "sft28", "sft28.pdb", "no", "sft28.txt" })] [InlineData("/settings:DTD- sft28.xsl", "sft28.dll", "no", "sft28", "sft28.pdb", "no", "sft28.txt")] - //[Variation("29", Desc = "Basic /settings test cases, imported stylesheet has script, where script+", Pri = 0, Params = new object[] { "/settings:script+ sft29.xsl", "sft29.dll", "yes", "sft29", "sft29.pdb", "no", "sft29.txt" })] - //[InlineData("/settings:script+ sft29.xsl", "sft29.dll", "yes", "sft29", "sft29.pdb", "no", "sft29.txt")] //Skipping this, it tries to load System.dll //[Variation("30", Desc = "Basic /settings test cases, imported stylesheet has script, where script-", Pri = 0, Params = new object[] { "/settings:script- sft30.xsl", "sft30hack.dll", "no", "sft30", "sft30.pdb", "no", "sft30.txt" })] [InlineData("/settings:script- sft30.xsl", "sft30hack.dll", "no", "sft30", "sft30.pdb", "no", "sft30.txt")] - //[Variation("31", Desc = "Basic /settings test cases, imported stylesheet has document(), where document+", Pri = 0, Params = new object[] { "/settings:document+ sft31.xsl", "sft31.dll", "yes", "sft31", "sft31.pdb", "no", "sft31.txt" })] - //[InlineData("/settings:document+ sft31.xsl", "sft31.dll", "yes", "sft31", "sft31.pdb", "no", "sft31.txt")] //Skipping this, it tries to load System.dll - //[Variation("32", Desc = "Basic /settings test cases, imported stylesheet has document(), where document-", Pri = 0, Params = new object[] { "/settings:document- sft32.xsl", "sft32hack.dll", "no", "sft32", "sft32.pdb", "no", "sft32.txt" })] - //[InlineData("/settings:document- sft32.xsl", "sft32hack.dll", "no", "sft32", "sft32.pdb", "no", "sft32.txt")] //Skipping this, it tries to load System.dll - //[Variation("33", Desc = "Basic /settings test cases, included stylesheet has DTD, where DTD+", Pri = 0, Params = new object[] { "/settings:DTD+ sft33.xsl", "sft33.dll", "yes", "sft33", "sft33.pdb", "no", "sft33.txt" })] - //[InlineData("/settings:DTD+ sft33.xsl", "sft33.dll", "yes", "sft33", "sft33.pdb", "no", "sft33.txt")] //Skipping this, it tries to load System.dll - //[Variation("34", Desc = "Basic /settings test cases, included stylesheet has DTD, where DTD-", Pri = 0, Params = new object[] { "/settings:DTD- sft34.xsl", "sft34.dll", "no", "sft34", "sft34.pdb", "no", "sft34.txt" })] - //[InlineData("/settings:DTD- sft34.xsl", "sft34.dll", "no", "sft34", "sft34.pdb", "no", "sft34.txt")] //Skipping this, it tries to load System.dll - //[Variation("35", Desc = "Basic /settings test cases, included stylesheet has script, where script+", Pri = 0, Params = new object[] { "/settings:script+ sft35.xsl", "sft35.dll", "yes", "sft35", "sft35.pdb", "no", "sft35.txt" })] - //[InlineData("/settings:script+ sft35.xsl", "sft35.dll", "yes", "sft35", "sft35.pdb", "no", "sft35.txt")] //Skipping this, it tries to load System.dll //[Variation("36", Desc = "Basic /settings test cases, included stylesheet has script, where script-", Pri = 0, Params = new object[] { "/settings:script- sft36.xsl", "sft36hack.dll", "no", "sft36", "sft36.pdb", "no", "sft36.txt" })] [InlineData("/settings:script- sft36.xsl", "sft36hack.dll", "no", "sft36", "sft36.pdb", "no", "sft36.txt")] - //[Variation("37", Desc = "Basic /settings test cases, included stylesheet has document(), where document+", Pri = 0, Params = new object[] { "/settings:document+ sft37.xsl", "sft37.dll", "yes", "sft37", "sft37.pdb", "no", "sft37.txt" })] - //[InlineData("/settings:document+ sft37.xsl", "sft37.dll", "yes", "sft37", "sft37.pdb", "no", "sft37.txt")] //Skipping this, it tries to load System.dll //[Variation("38", Desc = "Basic /settings test cases, included stylesheet has document(), where document-", Pri = 0, Params = new object[] { "/settings:document- sft38.xsl", "sft38hack.dll", "no", "sft38", "sft38.pdb", "no", "sft38.txt" })] [InlineData("/settings:document- sft38.xsl", "sft38hack.dll", "no", "sft38", "sft38.pdb", "no", "sft38.txt")] //[Variation("41", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/settings:DTD~ sft41.xsl", "sft41.dll", "no", "sft41", "sft41.pdb", "no", "sft41.txt" })] [InlineData("/settings:DTD~ sft41.xsl", "sft41.dll", "no", "sft41", "sft41.pdb", "no", "sft41.txt")] //[Variation("42", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/settings:script* sft42.xsl", "sft42.dll", "no", "sft42", "sft42.pdb", "no", "sft42.txt" })] [InlineData("/settings:script* sft42.xsl", "sft42.dll", "no", "sft42", "sft42.pdb", "no", "sft42.txt")] - //[Variation("43", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/settings:document% sft43.xsl", "sft43.dll", "no", "sft43", "sft43.pdb", "no", "sft43.txt" })] - //[InlineData("/settings:document% sft43.xsl", "sft43.dll", "no", "sft43", "sft43.pdb", "no", "sft43.txt")] //Skipping this, it tries to load System.dll //[Variation("44", Desc = "Exercise basic use case multiple options specified", Pri = 0, Params = new object[] { "/settings:script+document- sft44.xsl", "sft44.dll", "no", "sft44", "sft44.pdb", "no", "sft44.txt" })] [InlineData("/settings:script+document- sft44.xsl", "sft44.dll", "no", "sft44", "sft44.pdb", "no", "sft44.txt")] - //[Variation("45", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/script sft45.xsl", "sft45.dll", "no", "sft45", "sft45.pdb", "no", "sft45.txt" })] - //[InlineData("/script sft45.xsl", "sft45.dll", "no", "sft45", "sft45.pdb", "no", "sft45.txt")] //Skipping this, it tries to load System.dll //[Variation("46", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/script+ sft46.xsl", "sft46.dll", "no", "sft46", "sft46.pdb", "no", "sft46.txt" })] [InlineData("/script+ sft46.xsl", "sft46.dll", "no", "sft46", "sft46.pdb", "no", "sft46.txt")] - //[Variation("47", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/DTD sft47.xsl", "sft47.dll", "no", "sft47", "sft47.pdb", "no", "sft47.txt" })] - //[InlineData("/DTD sft47.xsl", "sft47.dll", "no", "sft47", "sft47.pdb", "no", "sft47.txt")] //Skipping this, it tries to load System.dll //[Variation("48", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/DTD- sft48.xsl", "sft48.dll", "no", "sft48", "sft48.pdb", "no", "sft48.txt" })] [InlineData("/DTD- sft48.xsl", "sft48.dll", "no", "sft48", "sft48.pdb", "no", "sft48.txt")] //[Variation("49", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/document sft49.xsl", "sft49.dll", "no", "sft49", "sft49.pdb", "no", "sft49.txt" })] [InlineData("/document sft49.xsl", "sft49.dll", "no", "sft49", "sft49.pdb", "no", "sft49.txt")] - //[Variation("50", Desc = "Exercise basic use case invalid option specified", Pri = 0, Params = new object[] { "/document- sft50.xsl", "sft50.dll", "no", "sft50", "sft50.pdb", "no", "sft50.txt" })] - //[InlineData("/document- sft50.xsl", "sft50.dll", "no", "sft50", "sft50.pdb", "no", "sft50.txt")] //Skipping this, it tries to load System.dll //[Variation("51", Desc = "Regression: Basic /settings test cases, two stylesheet with the same script block", Pri = 0, Params = new object[] { "/settings:script+ sft3.xsl sft4.xsl", "sft3.dll", "yes", "", "sft3.pdb", "no", "sft3.txt" })] [InlineData("/settings:script+ sft3.xsl sft4.xsl", "sft3.dll", "yes", "", "sft3.pdb", "no", "sft3.txt")] [ConditionalTheory(nameof(xsltcExeFound))] diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/Program.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/Program.cs deleted file mode 100644 index 0d8bfc4be1..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/Program.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using ModuleCore; -using System; -using System.IO; - -namespace XsltCompilerTests -{ - internal class Program - { - public static int Main() - { - try - { - // Verify xsltc.exe is available - XmlCoreTest.Common.XsltVerificationLibrary.SearchPath("xsltc.exe"); - } - catch (FileNotFoundException) - { - Console.WriteLine("Could not find 'xsltc.exe'. Make sure that the .NET SDK is installed"); - return 99; - } - - string args = @"ExecutionMode:File Host:None SDKInstalled:NotInstalled"; - return 100 + TestRunner.Execute(args); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/TestStylesheet.dll b/src/System.Private.Xml/tests/Xslt/XsltCompiler/TestStylesheet.dll Binary files differdeleted file mode 100644 index 3797d8c4a5..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/TestStylesheet.dll +++ /dev/null diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCommon.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCommon.cs index 221ac200ef..644e5102c3 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCommon.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCommon.cs @@ -9,11 +9,8 @@ using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; -using System.Reflection; -using System.Text; using System.Xml; using System.Xml.XmlDiff; -using System.Xml.Xsl; namespace XmlCoreTest.Common { diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCompiler.Tests.csproj b/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCompiler.Tests.csproj index 68631c39ce..5d211076fa 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCompiler.Tests.csproj +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltCompiler.Tests.csproj @@ -18,17 +18,11 @@ <OutputPath>$(OutputPath)\$(RootNamespace)\$(AssemblyName)</OutputPath> </PropertyGroup> <ItemGroup> - <!--<Reference Include="TestStylesheet"> - <HintPath>.\TestStylesheet.dll</HintPath> - </Reference>--> </ItemGroup> <ItemGroup> <Compile Include="CommonScenarios\XsltcTestBasicFunctionality.cs" /> <Compile Include="CommonScenarios\XsltcTestCaseBase.cs" /> - <Compile Include="CommonScenarios\XsltcTestClassname.cs" /> - <Compile Include="CommonScenarios\XsltcTestCompile.cs" /> <Compile Include="CommonScenarios\XsltcTestFile.cs" /> - <Compile Include="CommonScenarios\XsltcTestOut.cs" /> <Compile Include="CommonScenarios\XsltcTestPlatform.cs" /> <Compile Include="CommonScenarios\XsltcTestSettings.cs" /> <Compile Include="XsltcModule.cs" /> @@ -45,16 +39,5 @@ <ProjectReference Include="$(CommonTestPath)\System\Xml\XmlDiff\XmlDiff.csproj" /> <ProjectReference Include="..\..\..\..\System.Private.Xml\pkg\System.Private.Xml.pkgproj" /> </ItemGroup> - <ItemGroup> - <Content Include="Identity.xslt" /> - <Content Include="IdentityTransform.dll"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> - <Content Include="IdentityTransform.xslt"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - <SubType>Designer</SubType> - </Content> - <Content Include="TestStylesheet.xslt" /> - </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> </Project> diff --git a/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltcModule.cs b/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltcModule.cs index bbf7e6be63..6155f5eed3 100644 --- a/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltcModule.cs +++ b/src/System.Private.Xml/tests/Xslt/XsltCompiler/XsltcModule.cs @@ -2,9 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Xunit; -using Xunit.Abstractions; -using System; using System.IO; using XmlCoreTest.Common; using OLEDB.Test.ModuleCore; @@ -14,7 +11,7 @@ namespace System.Xml.Tests //[TestModule(Name = "Xsltc", Desc = "Xsltc Compiler Tests", Pri = 1)] public class XsltcModule : CTestModule { - public static string TargetDirectory = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"xsltc\baseline"); + public static string TargetDirectory = Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "xsltc", "baseline"); public void CopyDataFiles(string sourcePath, string targetDir) { @@ -38,18 +35,11 @@ namespace System.Xml.Tests int ret = base.Init(objParam); // copy all the data files to working folder - CopyDataFiles(Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), "xsltc"), TargetDirectory); - CopyDataFiles(Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), "xsltc", "precompiled"), TargetDirectory); - CopyDataFiles(Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), "xsltc", "baseline"), TargetDirectory); + CopyDataFiles(Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "xsltc"), TargetDirectory); + CopyDataFiles(Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "xsltc", "precompiled"), TargetDirectory); + CopyDataFiles(Path.Combine("TestFiles", FilePathUtil.GetTestDataPath(), "xsltc", "baseline"), TargetDirectory); return ret; } - - private static string GetDirectory() - { - string current = Directory.GetCurrentDirectory(); - - return current.Contains(" ") ? "C:\\xml" : current; - } } }
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/AspNet.cs b/src/System.Private.Xml/tests/Xslt/XsltScenarios/AspNet.cs deleted file mode 100644 index a05bd82a0c..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/AspNet.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using OLEDB.Test.ModuleCore; -using System.IO; -using System.Net; - -namespace XsltScenarios -{ - [TestCase(id = 1, Name = "AspNet using XslTransform", Desc = "Testing XslTransform functionality under ASP.NET Environment", Pri = 2, Param = "http://dpxmldtap1/security/xmlscenarios/xslt/")] - [TestCase(id = 2, Name = "AspNet using XslCompiledTransform", Desc = "Testing XslCompiledTransform functionality under ASP.NET Environment", Pri = 2, Param = "http://dpxmldtap1/security/xmlscenarios/xslt/")] - internal class AspNet : CTestCase - { - public AspNet() - { - } - - private string ExecuteUrl(string url) - { - //When id is 1, ver parameter is sent as v1 and in the ASP.NET Environment XslTransform is used - //When id is 2, ver parameter is sent as v2 and in the ASP.NET Environment XslCompiledTransform is used - if (id == 1) - url = Param.ToString() + url + "&ver=v1"; - else if (id == 2) - url = Param.ToString() + url + "&ver=v2"; - - //Special if the url doesn't have any parameters other than ver then use ? instead of & - if (url.IndexOf("?") == -1) - url = url.Replace("&", "?"); - - // Create a request for the URL. - CError.WriteLine("Executing the URL " + url); - WebRequest request = WebRequest.Create(url); - // If required by the server, set the credentials. - request.Credentials = CredentialCache.DefaultCredentials; - // Get the response. - HttpWebResponse response = (HttpWebResponse)request.GetResponse(); - // Display the status. - // Console.WriteLine(response.StatusDescription); - // Get the stream containing content returned by the server. - Stream dataStream = response.GetResponseStream(); - // Open the stream using a StreamReader for easy access. - StreamReader reader = new StreamReader(dataStream); - // Read the content. - string responseFromServer = reader.ReadToEnd(); - // Cleanup the streams and the response. - reader.Close(); - dataStream.Close(); - response.Close(); - - return responseFromServer; - } - - [Variation(id = 1, Desc = "Basic ASP.NET Test, send params and pass them to Transform", Pri = 0, Param = "test1.aspx?firstname=foo&lastname=bar&age=20&dob=2/2/1985")] - public int Test1() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result><firstname>foo</firstname><lastname>bar</lastname><age>20</age><dob>2/2/1985</dob></result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 2, Desc = "Pass an extension object to Transform in ASP.NET", Pri = 0, Param = "test2.aspx")] - public int Test2() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result>10</result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 3, Desc = "Store compiled XSLT in Session state and use it from Session", Pri = 1, Param = "test3.aspx")] - public int Test3() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result>Xslt in Session</result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 4, Desc = "Use the Xslt stored in Session state in the previous test", Pri = 2, Param = "test4.aspx")] - public int Test4() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result>Nothing is stored in Session</result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 5, Desc = "Store the XSLT Object in Application state", Pri = 1, Param = "test5.aspx")] - public int Test5() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result>Xslt in Application</result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 6, Desc = "Use the Application XSLT Object stored in previous test", Pri = 2, Param = "test6.aspx")] - public int Test6() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result>Xslt in Application</result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 7, Desc = "Store the ArgumentList in the Application state", Pri = 2, Param = "test7.aspx?firstname=foo&lastname=bar&age=20&dob=2/2/1985")] - public int Test7() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result><firstname>foo</firstname><lastname>bar</lastname><age>20</age><dob>2/2/1985</dob></result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 8, Desc = "Use the Application XSLT and ArgList Objects stored in previous test", Pri = 2, Param = "test8.aspx")] - public int Test8() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result><firstname>foo</firstname><lastname>bar</lastname><age>20</age><dob>2/2/1985</dob></result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 9, Desc = "Add more parameters to the existing Argumentlist in Application state", Pri = 2, Param = "test9.aspx?gender=male")] - public int Test9() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result><firstname>foo</firstname><lastname>bar</lastname><age>20</age><dob>2/2/1985</dob><gender>male</gender><state>WA</state></result>"; - - return Utils.VerifyTest(actResult, expResult); - } - - [Variation(id = 10, Desc = "Transform output to TextWriter(Response.Output)", Pri = 2, Param = "test10.aspx")] - [Variation(id = 11, Desc = "Transform output to Stream(Response.OutputStream)", Pri = 2, Param = "test11.aspx")] - public int Test10() - { - string url = CurVariation.Param.ToString(); - string actResult = ExecuteUrl(url); - string expResult = "<result><firstname>foo</firstname><lastname>bar</lastname><age>20</age><dob>2/2/1985</dob></result>"; - - return Utils.VerifyTest(actResult, expResult); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/EXslt.cs b/src/System.Private.Xml/tests/Xslt/XsltScenarios/EXslt.cs deleted file mode 100644 index 0ad205fb49..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/EXslt.cs +++ /dev/null @@ -1,379 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using GotDotNet.Exslt; -using Xunit; -using Xunit.Abstractions; -using System; -using System.Globalization; -using System.IO; -using System.Security; -using System.Xml; -using System.Xml.XPath; -using System.Xml.Xsl; -using XmlCoreTest.Common; -using System.Reflection; -using System.Reflection.Emit; - -namespace System.Xml.Tests -{ - //[TestCase(Name = "EXslt using XslCompiledTransform", Desc = "Compatibility of EXslt Objects using XsltV2 XsltArgumentList", Pri = 2, Param = "v2")] - //[TestCase(Name = "EXslt using XslTransform", Desc = "Compatibility of EXslt Objects using XsltV1 XsltArgumentList", Pri = 2, Param = "v1")] - public class EXslt //: CTestCase - { - private string _xmlFile = string.Empty; - private string _xslFile = string.Empty; - private string _baseline = string.Empty; - -#pragma warning disable 0618 - private XslTransform _xsltV1 = null; -#pragma warning restore 0618 - private XslCompiledTransform _xsltV2 = null; - - private ITestOutputHelper _output; - //Constructor - public EXslt(ITestOutputHelper output) - { - _output = output; - } - - //[Variation(id = 1, Desc = "Xslt Scenarios : common-node-set)] - [InlineData("common-source.xml", "common-node-set.xsl", "valid", "common-node-set.xml", "v2")] - //[Variation(id = 2, Desc = "Xslt Scenarios : common-object-type)] - [InlineData("common-source.xml", "common-object-type.xsl", "valid", "common-object-type.xml", "v2")] - //[Variation(id = 3, Desc = "Xslt Scenarios : datetime-add-duration)] - [InlineData("datetime-source.xml", "datetime-add-duration.xsl", "valid", "datetime-add-duration.xml", "v2")] - //[Variation(id = 4, Desc = "Xslt Scenarios : datetime-add)] - ///[InlineData("datetime-source.xml", "datetime-add.xsl", "valid", "datetime-add.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 5, Desc = "Xslt Scenarios : datetime-avg)] - [InlineData("datetime-source1.xml", "datetime-avg.xsl", "valid", "datetime-avg.xml", "v2")] - //[Variation(id = 6, Desc = "Xslt Scenarios : datetime-date-time)] - ///[InlineData("datetime-source.xml", "datetime-date-time.xsl", "valid", "datetime-date-time.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 7, Desc = "Xslt Scenarios : datetime-date)] - [InlineData("datetime-source.xml", "datetime-date.xsl", "valid", "datetime-date.xml", "v2")] - //[Variation(id = 8, Desc = "Xslt Scenarios : datetime-day-abbreviation)] - [InlineData("datetime-source.xml", "datetime-day-abbreviation.xsl", "valid", "datetime-day-abbreviation.xml", "v2")] - //[Variation(id = 10, Desc = "Xslt Scenarios : datetime-day-in-month)] - [InlineData("datetime-source.xml", "datetime-day-in-month.xsl", "valid", "datetime-day-in-month.xml", "v2")] - //[Variation(id = 11, Desc = "Xslt Scenarios : datetime-day-in-week)] - [InlineData("datetime-source.xml", "datetime-day-in-week.xsl", "valid", "datetime-day-in-week.xml", "v2")] - //[Variation(id = 12, Desc = "Xslt Scenarios : datetime-day-in-year)] - [InlineData("datetime-source.xml", "datetime-day-in-year.xsl", "valid", "datetime-day-in-year.xml", "v2")] - //[Variation(id = 13, Desc = "Xslt Scenarios : datetime-day-name)] - [InlineData("datetime-source1.xml", "datetime-day-name.xsl", "valid", "datetime-day-name.xml", "v2")] - //[Variation(id = 14, Desc = "Xslt Scenarios : datetime-day-name1)] - [InlineData("datetime-source1.xml", "datetime-day-name1.xsl", "valid", "datetime-day-name1.xml", "v2")] - //[Variation(id = 15, Desc = "Xslt Scenarios : datetime-day-of-week-in-month)] - [InlineData("datetime-source.xml", "datetime-day-of-week-in-month.xsl", "valid", "datetime-day-of-week-in-month.xml", "v2")] - //[Variation(id = 16, Desc = "Xslt Scenarios : datetime-difference)] - [InlineData("datetime-source.xml", "datetime-difference.xsl", "valid", "datetime-difference.xml", "v2")] - //[Variation(id = 17, Desc = "Xslt Scenarios : datetime-duration)] - [InlineData("datetime-source.xml", "datetime-duration.xsl", "valid", "datetime-duration.xml", "v2")] - //[Variation(id = 18, Desc = "Xslt Scenarios : datetime-format-date)] - ///[InlineData("datetime-source.xml", "datetime-format-date.xsl", "valid", "datetime-format-date.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 19, Desc = "Xslt Scenarios : datetime-hour-in-day)] - [InlineData("datetime-source.xml", "datetime-hour-in-day.xsl", "valid", "datetime-hour-in-day.xml", "v2")] - //[Variation(id = 20, Desc = "Xslt Scenarios : datetime-leap-year)] - [InlineData("datetime-source.xml", "datetime-leap-year.xsl", "valid", "datetime-leap-year.xml", "v2")] - //[Variation(id = 21, Desc = "Xslt Scenarios : datetime-max)] - [InlineData("datetime-source1.xml", "datetime-max.xsl", "valid", "datetime-max.xml", "v2")] - //[Variation(id = 22, Desc = "Xslt Scenarios : datetime-min)] - [InlineData("datetime-source1.xml", "datetime-min.xsl", "valid", "datetime-min.xml", "v2")] - //[Variation(id = 23, Desc = "Xslt Scenarios : datetime-minute-in-hour)] - [InlineData("datetime-source.xml", "datetime-minute-in-hour.xsl", "valid", "datetime-minute-in-hour.xml", "v2")] - //[Variation(id = 24, Desc = "Xslt Scenarios : datetime-month-abbreviation)] - [InlineData("datetime-source.xml", "datetime-month-abbreviation.xsl", "valid", "datetime-month-abbreviation.xml", "v2")] - //[Variation(id = 25, Desc = "Xslt Scenarios : datetime-month-abbreviation1)] - [InlineData("datetime-source1.xml", "datetime-month-abbreviation1.xsl", "valid", "datetime-month-abbreviation1.xml", "v2")] - //[Variation(id = 26, Desc = "Xslt Scenarios : datetime-month-in-year)] - [InlineData("datetime-source.xml", "datetime-month-in-year.xsl", "valid", "datetime-month-in-year.xml", "v2")] - //[Variation(id = 27, Desc = "Xslt Scenarios : datetime-month-name)] - [InlineData("datetime-source1.xml", "datetime-month-name.xsl", "valid", "datetime-month-name.xml", "v2")] - //[Variation(id = 28, Desc = "Xslt Scenarios : datetime-month-name1)] - [InlineData("datetime-source1.xml", "datetime-month-name1.xsl", "valid", "datetime-month-name1.xml", "v2")] - //[Variation(id = 29, Desc = "Xslt Scenarios : datetime-parse-date)] - [InlineData("datetime-source.xml", "datetime-parse-date.xsl", "valid", "datetime-parse-date.xml", "v2")] - //[Variation(id = 30, Desc = "Xslt Scenarios : datetime-second-in-minute)] - [InlineData("datetime-source.xml", "datetime-second-in-minute.xsl", "valid", "datetime-second-in-minute.xml", "v2")] - //[Variation(id = 31, Desc = "Xslt Scenarios : datetime-seconds)] - [InlineData("datetime-source.xml", "datetime-seconds.xsl", "valid", "datetime-seconds.xml", "v2")] - //[Variation(id = 32, Desc = "Xslt Scenarios : datetime-sum)] - [InlineData("datetime-source.xml", "datetime-sum.xsl", "valid", "datetime-sum.xml", "v2")] - //[Variation(id = 33, Desc = "Xslt Scenarios : datetime-time)] - [InlineData("datetime-source.xml", "datetime-time.xsl", "valid", "datetime-time.xml", "v2")] - //[Variation(id = 34, Desc = "Xslt Scenarios : datetime-week-in-month)] - [InlineData("datetime-source.xml", "datetime-week-in-month.xsl", "valid", "datetime-week-in-month.xml", "v2")] - //[Variation(id = 35, Desc = "Xslt Scenarios : datetime-week-in-year)] - [InlineData("datetime-source.xml", "datetime-week-in-year.xsl", "valid", "datetime-week-in-year.xml", "v2")] - //[Variation(id = 36, Desc = "Xslt Scenarios : datetime-year)] - [InlineData("datetime-source.xml", "datetime-year.xsl", "valid", "datetime-year.xml", "v2")] - //[Variation(id = 37, Desc = "Xslt Scenarios : dynamic-evaluate)] - [InlineData("datetime-source1.xml", "dynamic-evaluate.xsl", "invalid", "datetime-year.xml", "v2")] - //[Variation(id = 38, Desc = "Xslt Scenarios : math-abs)] - [InlineData("math-source.xml", "math-abs.xsl", "valid", "math-abs.xml", "v2")] - //[Variation(id = 39, Desc = "Xslt Scenarios : math-acos)] - [InlineData("math-source.xml", "math-acos.xsl", "valid", "math-acos2.xml", "v2")] - //[Variation(id = 40, Desc = "Xslt Scenarios : math-asin)] - [InlineData("math-source.xml", "math-asin.xsl", "valid", "math-asin2.xml", "v2")] - //[Variation(id = 41, Desc = "Xslt Scenarios : math-atan)] - [InlineData("math-source.xml", "math-atan.xsl", "valid", "math-atan_2.xml", "v2")] - //[Variation(id = 42, Desc = "Xslt Scenarios : math-atan2)] - [InlineData("math-source.xml", "math-atan2.xsl", "valid", "math-atan2_2.xml", "v2")] - //[Variation(id = 43, Desc = "Xslt Scenarios : math-avg)] - [InlineData("math-source1.xml", "math-avg.xsl", "valid", "math-avg.xml", "v2")] - //[Variation(id = 44, Desc = "Xslt Scenarios : math-constant)] - [InlineData("math-source.xml", "math-constant.xsl", "valid", "math-constant2.xml", "v2")] - //[Variation(id = 45, Desc = "Xslt Scenarios : math-cos)] - [InlineData("math-source.xml", "math-cos.xsl", "valid", "math-cos2.xml", "v2")] - //[Variation(id = 46, Desc = "Xslt Scenarios : math-exp)] - [InlineData("math-source.xml", "math-exp.xsl", "valid", "math-exp2.xml", "v2")] - //[Variation(id = 47, Desc = "Xslt Scenarios : math-highest)] - [InlineData("math-source.xml", "math-highest.xsl", "invalid", "math-exp2.xml", "v2")] - //[Variation(id = 48, Desc = "Xslt Scenarios : math-log)] - [InlineData("math-source.xml", "math-log.xsl", "valid", "math-log2.xml", "v2")] - //[Variation(id = 49, Desc = "Xslt Scenarios : math-lowest)] - [InlineData("math-source.xml", "math-lowest.xsl", "invalid", "math-log2.xml", "v2")] - //[Variation(id = 50, Desc = "Xslt Scenarios : math-max)] - [InlineData("math-source.xml", "math-max.xsl", "valid", "math-max.xml", "v2")] - //[Variation(id = 51, Desc = "Xslt Scenarios : math-min)] - [InlineData("math-source.xml", "math-min.xsl", "valid", "math-min.xml", "v2")] - //[Variation(id = 52, Desc = "Xslt Scenarios : math-power)] - [InlineData("math-source.xml", "math-power.xsl", "valid", "math-power.xml", "v2")] - //[Variation(id = 53, Desc = "Xslt Scenarios : math-random)] - [InlineData("math-source.xml", "math-random.xsl", "valid", "math-random.xml", "v2")] - //[Variation(id = 54, Desc = "Xslt Scenarios : math-sin)] - [InlineData("math-source.xml", "math-sin.xsl", "valid", "math-sin2.xml", "v2")] - //[Variation(id = 55, Desc = "Xslt Scenarios : math-sqrt)] - [InlineData("math-source.xml", "math-sqrt.xsl", "valid", "math-sqrt.xml", "v2")] - //[Variation(id = 56, Desc = "Xslt Scenarios : math-tan)] - [InlineData("math-source.xml", "math-tan.xsl", "valid", "math-tan2.xml", "v2")] - //[Variation(id = 57, Desc = "Xslt Scenarios : random-sequence)] - [InlineData("random-source.xml", "random-sequence.xslt", "valid", "random-sequence.xml", "v2")] - //[Variation(id = 58, Desc = "Xslt Scenarios : regex-match)] - ///[InlineData("regex-source.xml", "regex-match.xsl", "valid", "regex-match.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 59, Desc = "Xslt Scenarios : regex-replace)] - ///[InlineData("regex-source.xml", "regex-replace.xsl", "valid", "regex-replace.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 60, Desc = "Xslt Scenarios : regex-test)] - ///[InlineData("regex-source.xml", "regex-test.xsl", "valid", "regex-test.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 61, Desc = "Xslt Scenarios : regex-tokenize)] - ///[InlineData("regex-source1.xml", "regex-tokenize.xsl", "valid", "regex-tokenize.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 62, Desc = "Xslt Scenarios : sets-difference)] - [InlineData("sets-source.xml", "sets-difference.xsl", "invalid", "regex-tokenize.xml", "v2")] - //[Variation(id = 63, Desc = "Xslt Scenarios : sets-distinct)] - [InlineData("sets-source.xml", "sets-distinct.xsl", "invalid", "regex-tokenize.xml", "v2")] - //[Variation(id = 64, Desc = "Xslt Scenarios : sets-has-same-node)] - ///[InlineData("sets-source.xml", "sets-has-same-node.xsl", "valid", "sets-has-same-node.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 65, Desc = "Xslt Scenarios : sets-intersection)] - [InlineData("sets-source.xml", "sets-intersection.xsl", "invalid", "sets-has-same-node.xml", "v2")] - //[Variation(id = 66, Desc = "Xslt Scenarios : sets-leading)] - [InlineData("sets-source.xml", "sets-leading.xsl", "invalid", "sets-has-same-node.xml", "v2")] - //[Variation(id = 67, Desc = "Xslt Scenarios : sets-subset)] - ///[InlineData("sets-source1.xml", "sets-subset.xsl", "valid", "sets-subset.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 68, Desc = "Xslt Scenarios : sets-trailing)] - [InlineData("sets-source.xml", "sets-trailing.xsl", "invalid", "sets-subset.xml", "v2")] - //[Variation(id = 69, Desc = "Xslt Scenarios : string-align)] - [InlineData("string-source.xml", "string-align.xsl", "valid", "string-align.xml", "v2")] - //[Variation(id = 70, Desc = "Xslt Scenarios : string-concat)] - [InlineData("string-source.xml", "string-concat.xsl", "valid", "string-concat.xml", "v2")] - //[Variation(id = 71, Desc = "Xslt Scenarios : string-decode-uri)] - ///[InlineData("string-source.xml", "string-decode-uri.xsl", "valid", "string-decode-uri.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 72, Desc = "Xslt Scenarios : string-encode-uri)] - [InlineData("string-source.xml", "string-encode-uri.xsl", "valid", "string-encode-uri.xml", "v2")] - //[Variation(id = 73, Desc = "Xslt Scenarios : string-lowercase)] - [InlineData("string-source1.xml", "string-lowercase.xsl", "valid", "string-lowercase.xml", "v2")] - //[Variation(id = 74, Desc = "Xslt Scenarios : string-padding)] - [InlineData("string-source.xml", "string-padding.xsl", "valid", "string-padding.xml", "v2")] - //[Variation(id = 75, Desc = "Xslt Scenarios : string-replace)] - [InlineData("string-source.xml", "string-replace.xsl", "valid", "string-replace.xml", "v2")] - //[Variation(id = 76, Desc = "Xslt Scenarios : string-split)] - ///[InlineData("string-source.xml", "string-split.xsl", "valid", "string-split.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 77, Desc = "Xslt Scenarios : string-tokenize)] - ///[InlineData("string-source.xml", "string-tokenize.xsl", "valid", "string-tokenize.xml", "v2")] //disabled as references libraries not present on corefx - //[Variation(id = 78, Desc = "Xslt Scenarios : string-uppercase)] - [InlineData("string-source1.xml", "string-uppercase.xsl", "valid", "string-uppercase.xml", "v2")] - [Theory] - public void RunEXslTest(object param0, object param1, object param2, object param3, object param4) - { - string OutFile = "out_exslt.xml"; - string xmlFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\EXslt\", param0.ToString()); - string xslFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\EXslt\", param1.ToString()); - string resultType = param2.ToString(); - string baseLine = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\EXslt\out\", param3.ToString()); - -#pragma warning disable 0618 - if (param4.ToString() == "v1") - _xsltV1 = new XslTransform(); -#pragma warning restore 0618 - else if (param4.ToString() == "v2") - _xsltV2 = new XslCompiledTransform(); - - Utils util = new Utils(_output); - - _output.WriteLine("XmlFile : file:\\\\" + xmlFile); - _output.WriteLine("XslFile : file:\\\\" + xslFile); - - if (resultType == "valid") - _output.WriteLine("BaseLine : file:\\\\" + baseLine); - else - _output.WriteLine("Test Type : Invalid"); - - //Create the argument list and load the source document - XsltArgumentList argList = InitArgumentList(); - XPathDocument doc = null; - - try - { - doc = new XPathDocument(xmlFile); - } - catch (Exception e) - { - _output.WriteLine(e.ToString()); - Assert.True(false); - } - - //Delete the output file if it exists - - using (Stream stm = new FileStream(OutFile, FileMode.Create, FileAccess.ReadWrite)) - { - try - { - if (param4.ToString() == "v1") - { - XPathDocument xslDoc = new XPathDocument(xslFile); - //Evidence evidence = new Evidence(); - //evidence.AddHost(new Zone(SecurityZone.MyComputer)); - //evidence.AddHost(new Zone(SecurityZone.Intranet)); - - _xsltV1.Load(xslDoc, new XmlUrlResolver()/*, evidence*/); - _xsltV1.Transform(doc, argList, stm, new XmlUrlResolver()); - } - else if (param4.ToString() == "v2") - { - _xsltV2.Load(xslFile, XsltSettings.TrustedXslt, new XmlUrlResolver()); - _xsltV2.Transform(doc, argList, stm); - } - stm.Dispose(); - util.VerifyResult(OutFile, baseLine); - } - - //For V1 Transform - catch (XPathException ex) - { - _output.WriteLine(ex.Message); - if (resultType == "invalid") - return; - else - Assert.True(false); - } - - //For V2 Transform - catch (XsltException ex) - { - _output.WriteLine(ex.Message); - if (resultType == "invalid") - return; - else - Assert.True(false); - } - } - } - - public enum x - { - None = 0, - Common = 1, - DatesAndTimes = 2, - } - - private XsltArgumentList InitArgumentList() - { - XsltArgumentList argList = new XsltArgumentList(); - x xinstance = new x(); - if (xinstance.ToString() == null) - { Assert.True(false); } - ExsltDatesAndTimes date = new ExsltDatesAndTimes(); - ExsltCommon exsl = new ExsltCommon(); - //ExsltFunctionNamespace func = new ExsltFunctionNamespace(); - ExsltMath math = new ExsltMath(); - ExsltRandom random = new ExsltRandom(); - ExsltRegularExpressions regexp = new ExsltRegularExpressions(); - ExsltSets set = new ExsltSets(); - ExsltStrings str = new ExsltStrings(); - - GDNDatesAndTimes date2 = new GDNDatesAndTimes(); - GDNDynamic dyn2 = new GDNDynamic(); - GDNMath math2 = new GDNMath(); - GDNRegularExpressions regexp2 = new GDNRegularExpressions(); - GDNSets set2 = new GDNSets(); - GDNStrings str2 = new GDNStrings(); - - //EXSLT Objects - argList.AddExtensionObject("http://exslt.org/dates-and-times", date); - //argList.AddExtensionObject("http://exslt.org/dynamic", dyn); - argList.AddExtensionObject("http://exslt.org/common", exsl); - //argList.AddExtensionObject("http://exslt.org/functions", func); - argList.AddExtensionObject("http://exslt.org/math", math); - argList.AddExtensionObject("http://exslt.org/random", random); - argList.AddExtensionObject("http://exslt.org/regular-expressions", regexp); - argList.AddExtensionObject("http://exslt.org/sets", set); - argList.AddExtensionObject("http://exslt.org/strings", str); - - //GotDotNet Objects - argList.AddExtensionObject("http://gotdotnet.com/exslt/dates-and-times", date2); - argList.AddExtensionObject("http://gotdotnet.com/exslt/dynamic", dyn2); - argList.AddExtensionObject("http://gotdotnet.com/exslt/math", math2); - argList.AddExtensionObject("http://gotdotnet.com/exslt/regular-expressions", regexp2); - argList.AddExtensionObject("http://gotdotnet.com/exslt/sets", set2); - argList.AddExtensionObject("http://gotdotnet.com/exslt/strings", str2); - - return argList; - } - - - // Helper method to autogenerate Exslt xunit test data from XsltScenarios.xml - public void AutoGenerateXunitTestData() - { - StreamWriter sw = new StreamWriter(new FileStream("XunitTestList.txt", FileMode.Create, FileAccess.Write)); - - //Load the control file - XmlDocument doc = new XmlDocument { XmlResolver = new XmlUrlResolver() }; - doc.Load("XsltScenarios.xml"); - - XmlNodeList TestCases = doc.DocumentElement.SelectNodes("//Variation"); - - foreach (XmlNode Variation in TestCases) - { - foreach (string ver in new string[] { "v1", "v2" }) - { - string variationDesc = Variation.Attributes.GetNamedItem("Desc").Value; - int variationId = Convert.ToInt32(Variation.Attributes.GetNamedItem("Id").Value); - - sw.WriteLine("//[Variation(id = " + variationId.ToString() + ", Desc = \"" + variationDesc + ")]"); - - _xmlFile = Variation.SelectSingleNode("Data/Xml").InnerText; - _xslFile = Variation.SelectSingleNode("Data/Xsl").InnerText; - - string ResultType = Variation.SelectSingleNode("Data/Result[1]/@Type").Value; - ResultType = ResultType.ToLower(); - - if (ResultType == "valid") - { - _baseline = Variation.SelectSingleNode("Data/Result").InnerText; - try - { - _baseline = Variation.SelectSingleNode("Data/Result[@TransformType='" + ver + "']").InnerText; ; - } - catch (NullReferenceException) - { - } - } - sw.WriteLine("[InlineData(" + "\"" + _xmlFile + "\", " + "\"" + _xslFile + "\", " + "\"" + ResultType + "\", " + "\"" + _baseline + "\", " + "\"" + ver + "\"" + ")]"); - } - } - - sw.WriteLine("[Theory]"); - sw.Dispose(); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/GotDotNet.Exslt.dll b/src/System.Private.Xml/tests/Xslt/XsltScenarios/GotDotNet.Exslt.dll Binary files differdeleted file mode 100644 index 06209b7af6..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/GotDotNet.Exslt.dll +++ /dev/null diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/Schematron.cs b/src/System.Private.Xml/tests/Xslt/XsltScenarios/Schematron.cs deleted file mode 100644 index 7dda6bf18d..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/Schematron.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; -using Xunit.Abstractions; -using System.Globalization; -using System.IO; -using System.Xml; -using System.Xml.XPath; -using System.Xml.Xsl; -using XmlCoreTest.Common; - -namespace System.Xml.Tests -{ - //[TestCase(Name = "Schematron with XslTransform", Desc = "Test the Schematron Stylesheets with XslTransform", Pri = 2, Param = "v1")] - //[TestCase(Name = "Schematron with XslCompiledTransform", Desc = "Test the Schematron Stylesheets with XslCompiledTransform", Pri = 2, Param = "v2")] - public class Schematron //: CTestCase - { - /* - Refer to the page at http://www.xml.com/pub/a/2003/11/12/schematron.html for testing logic. - - Basically, Schematron schema (not XSD) is transformed using one of the Schematron stylesheets (basic) into a - Validating XSLT which in turn is used to transform the actual XML Instance - - Parameter 1 to the test is Schematron Schema - Parameter 2 to the test is the XML instance - Parameter 3 is the Schematron Stylesheet (schematron-basic.xsl, schematron-message.xsl, schematron-report.xsl) - */ - -#pragma warning disable 0618 - private XslTransform _xsltV1 = null; -#pragma warning restore 0618 - private XslCompiledTransform _xsltV2 = null; - - private TextWriter _sw = null; - private string _schemaFile = string.Empty; - private string _xmlFile = string.Empty; - private string _xslFile = string.Empty; - private string _baseline = string.Empty; - private string _outFile = "out.xml"; - private Utils _utils; - - private ITestOutputHelper _output; - public Schematron(ITestOutputHelper output) - { - _output = output; - } - - private void Init(string schemaFile, string xmlFile, string xslType, string baseline, string ver) - { - _utils = new Utils(_output); - -#pragma warning disable 0618 - if (ver == "v1") - _xsltV1 = new XslTransform(); -#pragma warning restore 0618 - - else if (ver == "v2") - _xsltV2 = new XslCompiledTransform(); - - _schemaFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + schemaFile); - _xmlFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + xmlFile); - if (baseline == string.Empty) - _baseline = string.Empty; - else - _baseline = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + ver + baseline); - - switch (xslType.ToLower()) - { - case "basic": - default: - _xslFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + "schematron-basic.xsl"); - break; - - case "message": - _xslFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + "schematron-message.xsl"); - break; - - case "report": - _xslFile = Path.Combine(@"TestFiles\", FilePathUtil.GetTestDataPath(), @"XsltScenarios\schematron\" + "schematron-report.xsl"); - break; - } - - //Delete the output file if it exists - if (File.Exists(_outFile)) - File.Delete(_outFile); - } - - private void GenerateValidatingXslt(string ver) - { - //Write the output to a string (using TextWriter) - _sw = new StringWriter(); - _output.WriteLine("Generating Validating XSLT using Schematron schema ..."); - - if (ver == "v1") - { - _xsltV1.Load(_xslFile, new XmlUrlResolver()); - XPathDocument doc = new XPathDocument(_schemaFile); - _xsltV1.Transform(doc, null, _sw); - } - else if (ver == "v2") - { - _xsltV2.Load(_xslFile, new XsltSettings(), new XmlUrlResolver()); - _xsltV2.Transform(_schemaFile, null, _sw); - } - } - - private void ValidateInstance(string ver) - { - XmlReader xr = XmlReader.Create(new StringReader(_sw.ToString())); - _output.WriteLine("Validating XML Instance using Validating XSLT ..."); - - if (ver == "v1") - { - _xsltV1.Load(xr, new XmlUrlResolver()); - _xsltV1.Transform(_xmlFile, _outFile); - } - else if (ver == "v2") - { - _xsltV2.Load(xr, new XsltSettings(), new XmlUrlResolver()); - _xsltV2.Transform(_xmlFile, _outFile); - } - - _utils.WriteFile(_outFile); - } - - //BinCompat TODO: Re-write and re-enable checksum tests - ////[Variation(id = 1, Desc = "Testing the XML Instance to have Male Gender when Title is Mr, using Basic Schematron Stylesheet", Pri = 2, Params = new object[] { "TestSchema.xml", "Test1.xml", "Basic", "Test1.txt" })] - //[InlineData("TestSchema.xml", "Test1.xml", "Basic", "Test1.txt", "v1")] - //[InlineData("TestSchema.xml", "Test1.xml", "Basic", "Test1.txt", "v2")] - ////[Variation(id = 2, Desc = "Testing the XML Instance to have Male Gender when Title is Mr, using Message Schematron Stylesheet", Pri = 0, Params = new object[] { "TestSchema.xml", "Test1.xml", "Message", "" })] - //[InlineData("TestSchema.xml", "Test1.xml", "Message", "", "v1")] - //[InlineData("TestSchema.xml", "Test1.xml", "Message", "", "v2")] - ////[Variation(id = 4, Desc = "Testing the XML Instance for a mandatory Title attribute, using Basic Schematron Stylesheet", Pri = 2, Params = new object[] { "TestSchema.xml", "Test4.xml", "Basic", "Test4.txt" })] - //[InlineData("TestSchema.xml", "Test4.xml", "Basic", "Test4.txt", "v1")] - //[InlineData("TestSchema.xml", "Test4.xml", "Basic", "Test4.txt", "v2")] - ////[Variation(id = 5, Desc = "Testing the XML Instance for a mandatory Title attribute, using Message Schematron Stylesheet", Pri = 0, Params = new object[] { "TestSchema.xml", "Test4.xml", "Message", "" })] - //[InlineData("TestSchema.xml", "Test4.xml", "Message", "", "v1")] - //[InlineData("TestSchema.xml", "Test4.xml", "Message", "", "v2")] - ////[Variation(id = 7, Desc = "Testing the XML Instance for unexpected children, using Basic Schematron Stylesheet", Pri = 2, Params = new object[] { "TestSchema.xml", "Test7.xml", "Basic", "Test7.txt" })] - //[InlineData("TestSchema.xml", "Test7.xml", "Basic", "Test7.txt", "v1")] - //[InlineData("TestSchema.xml", "Test7.xml", "Basic", "Test7.txt", "v2")] - ////[Variation(id = 8, Desc = "Testing the XML Instance for unexpected children, using Message Schematron Stylesheet", Pri = 0, Params = new object[] { "TestSchema.xml", "Test7.xml", "Message", "" })] - //[InlineData("TestSchema.xml", "Test7.xml", "Message", "", "v1")] - //[InlineData("TestSchema.xml", "Test7.xml", "Message", "", "v2")] - ////[Variation(id = 10, Desc = "Testing the XML Instance for children sequence, using Basic Schematron Stylesheet", Pri = 2, Params = new object[] { "TestSchema.xml", "Test10.xml", "Basic", "Test10.txt" })] - //[InlineData("TestSchema.xml", "Test10.xml", "Basic", "Test10.txt", "v1")] - //[InlineData("TestSchema.xml", "Test10.xml", "Basic", "Test10.txt", "v2")] - ////[Variation(id = 11, Desc = "Testing the XML Instance for children sequence, using Message Schematron Stylesheet", Pri = 0, Params = new object[] { "TestSchema.xml", "Test10.xml", "Message", "" })] - //[InlineData("TestSchema.xml", "Test10.xml", "Message", "", "v1")] - //[InlineData("TestSchema.xml", "Test10.xml", "Message", "", "v2")] - [Theory] - public void SchematronTest(object param0, object param1, object param2, object param3, object param4) - { - Init(param0.ToString(), param1.ToString(), param2.ToString(), param3.ToString(), param4.ToString()); - - GenerateValidatingXslt(param4.ToString()); - ValidateInstance(param4.ToString()); - _utils.VerifyChecksum(_outFile, _baseline); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/Utils.cs b/src/System.Private.Xml/tests/Xslt/XsltScenarios/Utils.cs deleted file mode 100644 index 03a955b1eb..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/Utils.cs +++ /dev/null @@ -1,184 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; -using Xunit.Abstractions; -using System; -using System.Globalization; -using System.IO; -using System.Xml; -using System.Xml.XmlDiff; - -namespace System.Xml.Tests -{ - internal class Utils //: CTestCase - { - private static ITestOutputHelper s_output; - public Utils(ITestOutputHelper output) - { - s_output = output; - } - - public static void VerifyTest(string actResult, string expResult) - { - XmlDiff.XmlDiff diff = new XmlDiff.XmlDiff(); - diff.Option = XmlDiffOption.IgnoreEmptyElement | XmlDiffOption.IgnoreAttributeOrder; - - XmlTextReader xrActual = new XmlTextReader(new StringReader(actResult)); - XmlTextReader xrExpected = new XmlTextReader(new StringReader(expResult)); - - bool bResult = false; - - try - { - bResult = diff.Compare(xrActual, xrExpected); - } - catch (Exception e) - { - bResult = false; - s_output.WriteLine("Exception thrown in XmlDiff compare!"); - s_output.WriteLine(e.ToString()); - } - finally - { - if (xrActual != null) xrActual.Dispose(); - if (xrExpected != null) xrExpected.Dispose(); - } - - s_output.WriteLine("Expected : " + expResult); - s_output.WriteLine("Actual : " + actResult); - - if (bResult) - return; - else - Assert.True(false); - } - - public void VerifyResult(string actualFile, string baselineFile) - { - XmlDiff.XmlDiff diff = new XmlDiff.XmlDiff(); - diff.Option = XmlDiffOption.IgnoreEmptyElement | XmlDiffOption.IgnoreAttributeOrder; - - XmlParserContext context = new XmlParserContext(new NameTable(), null, "", XmlSpace.None); - - using (FileStream fsActual = new FileStream(actualFile, FileMode.Open, FileAccess.Read)) - { - using (FileStream fsExpected = new FileStream(baselineFile, FileMode.Open, FileAccess.Read)) - { - XmlTextReader xrActual = new XmlTextReader(fsActual, XmlNodeType.Element, context); - XmlTextReader xrExpected = new XmlTextReader(fsExpected, XmlNodeType.Element, context); - - bool bResult = false; - - try - { - bResult = diff.Compare(xrActual, xrExpected); - } - catch (Exception e) - { - bResult = false; - s_output.WriteLine("Exception thrown in XmlDiff compare!"); - s_output.WriteLine(e.ToString()); - } - s_output.WriteLine("Actual result: "); - this.WriteFile(actualFile); - - if (bResult) - return; - else - { - s_output.WriteLine("Mismatch in XmlDiff"); - Assert.True(false); - } - } - } - } - - public void WriteFile(string fileName) - { - Char[] rgBuffer = new Char[4096]; - StreamReader fs = null; - - fs = new StreamReader(new FileStream(fileName, FileMode.Open, FileAccess.Read)); - - int cBytesRead = fs.Read(rgBuffer, 0, 4096); - while (cBytesRead > 0) - { - //_output.WriteLine(new string(rgBuffer)); - cBytesRead = fs.Read(rgBuffer, 0, 4096); - } - - if (fs != null) fs.Dispose(); - s_output.WriteLine(""); - } - - public void VerifyChecksum(string outFile, string baseline) - { - string actualChecksum = "0"; //For no output (empty string) checksums are 0 - string expectedCheckSum = "0"; //For no output (empty string) checksums are 0 - - if (outFile != string.Empty) - actualChecksum = CalcChecksum(outFile); - if (baseline != string.Empty) - expectedCheckSum = CalcChecksum(baseline); - - if (expectedCheckSum == actualChecksum) - return; - else - { - s_output.WriteLine("Actual checksum: {0}, Expected checksum: {1}", actualChecksum, expectedCheckSum); - s_output.WriteLine("Actual result: "); - WriteFile(outFile); - Assert.True(false); - } - } - - public string CalcChecksum(string fileName) - { - Decimal dResult = 0; // Numerical value of the checksum - int i = 0; // Generic counter - int cBytesRead = 1; // # of bytes read at one time - int cTotalRead = 0; // Total # of bytes read so far - Decimal dEndBuffer = 0; // Buffer to remove from the end (This is necessary because - // notepad adds CR/LF onto the end of every file) - Char[] rgBuffer = new Char[4096]; - - string xml = ""; - - StreamReader fs = null; - try - { - fs = new StreamReader(new FileStream(fileName, FileMode.Open, FileAccess.Read)); - cBytesRead = fs.Read(rgBuffer, 0, 4096); - while (cBytesRead > 0) - { - // Keep XML property up to date - xml = String.Concat(xml, new String(rgBuffer, 0, cBytesRead)); - - // Calculate the checksum - for (i = 0; i < cBytesRead; i++) - { - dResult += Math.Round((Decimal)(rgBuffer[i] / (cTotalRead + i + 1.0)), 10); - } - - cTotalRead += cBytesRead; - dEndBuffer = 0; - - // Keep reading (in case file is bigger than 4K) - cBytesRead = fs.Read(rgBuffer, 0, 4096); - } - } - catch (Exception ex) - { - s_output.WriteLine(ex.ToString()); - return ""; - } - finally - { - if (fs != null) fs.Dispose(); - } - return Convert.ToString(dResult - dEndBuffer, NumberFormatInfo.InvariantInfo); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.Tests.csproj b/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.Tests.csproj deleted file mode 100644 index 8285b594a2..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.Tests.csproj +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{540FB7C7-0B15-4592-927F-333761E9B727}</ProjectGuid> - <OutputType>Library</OutputType> - <AssemblyName>XsltScenarios.Tests</AssemblyName> - <RootNamespace>System.Xml.Tests</RootNamespace> - <NuGetTargetMoniker>.NETStandard,Version=v1.7</NuGetTargetMoniker> - </PropertyGroup> - <!-- Default configurations to help VS understand the configurations --> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - </PropertyGroup> - <ItemGroup> - <!--<Reference Include="GotDotNet.Exslt.dll" />--> - </ItemGroup> - <ItemGroup> - <!--<Compile Include="AspNet.cs" />--> - <Compile Include="EXslt.cs" /> - <Compile Include="Schematron.cs" /> - <Compile Include="Utils.cs" /> - <Compile Include="XunitAssemblyAttribute.cs" /> - <SupplementalTestData Include="..\TestFiles\**\*.*"> - <Link>TestFiles\%(RecursiveDir)%(Filename)%(Extension)</Link> - <DestinationDir>TestFiles\%(RecursiveDir)</DestinationDir> - </SupplementalTestData> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="$(CommonTestPath)\System\Xml\ModuleCore\ModuleCore.csproj"> - <Project>{3cf0cc76-4ce0-460a-ba37-657cfed39ab0}</Project> - <Name>ModuleCore</Name> - </ProjectReference> - <ProjectReference Include="$(CommonTestPath)\System\Xml\XmlCoreTest\XmlCoreTest.csproj"> - <Project>{89701565-f68b-46d9-bd78-95b0f052c50b}</Project> - <Name>XmlCoreTest</Name> - </ProjectReference> - <ProjectReference Include="$(CommonTestPath)\System\Xml\xmlDiff\XmlDiff.csproj"> - <Project>{466d87df-bdec-4e6c-bacd-317d79b8edbe}</Project> - <Name>XmlDiff</Name> - </ProjectReference> - <ProjectReference Include="..\..\..\..\System.Private.Xml\pkg\System.Private.Xml.pkgproj" /> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="XsltScenarios.xml" /> - </ItemGroup> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> -</Project>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.cs b/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.cs deleted file mode 100644 index 7d73d57551..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; -using Xunit.Abstractions; -using System; -using OLEDB.Test.ModuleCore; - -namespace System.Xml.Tests -{ - public static class TestInfo - { - public static string ControlFile = string.Empty; - public static string Path = string.Empty; - } - - /////////////////////////////////////////////////////////////////////////////////// - // CXsltScenarios (test module) - // - /////////////////////////////////////////////////////////////////////////////////// - //[TestModule(Desc = "This test module tests different XSLT Scenarios listed in XML Scenarios doc")] - public class CXsltScenarios : CTestModule - { - //Contstructor - public CXsltScenarios() - { - } - - public override void DetermineTestCases() - { - base.DetermineTestCases(); - } - - public String InitStringValue(String str) - { - throw new NotImplementedException(); - //object obj = CModInfo.GetOption(str); - - //if (obj == null) - //{ - // return String.Empty; - //} - //return obj.ToString(); - } - } -}
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.xml b/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.xml deleted file mode 100644 index bb9be9c103..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XsltScenarios.xml +++ /dev/null @@ -1,568 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<TestModule Name="XSLT" Desc="XsltScenarios Tests" Created="2/22/05" Modified="1/18/06"> - <Owner Alias="alexkr" Type="test" /> - <Data> - <FilePath>$(DataPath)\TestData\XsltScenarios\</FilePath> - <BaselinePath>out</BaselinePath> - </Data> - <TestCase Name="Scenarios" Desc="Testcase for XsltScenarios"> - <Variation Id="1" Pri="2" Desc="Xslt Scenarios : common-node-set"> - <Data> - <Xml>common-source.xml</Xml> - <Xsl>common-node-set.xsl</Xsl> - <Result Type="Valid">common-node-set.xml</Result> - </Data> - </Variation> - <Variation Id="2" Pri="2" Desc="Xslt Scenarios : common-object-type"> - <Data> - <Xml>common-source.xml</Xml> - <Xsl>common-object-type.xsl</Xsl> - <Result Type="Valid">common-object-type.xml</Result> - </Data> - </Variation> - <Variation Id="3" Pri="2" Desc="Xslt Scenarios : datetime-add-duration"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-add-duration.xsl</Xsl> - <Result Type="Valid">datetime-add-duration.xml</Result> - </Data> - </Variation> - <Variation Id="4" Pri="2" Desc="Xslt Scenarios : datetime-add"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-add.xsl</Xsl> - <Result Type="Valid">datetime-add.xml</Result> - </Data> - </Variation> - <Variation Id="5" Pri="2" Desc="Xslt Scenarios : datetime-avg"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-avg.xsl</Xsl> - <Result Type="Valid">datetime-avg.xml</Result> - </Data> - </Variation> - <Variation Id="6" Pri="2" Desc="Xslt Scenarios : datetime-date-time"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-date-time.xsl</Xsl> - <Result Type="Valid">datetime-date-time.xml</Result> - </Data> - </Variation> - <Variation Id="7" Pri="2" Desc="Xslt Scenarios : datetime-date"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-date.xsl</Xsl> - <Result Type="Valid">datetime-date.xml</Result> - </Data> - </Variation> - <Variation Id="8" Pri="2" Desc="Xslt Scenarios : datetime-day-abbreviation"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-day-abbreviation.xsl</Xsl> - <Result Type="Valid">datetime-day-abbreviation.xml</Result> - </Data> - </Variation> - <!-- Day name abbreviation has different value between win7 and win8. e.g. in Swedish, monday is 'on' on win7, and 'ons' on win8 - <Variation Id="9" Pri="2" Desc="Xslt Scenarios : datetime-day-abbreviation1"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-day-abbreviation1.xsl</Xsl> - <Result Type="Valid">datetime-day-abbreviation1.xml</Result> - </Data> - </Variation> --> - <Variation Id="10" Pri="2" Desc="Xslt Scenarios : datetime-day-in-month"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-day-in-month.xsl</Xsl> - <Result Type="Valid">datetime-day-in-month.xml</Result> - </Data> - </Variation> - <Variation Id="11" Pri="2" Desc="Xslt Scenarios : datetime-day-in-week"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-day-in-week.xsl</Xsl> - <Result Type="Valid">datetime-day-in-week.xml</Result> - </Data> - </Variation> - <Variation Id="12" Pri="2" Desc="Xslt Scenarios : datetime-day-in-year"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-day-in-year.xsl</Xsl> - <Result Type="Valid">datetime-day-in-year.xml</Result> - </Data> - </Variation> - <Variation Id="13" Pri="2" Desc="Xslt Scenarios : datetime-day-name"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-day-name.xsl</Xsl> - <Result Type="Valid">datetime-day-name.xml</Result> - </Data> - </Variation> - <Variation Id="14" Pri="2" Desc="Xslt Scenarios : datetime-day-name1"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-day-name1.xsl</Xsl> - <Result Type="Valid">datetime-day-name1.xml</Result> - </Data> - </Variation> - <Variation Id="15" Pri="2" Desc="Xslt Scenarios : datetime-day-of-week-in-month"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-day-of-week-in-month.xsl</Xsl> - <Result Type="Valid">datetime-day-of-week-in-month.xml</Result> - </Data> - </Variation> - <Variation Id="16" Pri="2" Desc="Xslt Scenarios : datetime-difference"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-difference.xsl</Xsl> - <Result Type="Valid">datetime-difference.xml</Result> - </Data> - </Variation> - <Variation Id="17" Pri="2" Desc="Xslt Scenarios : datetime-duration"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-duration.xsl</Xsl> - <Result Type="Valid">datetime-duration.xml</Result> - </Data> - </Variation> - <Variation Id="18" Pri="2" Desc="Xslt Scenarios : datetime-format-date"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-format-date.xsl</Xsl> - <Result Type="Valid">datetime-format-date.xml</Result> - </Data> - </Variation> - <Variation Id="19" Pri="2" Desc="Xslt Scenarios : datetime-hour-in-day"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-hour-in-day.xsl</Xsl> - <Result Type="Valid">datetime-hour-in-day.xml</Result> - </Data> - </Variation> - <Variation Id="20" Pri="2" Desc="Xslt Scenarios : datetime-leap-year"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-leap-year.xsl</Xsl> - <Result Type="Valid">datetime-leap-year.xml</Result> - </Data> - </Variation> - <Variation Id="21" Pri="2" Desc="Xslt Scenarios : datetime-max"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-max.xsl</Xsl> - <Result Type="Valid">datetime-max.xml</Result> - </Data> - </Variation> - <Variation Id="22" Pri="2" Desc="Xslt Scenarios : datetime-min"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-min.xsl</Xsl> - <Result Type="Valid">datetime-min.xml</Result> - </Data> - </Variation> - <Variation Id="23" Pri="2" Desc="Xslt Scenarios : datetime-minute-in-hour"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-minute-in-hour.xsl</Xsl> - <Result Type="Valid">datetime-minute-in-hour.xml</Result> - </Data> - </Variation> - <Variation Id="24" Pri="2" Desc="Xslt Scenarios : datetime-month-abbreviation"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-month-abbreviation.xsl</Xsl> - <Result Type="Valid">datetime-month-abbreviation.xml</Result> - </Data> - </Variation> - <Variation Id="25" Pri="2" Desc="Xslt Scenarios : datetime-month-abbreviation1"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-month-abbreviation1.xsl</Xsl> - <Result Type="Valid">datetime-month-abbreviation1.xml</Result> - </Data> - </Variation> - <Variation Id="26" Pri="2" Desc="Xslt Scenarios : datetime-month-in-year"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-month-in-year.xsl</Xsl> - <Result Type="Valid">datetime-month-in-year.xml</Result> - </Data> - </Variation> - <Variation Id="27" Pri="2" Desc="Xslt Scenarios : datetime-month-name"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-month-name.xsl</Xsl> - <Result Type="Valid">datetime-month-name.xml</Result> - </Data> - </Variation> - <Variation Id="28" Pri="2" Desc="Xslt Scenarios : datetime-month-name1"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>datetime-month-name1.xsl</Xsl> - <Result Type="Valid">datetime-month-name1.xml</Result> - </Data> - </Variation> - <Variation Id="29" Pri="2" Desc="Xslt Scenarios : datetime-parse-date"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-parse-date.xsl</Xsl> - <Result Type="Valid">datetime-parse-date.xml</Result> - </Data> - </Variation> - <Variation Id="30" Pri="2" Desc="Xslt Scenarios : datetime-second-in-minute"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-second-in-minute.xsl</Xsl> - <Result Type="Valid">datetime-second-in-minute.xml</Result> - </Data> - </Variation> - <Variation Id="31" Pri="2" Desc="Xslt Scenarios : datetime-seconds"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-seconds.xsl</Xsl> - <Result Type="Valid">datetime-seconds.xml</Result> - </Data> - </Variation> - <Variation Id="32" Pri="2" Desc="Xslt Scenarios : datetime-sum"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-sum.xsl</Xsl> - <Result Type="Valid">datetime-sum.xml</Result> - </Data> - </Variation> - <Variation Id="33" Pri="2" Desc="Xslt Scenarios : datetime-time"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-time.xsl</Xsl> - <Result Type="Valid">datetime-time.xml</Result> - </Data> - </Variation> - <Variation Id="34" Pri="2" Desc="Xslt Scenarios : datetime-week-in-month"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-week-in-month.xsl</Xsl> - <Result Type="Valid">datetime-week-in-month.xml</Result> - </Data> - </Variation> - <Variation Id="35" Pri="2" Desc="Xslt Scenarios : datetime-week-in-year"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-week-in-year.xsl</Xsl> - <Result Type="Valid">datetime-week-in-year.xml</Result> - </Data> - </Variation> - <Variation Id="36" Pri="2" Desc="Xslt Scenarios : datetime-year"> - <Data> - <Xml>datetime-source.xml</Xml> - <Xsl>datetime-year.xsl</Xsl> - <Result Type="Valid">datetime-year.xml</Result> - </Data> - </Variation> - <Variation Id="37" Pri="2" Desc="Xslt Scenarios : dynamic-evaluate"> - <Data> - <Xml>datetime-source1.xml</Xml> - <Xsl>dynamic-evaluate.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="38" Pri="2" Desc="Xslt Scenarios : math-abs"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-abs.xsl</Xsl> - <Result Type="Valid">math-abs.xml</Result> - </Data> - </Variation> - <Variation Id="39" Pri="2" Desc="Xslt Scenarios : math-acos"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-acos.xsl</Xsl> - <Result Type="Valid">math-acos.xml</Result> - <Result Type="Valid" TransformType="v2">math-acos2.xml</Result> - </Data> - </Variation> - <Variation Id="40" Pri="2" Desc="Xslt Scenarios : math-asin"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-asin.xsl</Xsl> - <Result Type="Valid">math-asin.xml</Result> - <Result Type="Valid" TransformType="v2">math-asin2.xml</Result> - </Data> - </Variation> - <Variation Id="41" Pri="2" Desc="Xslt Scenarios : math-atan"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-atan.xsl</Xsl> - <Result Type="Valid">math-atan.xml</Result> - <Result Type="Valid" TransformType="v2">math-atan_2.xml</Result> - </Data> - </Variation> - <Variation Id="42" Pri="2" Desc="Xslt Scenarios : math-atan2"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-atan2.xsl</Xsl> - <Result Type="Valid">math-atan2.xml</Result> - <Result Type="Valid" TransformType="v2">math-atan2_2.xml</Result> - </Data> - </Variation> - <Variation Id="43" Pri="2" Desc="Xslt Scenarios : math-avg"> - <Data> - <Xml>math-source1.xml</Xml> - <Xsl>math-avg.xsl</Xsl> - <Result Type="Valid">math-avg.xml</Result> - </Data> - </Variation> - <Variation Id="44" Pri="2" Desc="Xslt Scenarios : math-constant"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-constant.xsl</Xsl> - <Result Type="Valid">math-constant.xml</Result> - <Result Type="Valid" TransformType="v2">math-constant2.xml</Result> - </Data> - </Variation> - <Variation Id="45" Pri="2" Desc="Xslt Scenarios : math-cos"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-cos.xsl</Xsl> - <Result Type="Valid">math-cos.xml</Result> - <Result Type="Valid" TransformType="v2">math-cos2.xml</Result> - </Data> - </Variation> - <Variation Id="46" Pri="2" Desc="Xslt Scenarios : math-exp"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-exp.xsl</Xsl> - <Result Type="Valid">math-exp.xml</Result> - <Result Type="Valid" TransformType="v2">math-exp2.xml</Result> - </Data> - </Variation> - <Variation Id="47" Pri="2" Desc="Xslt Scenarios : math-highest"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-highest.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="48" Pri="2" Desc="Xslt Scenarios : math-log"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-log.xsl</Xsl> - <Result Type="Valid">math-log.xml</Result> - <Result Type="Valid" TransformType="v2">math-log2.xml</Result> - </Data> - </Variation> - <Variation Id="49" Pri="2" Desc="Xslt Scenarios : math-lowest"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-lowest.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="50" Pri="2" Desc="Xslt Scenarios : math-max"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-max.xsl</Xsl> - <Result Type="Valid">math-max.xml</Result> - </Data> - </Variation> - <Variation Id="51" Pri="2" Desc="Xslt Scenarios : math-min"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-min.xsl</Xsl> - <Result Type="Valid">math-min.xml</Result> - </Data> - </Variation> - <Variation Id="52" Pri="2" Desc="Xslt Scenarios : math-power"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-power.xsl</Xsl> - <Result Type="Valid">math-power.xml</Result> - </Data> - </Variation> - <Variation Id="53" Pri="2" Desc="Xslt Scenarios : math-random"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-random.xsl</Xsl> - <Result Type="Valid">math-random.xml</Result> - </Data> - </Variation> - <Variation Id="54" Pri="2" Desc="Xslt Scenarios : math-sin"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-sin.xsl</Xsl> - <Result Type="Valid">math-sin.xml</Result> - <Result Type="Valid" TransformType="v2">math-sin2.xml</Result> - </Data> - </Variation> - <Variation Id="55" Pri="2" Desc="Xslt Scenarios : math-sqrt"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-sqrt.xsl</Xsl> - <Result Type="Valid">math-sqrt.xml</Result> - </Data> - </Variation> - <Variation Id="56" Pri="2" Desc="Xslt Scenarios : math-tan"> - <Data> - <Xml>math-source.xml</Xml> - <Xsl>math-tan.xsl</Xsl> - <Result Type="Valid">math-tan.xml</Result> - <Result Type="Valid" TransformType="v2">math-tan2.xml</Result> - </Data> - </Variation> - <Variation Id="57" Pri="2" Desc="Xslt Scenarios : random-sequence"> - <Data> - <Xml>random-source.xml</Xml> - <Xsl>random-sequence.xslt</Xsl> - <Result Type="Valid">random-sequence.xml</Result> - <!--Result Type="Invalid" ExceptionId="XsltException" /--> - </Data> - </Variation> - <Variation Id="58" Pri="2" Desc="Xslt Scenarios : regex-match"> - <Data> - <Xml>regex-source.xml</Xml> - <Xsl>regex-match.xsl</Xsl> - <Result Type="Valid">regex-match.xml</Result> - </Data> - </Variation> - <Variation Id="59" Pri="2" Desc="Xslt Scenarios : regex-replace"> - <Data> - <Xml>regex-source.xml</Xml> - <Xsl>regex-replace.xsl</Xsl> - <Result Type="Valid">regex-replace.xml</Result> - </Data> - </Variation> - <Variation Id="60" Pri="2" Desc="Xslt Scenarios : regex-test"> - <Data> - <Xml>regex-source.xml</Xml> - <Xsl>regex-test.xsl</Xsl> - <Result Type="Valid">regex-test.xml</Result> - </Data> - </Variation> - <Variation Id="61" Pri="2" Desc="Xslt Scenarios : regex-tokenize"> - <Data> - <Xml>regex-source1.xml</Xml> - <Xsl>regex-tokenize.xsl</Xsl> - <Result Type="Valid">regex-tokenize.xml</Result> - </Data> - </Variation> - <Variation Id="62" Pri="2" Desc="Xslt Scenarios : sets-difference"> - <Data> - <Xml>sets-source.xml</Xml> - <Xsl>sets-difference.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="63" Pri="2" Desc="Xslt Scenarios : sets-distinct"> - <Data> - <Xml>sets-source.xml</Xml> - <Xsl>sets-distinct.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="64" Pri="2" Desc="Xslt Scenarios : sets-has-same-node"> - <Data> - <Xml>sets-source.xml</Xml> - <Xsl>sets-has-same-node.xsl</Xsl> - <Result Type="Valid">sets-has-same-node.xml</Result> - </Data> - </Variation> - <Variation Id="65" Pri="2" Desc="Xslt Scenarios : sets-intersection"> - <Data> - <Xml>sets-source.xml</Xml> - <Xsl>sets-intersection.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="66" Pri="2" Desc="Xslt Scenarios : sets-leading"> - <Data> - <Xml>sets-source.xml</Xml> - <Xsl>sets-leading.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="67" Pri="2" Desc="Xslt Scenarios : sets-subset"> - <Data> - <Xml>sets-source1.xml</Xml> - <Xsl>sets-subset.xsl</Xsl> - <Result Type="Valid">sets-subset.xml</Result> - </Data> - </Variation> - <Variation Id="68" Pri="2" Desc="Xslt Scenarios : sets-trailing"> - <Data> - <Xml>sets-source.xml</Xml> - <Xsl>sets-trailing.xsl</Xsl> - <Result Type="Invalid" ExceptionId="XsltException" /> - </Data> - </Variation> - <Variation Id="69" Pri="2" Desc="Xslt Scenarios : string-align"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-align.xsl</Xsl> - <Result Type="Valid">string-align.xml</Result> - </Data> - </Variation> - <Variation Id="70" Pri="2" Desc="Xslt Scenarios : string-concat"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-concat.xsl</Xsl> - <Result Type="Valid">string-concat.xml</Result> - </Data> - </Variation> - <Variation Id="71" Pri="2" Desc="Xslt Scenarios : string-decode-uri"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-decode-uri.xsl</Xsl> - <Result Type="Valid">string-decode-uri.xml</Result> - </Data> - </Variation> - <Variation Id="72" Pri="2" Desc="Xslt Scenarios : string-encode-uri"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-encode-uri.xsl</Xsl> - <Result Type="Valid">string-encode-uri.xml</Result> - </Data> - </Variation> - <Variation Id="73" Pri="2" Desc="Xslt Scenarios : string-lowercase"> - <Data> - <Xml>string-source1.xml</Xml> - <Xsl>string-lowercase.xsl</Xsl> - <Result Type="Valid">string-lowercase.xml</Result> - </Data> - </Variation> - <Variation Id="74" Pri="2" Desc="Xslt Scenarios : string-padding"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-padding.xsl</Xsl> - <Result Type="Valid">string-padding.xml</Result> - </Data> - </Variation> - <Variation Id="75" Pri="2" Desc="Xslt Scenarios : string-replace"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-replace.xsl</Xsl> - <Result Type="Valid">string-replace.xml</Result> - </Data> - </Variation> - <Variation Id="76" Pri="2" Desc="Xslt Scenarios : string-split"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-split.xsl</Xsl> - <Result Type="Valid">string-split.xml</Result> - </Data> - </Variation> - <Variation Id="77" Pri="2" Desc="Xslt Scenarios : string-tokenize"> - <Data> - <Xml>string-source.xml</Xml> - <Xsl>string-tokenize.xsl</Xsl> - <Result Type="Valid">string-tokenize.xml</Result> - </Data> - </Variation> - <Variation Id="78" Pri="2" Desc="Xslt Scenarios : string-uppercase"> - <Data> - <Xml>string-source1.xml</Xml> - <Xsl>string-uppercase.xsl</Xsl> - <Result Type="Valid">string-uppercase.xml</Result> - </Data> - </Variation> - </TestCase> -</TestModule>
\ No newline at end of file diff --git a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XunitAssemblyAttribute.cs b/src/System.Private.Xml/tests/Xslt/XsltScenarios/XunitAssemblyAttribute.cs deleted file mode 100644 index 3662eacea4..0000000000 --- a/src/System.Private.Xml/tests/Xslt/XsltScenarios/XunitAssemblyAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Xunit; - -// For testing purposes, we keep the output of the Transform in a file. -// Since the content of the file ends up affecting the result of each test, -// we want to avoid parallelism so that one test doesn't affect another. -[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true, MaxParallelThreads = 1)] |