From: Oleg T. <he...@us...> - 2004-10-16 21:03:25
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1218/v1/test Added Files: EdUniTests.cs FourThoughtTests.cs ImaqTests.cs NistTests.cs Log Message: XInclude Test Suite stuff. --- NEW FILE: EdUniTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// Edinburgh University test cases from the XInclude Test suite. /// </summary> [TestFixture] public class EdUniTests { public EdUniTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/EdUni/test/" + source, "../../XInclude-Test-Suite/EdUni/result/" + result); } /// <summary> /// Simple whole-file inclusion. /// </summary> [Test] public void Test1() { RunAndCompare("book.xml", "book.xml"); } /// <summary> /// Verify that xi:include elements in the target have /// been processed in the acquired infoset, ie before /// the xpointer is applied. /// </summary> [Test] public void Test2() { RunAndCompare("extract.xml", "extract.xml"); } } } --- NEW FILE: ImaqTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// Redhat test cases from the XInclude Test suite. /// </summary> [TestFixture] public class ImaqTests { public ImaqTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/Imaq/test/XInclude/docs/" + source, "../../XInclude-Test-Suite/Imaq/result/XInclude/" + result); } /// <summary> /// Simple test of including another XML document. /// </summary> [Test] public void Test1() { RunAndCompare("include.xml", "include.xml"); } /// <summary> /// Test recursive inclusion. /// </summary> [Test] public void Test2() { RunAndCompare("recursive.xml", "recursive.xml"); } /// <summary> /// Simple test of including another text document. /// </summary> [Test] public void Test3() { RunAndCompare("nodes.xml", "nodes.xml"); } /// <summary> /// including another XML document with IDs. /// </summary> [Test] public void Test4() { RunAndCompare("docids.xml", "docids.xml"); } /// <summary> /// Simple test of including another text documents /// </summary> [Test] public void Test5() { RunAndCompare("txtinclude.xml", "txtinclude.xml"); } /// <summary> /// Simple test of a fallback on unavailable URI. /// </summary> [Test] public void Test6() { RunAndCompare("fallback.xml", "fallback.xml"); } } } --- NEW FILE: FourThoughtTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// FourThough test cases from the XInclude Test suite. /// </summary> [TestFixture] public class FourThoughtTests { public FourThoughtTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/FourThought/test/XInclude/docs/" + source, "../../XInclude-Test-Suite/FourThought/result/XInclude/" + result); } /// <summary> /// Simple test of including another XML document. /// </summary> [Test] public void Test1() { RunAndCompare("ft-include1.xml", "include1.xml"); } /// <summary> /// Test recursive inclusion. /// </summary> [Test] public void Test2() { RunAndCompare("ft-include2.xml", "include2.xml"); } /// <summary> /// Simple test of including another text document. /// </summary> [Test] public void Test3() { RunAndCompare("ft-include3.xml", "include3.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test4() { RunAndCompare("ft-include4.xml", "include4.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test5() { RunAndCompare("ft-include5.xml", "include5.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test6() { RunAndCompare("ft-include6.xml", "include6.xml"); } /// <summary> /// Simple test of including a set of nodes from an XML document. /// </summary> [Test] public void Test7() { RunAndCompare("ft-include7.xml", "include7.xml"); } } } --- NEW FILE: NistTests.cs --- using System; using System.Diagnostics; using System.Xml; using System.IO; using System.Text; using Mvp.Xml.XInclude; using NUnit.Framework; namespace Mvp.Xml.XInclude.Test { /// <summary> /// NIST test cases from the XInclude Test suite. /// </summary> [TestFixture] public class NistTests { public NistTests() { Debug.Listeners.Add(new TextWriterTraceListener(Console.Error)); } /// <summary> /// Utility method for running tests. /// </summary> public static void RunAndCompare(string source, string result) { XIncludeReaderTests.RunAndCompare( "../../XInclude-Test-Suite/Nist/test/docs/" + source, "../../XInclude-Test-Suite/Nist/result/" + result); } /// <summary> /// /// </summary> [Test] public void Test1() { RunAndCompare("nist-include-01.xml", "nist-include-01.xml"); } /// <summary> /// /// </summary> [Test] public void Test2() { RunAndCompare("nist-include-02.xml", "nist-include-02.xml"); } /// <summary> /// Test that values other than "xml" and "text" in the parse /// attribute of the XInclude element will generate a fatal error. /// Negative test. /// </summary> [Test] [ExpectedException(typeof(UnknownParseAttributeValueException))] public void Test3() { RunAndCompare("nist-include-03.xml", "nist-include-03.xml"); } /// <summary> /// /// </summary> [Test] public void Test4() { RunAndCompare("nist-include-04.xml", "nist-include-04.xml"); } /// <summary> /// Test a fallback element not appearing as a direct child of /// an xinclude element. A fatal error should be generated. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test5() { RunAndCompare("nist-include-05.xml", "nist-include-05.xml"); } /// <summary> /// /// </summary> [Test] public void Test6() { RunAndCompare("nist-include-06.xml", "nist-include-06.xml"); } /// <summary> /// /// </summary> [Test] public void Test7() { RunAndCompare("nist-include-07.xml", "nist-include-07.xml"); } /// <summary> /// Test that when the fallback element is missing, from the /// include element, a resource error results in a fatal error. /// Negative test. /// </summary> [Test] [ExpectedException(typeof(FatalResourceException))] public void Test8() { RunAndCompare("nist-include-08.xml", "nist-include-08.xml"); } /// <summary> /// /// </summary> [Test] public void Test9() { RunAndCompare("nist-include-09.xml", "nist-include-09.xml"); } /// <summary> /// /// </summary> [Test] public void Test10() { RunAndCompare("nist-include-10.xml", "nist-include-10.xml"); } /// <summary> /// Test a resource containing non-well-formed XML. /// The inclusion results in a fatal error. /// </summary> [Test] [ExpectedException(typeof(FatalResourceException))] public void Test11() { RunAndCompare("nist-include-11.xml", "nist-include-11.xml"); } /// <summary> /// Test that is a fatal error for an include element to contain more /// than one fallback elements. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test12() { RunAndCompare("nist-include-12.xml", "nist-include-12.xml"); } /// <summary> /// /// </summary> [Test] public void Test13() { RunAndCompare("nist-include-13.xml", "nist-include-13.xml"); } /// <summary> /// /// </summary> [Test] public void Test14() { RunAndCompare("nist-include-14.xml", "nist-include-14.xml"); } /// <summary> /// It is illegal for an include element to point to itself, /// when parse="xml". /// </summary> [Test] [ExpectedException(typeof(CircularInclusionException))] public void Test15() { RunAndCompare("nist-include-15.xml", "nist-include-15.xml"); } /// <summary> /// /// </summary> [Test] public void Test16() { RunAndCompare("nist-include-16.xml", "nist-include-16.xml"); } /// <summary> /// /// </summary> [Test] public void Test17() { RunAndCompare("nist-include-17.xml", "nist-include-17.xml"); } /// <summary> /// /// </summary> [Test] public void Test18() { RunAndCompare("nist-include-18.xml", "nist-include-18.xml"); } /// <summary> /// /// </summary> [Test] public void Test19() { RunAndCompare("nist-include-19.xml", "nist-include-19.xml"); } /// <summary> /// /// </summary> [Test] public void Test20() { RunAndCompare("nist-include-20.xml", "nist-include-20.xml"); } /// <summary> /// /// </summary> [Test] public void Test21() { RunAndCompare("nist-include-21.xml", "nist-include-21.xml"); } /// <summary> /// /// </summary> [Test] public void Test22() { RunAndCompare("nist-include-22.xml", "nist-include-22.xml"); } /// <summary> /// Testing an include element in the document (top-level) element /// in the source doc. /// Test should fail because is including more than one element. /// </summary> [Test] public void Test23() { RunAndCompare("nist-include-23.xml", "nist-include-23.xml"); } /// <summary> /// /// </summary> [Test] public void Test24() { RunAndCompare("nist-include-24.xml", "nist-include-24.xml"); } /// <summary> /// /// </summary> [Test] public void Test25() { RunAndCompare("nist-include-25.xml", "nist-include-25.xml"); } /// <summary> /// /// </summary> [Test] public void Test26() { RunAndCompare("nist-include-26.xml", "nist-include-26.xml"); } /// <summary> /// /// </summary> [Test] public void Test27() { RunAndCompare("nist-include-27.xml", "nist-include-27.xml"); } /// <summary> /// /// </summary> [Test] public void Test28() { RunAndCompare("nist-include-28.xml", "nist-include-28.xml"); } /// <summary> /// /// </summary> [Test] public void Test29() { RunAndCompare("nist-include-29.xml", "nist-include-29.xml"); } /// <summary> /// /// </summary> [Test] public void Test30() { RunAndCompare("nist-include-30.xml", "nist-include-30.xml"); } /// <summary> /// /// </summary> [Test] public void Test31() { RunAndCompare("nist-include-31.xml", "nist-include-31.xml"); } /// <summary> /// /// </summary> [Test] public void Test32() { RunAndCompare("nist-include-32.xml", "nist-include-32.xml"); } /// <summary> /// /// </summary> [Test] public void Test33() { RunAndCompare("nist-include-33.xml", "nist-include-34.xml"); } /// <summary> /// /// </summary> [Test] public void Test35() { RunAndCompare("nist-include-35.xml", "nist-include-35.xml"); } /// <summary> /// /// </summary> [Test] public void Test36() { RunAndCompare("nist-include-36.xml", "nist-include-36.xml"); } /// <summary> /// /// </summary> [Test] public void Test37() { RunAndCompare("nist-include-37.xml", "nist-include-37.xml"); } /// <summary> /// /// </summary> [Test] public void Test38() { RunAndCompare("nist-include-38.xml", "nist-include-38.xml"); } /// <summary> /// /// </summary> [Test] public void Test39() { RunAndCompare("nist-include-39.xml", "nist-include-39.xml"); } /// <summary> /// /// </summary> [Test] public void Test40() { RunAndCompare("nist-include-40.xml", "nist-include-40.xml"); } /// <summary> /// The content of the include element is another /// include element, this test should result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test41() { RunAndCompare("nist-include-41.xml", "nist-include-41.xml"); } /// <summary> /// Testing the content of the xinclude element. This test should result /// in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test42() { RunAndCompare("nist-include-42.xml", "nist-include-42.xml"); } /// <summary> /// Testing the content of the xinclude element. This test /// should result in a fatal error. The content must be one fallback. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test43() { RunAndCompare("nist-include-43.xml", "nist-include-43.xml"); } /// <summary> /// /// </summary> [Test] public void Test44() { RunAndCompare("nist-include-44.xml", "nist-include-44.xml"); } /// <summary> /// /// </summary> [Test] public void Test45() { RunAndCompare("nist-include-45.xml", "nist-include-45.xml"); } /// <summary> /// Testing the content of the xinclude element. The xinclude element /// may contain a fallback element; other elements from the /// xinclude namespace result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test46() { RunAndCompare("nist-include-46.xml", "nist-include-46.xml"); } /// <summary> /// Testing the content of the xinclude element. The xinclude /// element may contain a fallback element; other elements from /// the xinclude namespace result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(XIncludeSyntaxError))] public void Test47() { RunAndCompare("nist-include-47.xml", "nist-include-47.xml"); } /// <summary> /// /// </summary> [Test] public void Test48() { RunAndCompare("nist-include-48.xml", "nist-include-48.xml"); } /// <summary> /// /// </summary> [Test] public void Test49() { RunAndCompare("nist-include-49.xml", "nist-include-49.xml"); } /// <summary> /// /// </summary> [Test] public void Test50() { RunAndCompare("nist-include-50.xml", "nist-include-50.xml"); } /// <summary> /// /// </summary> [Test] public void Test51() { RunAndCompare("nist-include-51.xml", "nist-include-51.xml"); } /// <summary> /// /// </summary> [Test] public void Test52() { RunAndCompare("nist-include-52.xml", "nist-include-52.xml"); } /// <summary> /// Test that an include location identifying an attribute node /// will result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(AttributeOrNamespaceInIncludeLocationError))] public void Test53() { RunAndCompare("nist-include-53.xml", "nist-include-53.xml"); } /// <summary> /// Test that an include location identifying an attribute node /// will result in a fatal error. /// </summary> [Test] [ExpectedException(typeof(AttributeOrNamespaceInIncludeLocationError))] public void Test54() { RunAndCompare("nist-include-54.xml", "nist-include-54.xml"); } /// <summary> /// /// </summary> [Test] public void Test55() { RunAndCompare("nist-include-55.xml", "nist-include-55.xml"); } /// <summary> /// /// </summary> [Test] public void Test56() { RunAndCompare("nist-include-56.xml", "nist-include-56.xml"); } } } |