From: Oleg T. <he...@us...> - 2004-11-01 08:04:12
|
Update of /cvsroot/mvp-xml/XInclude/v1/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27513/v1/test Modified Files: Elliotte_Rusty_HaroldTests.cs LTG_Edinburgh_UnivTests.cs NistTests.cs Log Message: Adjusting test suite. Index: LTG_Edinburgh_UnivTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/LTG_Edinburgh_UnivTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- LTG_Edinburgh_UnivTests.cs 1 Nov 2004 05:44:44 -0000 1.3 +++ LTG_Edinburgh_UnivTests.cs 1 Nov 2004 08:04:00 -0000 1.4 @@ -46,6 +46,7 @@ /// <summary> /// Verify that xi:include elements in the target have been processed in the acquired infoset, ie before the xpointer is applied. /// </summary> + /// <remarks>XIncludingReader doesn't support </remarks> [Test] public void eduni_2() { Index: Elliotte_Rusty_HaroldTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/Elliotte_Rusty_HaroldTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Elliotte_Rusty_HaroldTests.cs 1 Nov 2004 05:44:44 -0000 1.5 +++ Elliotte_Rusty_HaroldTests.cs 1 Nov 2004 08:04:00 -0000 1.6 @@ -82,7 +82,9 @@ /// An include element includes its following sibling element, which has a child /// include element including the sibling element after that one. /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_05() { RunAndCompare("marshtest.xml", "../result/marshtest.xml"); @@ -93,7 +95,9 @@ /// <summary> /// Include a document that uses XPointers to reference various parts of itself /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_06() { RunAndCompare("includedocumentwithintradocumentreferences.xml", "../result/includedocumentwithintradocumentreferences.xml"); @@ -142,7 +146,9 @@ /// xml:base attribute is not used to resolve a missing href. /// According to RFC 2396 empty string URI always refers to the current document irrespective of base URI. /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_10() { RunAndCompare("marshtestwithxmlbase.xml", "../result/marshtestwithxmlbase.xml"); @@ -154,7 +160,9 @@ /// <summary> /// There's no difference between href="" and no href attribute. /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_11() { RunAndCompare("marshtestwithxmlbaseandemptyhref.xml", "../result/marshtestwithxmlbase.xml"); @@ -166,7 +174,9 @@ /// <summary> /// Make sure base URIs are preserved when including from the same document. /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_12() { RunAndCompare("includefromsamedocumentwithbase.xml", "../result/includefromsamedocumentwithbase.xml"); @@ -177,8 +187,9 @@ /// <summary> /// Syntactically incorrect IRI is a fatal error (Eitehr I'm missing something or the spec needs to state this prinicple more clearly.) /// </summary> + /// <remarks>We treat it as resource error</remarks> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(DirectoryNotFoundException))] public void harold_13() { RunAndCompare("badiri.xml", ""); @@ -189,8 +200,9 @@ /// <summary> /// Syntactically incorrect IRI with an unrecognized scheme is a fatal error /// </summary> + /// <remarks>We treat it as resource error</remarks> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(DirectoryNotFoundException))] public void harold_14() { RunAndCompare("badiri2.xml", ""); @@ -213,7 +225,7 @@ /// accept attribute contains carriage-return/linefeed pair /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(InvalidAcceptHTTPHeaderValue))] public void harold_16() { RunAndCompare("badaccept1.xml", ""); @@ -225,7 +237,7 @@ /// accept attribute contains Latin-1 character (non-breaking space) /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(InvalidAcceptHTTPHeaderValue))] public void harold_17() { RunAndCompare("badaccept2.xml", ""); @@ -269,7 +281,9 @@ /// <summary> /// An included document can use a fallback that points into the included document /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_21() { RunAndCompare("metafallbacktest6.xml", "../result/metafallbacktest6.xml"); @@ -292,7 +306,7 @@ /// A fallback element in an included document contains an include element with a parse attribute with an illegal value. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(UnknownParseAttributeValueException))] public void harold_23() { RunAndCompare("metafallbacktest3.xml", ""); @@ -304,7 +318,7 @@ /// A fallback element in an included document contains an include element with neither an xpointer nor an href attribute. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(MissingHrefAndXpointerException))] public void harold_24() { RunAndCompare("metafallbacktest4.xml", ""); @@ -317,7 +331,7 @@ /// A fallback element in an included document contains an include element whose href attribute has a fragment ID. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FragmentIdentifierInHrefAttribute))] public void harold_25() { RunAndCompare("metafallbacktestwithfragmentid.xml", ""); @@ -329,7 +343,7 @@ /// The XPointer does not select anything in the acquired infoset, but does select something in the source infoset. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_26() { RunAndCompare("metafallbacktest5.xml", ""); @@ -377,7 +391,7 @@ /// then fails to find a resource, which is a fatal error if there's no fallback. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_30() { RunAndCompare("metamissingfallbacktestwithxpointer.xml", ""); @@ -390,7 +404,7 @@ /// then fails to find a resource, but it has a fallback, which itself has an include child, which then throws a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_31() { RunAndCompare("metafallbackwithbadxpointertest.xml", ""); @@ -413,7 +427,7 @@ /// An include element points to a document that includes it, using an xpointer to select part of that document. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(CircularInclusionException))] public void harold_33() { RunAndCompare("legalcircle.xml", ""); @@ -424,7 +438,9 @@ /// <summary> /// An include element points to another include element in the same document. /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_34() { RunAndCompare("recursewithinsamedocument.xml", "../result/recursewithinsamedocument.xml"); @@ -458,7 +474,7 @@ /// Detect an inclusion loop when an include element refers to itself /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_37() { RunAndCompare("internalcircular.xml", ""); @@ -471,7 +487,7 @@ /// in the same document /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_38() { RunAndCompare("internalcircularviaancestor.xml", ""); @@ -528,7 +544,7 @@ /// testIncludeElementsCannotHaveIncludeChildren /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void harold_43() { RunAndCompare("nestedxinclude.xml", ""); @@ -540,7 +556,7 @@ /// Include elements cannot have children from the xinclude namespace except for fallback. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void harold_44() { RunAndCompare("nestedxincludenamespace.xml", ""); @@ -552,7 +568,7 @@ /// Fallback can only be a child of xinclude element /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void harold_45() { RunAndCompare("nakedfallback.xml", ""); @@ -564,7 +580,7 @@ /// A fallback element cannot have a fallback child element. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void harold_46() { RunAndCompare("fallbackcontainsfallback.xml", ""); @@ -578,7 +594,7 @@ /// In this test the fallback is activated. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void harold_47() { RunAndCompare("multiplefallbacks.xml", ""); @@ -592,7 +608,7 @@ /// In this test the fallback is not activated. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void harold_48() { RunAndCompare("multiplefallbacks2.xml", ""); @@ -604,7 +620,7 @@ /// A document cannot include itself /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(CircularInclusionException))] public void harold_49() { RunAndCompare("circle1.xml", ""); @@ -616,7 +632,7 @@ /// Document A includes document B which includes document A /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(CircularInclusionException))] public void harold_50() { RunAndCompare("circle2a.xml", ""); @@ -628,7 +644,7 @@ /// Include element is missing an href and xpointer attribute /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(MissingHrefAndXpointerException))] public void harold_51() { RunAndCompare("missinghref.xml", ""); @@ -640,7 +656,7 @@ /// parse attribute must have value xml or text /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(UnknownParseAttributeValueException))] public void harold_52() { RunAndCompare("badparseattribute.xml", ""); @@ -652,7 +668,7 @@ /// Missing resource is fatal when there's no fallback /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_53() { RunAndCompare("missingfile.xml", ""); @@ -708,7 +724,7 @@ /// XPointer that selects nothing is a resource error, and fatal because there's no fallback. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_58() { RunAndCompare("xptridtest2.xml", ""); @@ -743,7 +759,7 @@ /// the second XPointer part is still a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_61() { RunAndCompare("laterfailure.xml", ""); @@ -756,7 +772,7 @@ /// the second XPointer part is still a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_62() { RunAndCompare("laterfailure2.xml", ""); @@ -767,7 +783,9 @@ /// <summary> /// You can include another element from the same document without an href attribute. /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void harold_63() { RunAndCompare("onlyxpointer.xml", "../result/onlyxpointer.xml"); @@ -843,7 +861,7 @@ /// An XPointer that doesn't point to anything is a resource error; and fatal because there's no fallback /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_69() { RunAndCompare("xptrtumblertest2.xml", ""); @@ -855,7 +873,7 @@ /// Syntax error in an XPointer is a resource error; and fatal because there's no fallback /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_70() { RunAndCompare("badxptr.xml", ""); @@ -867,7 +885,7 @@ /// Syntax error in an XPointer is a resource error; and fatal because there's no fallback /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FragmentIdentifierInHrefAttribute))] public void harold_71() { RunAndCompare("badxptr2.xml", ""); @@ -967,7 +985,7 @@ /// Syntax error in an XPointer is a resource error; and fatal becaue there's no fallback /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_80() { RunAndCompare("badxptr3.xml", ""); @@ -979,7 +997,7 @@ /// Syntax error in an XPointer is a resource error; and fatal becaue there's no fallback /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_81() { RunAndCompare("badxptr4.xml", ""); @@ -991,7 +1009,7 @@ /// Circular references via xpointer are fatal /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(CircularInclusionException))] public void harold_82() { RunAndCompare("circlepointer1.xml", ""); @@ -1003,7 +1021,7 @@ /// href attribute with fragment ID is a fatal error even when there's an xpointer attribute /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FragmentIdentifierInHrefAttribute))] public void harold_83() { RunAndCompare("xpointeroverridesfragmentid.xml", ""); @@ -1015,7 +1033,7 @@ /// href attribute with fragment ID is a fatal error /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FragmentIdentifierInHrefAttribute))] public void harold_84() { RunAndCompare("ignoresfragmentid.xml", ""); @@ -1039,7 +1057,7 @@ /// syntax of fragment IDs from RFC 2396. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FragmentIdentifierInHrefAttribute))] public void harold_86() { RunAndCompare("meaninglessfragmentid.xml", ""); @@ -1107,7 +1125,7 @@ /// Unrecognized scheme in XPointer is a fatal error if there's no fallback /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void harold_91() { RunAndCompare("unrecognizedscheme.xml", ""); @@ -1141,7 +1159,7 @@ /// Included document has an include element with neither href nor xpointer attribute /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(MissingHrefAndXpointerException))] public void harold_94() { RunAndCompare("toplevel.xml", ""); Index: NistTests.cs =================================================================== RCS file: /cvsroot/mvp-xml/XInclude/v1/test/NistTests.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- NistTests.cs 1 Nov 2004 05:44:44 -0000 1.5 +++ NistTests.cs 1 Nov 2004 08:04:00 -0000 1.6 @@ -58,7 +58,7 @@ /// element, result in fatal errors. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(UnknownParseAttributeValueException))] public void Nist_include_03() { RunAndCompare("nist-include-03.xml", ""); @@ -82,7 +82,7 @@ /// child of an xinclude element. A fatal error should be generated. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void Nist_include_05() { RunAndCompare("nist-include-05.xml", ""); @@ -118,7 +118,7 @@ /// include element. A resource error results in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void Nist_include_08() { RunAndCompare("nist-include-08.xml", ""); @@ -153,7 +153,7 @@ /// Test a resource containing non-well-formed XML. The inclusion results in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void Nist_include_11() { RunAndCompare("nist-include-11.xml", ""); @@ -165,7 +165,7 @@ /// Test that is a fatal error for an include element to contain more than one fallback elements. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void Nist_include_12() { RunAndCompare("nist-include-12.xml", ""); @@ -199,7 +199,7 @@ /// It is illegal for an include element to point to itself, when parse="xml". /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(CircularInclusionException))] public void Nist_include_15() { RunAndCompare("nist-include-15.xml", ""); @@ -222,7 +222,9 @@ /// <summary> /// Test intra-document reference within include elements. /// </summary> + /// <remarks>INTRA-DOCUMENT REFERENCES ARE NOT SUPPORTED BY THE XIncludingReader.</remarks> [Test] + [ExpectedException(typeof(FatalResourceException))] public void Nist_include_17() { RunAndCompare("nist-include-17.xml", "../../result/nist-include-17.xml"); @@ -294,7 +296,7 @@ /// Test should fail because is including more than one element. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(MalformedXInclusionResultError))] public void Nist_include_23() { RunAndCompare("nist-include-23.xml", ""); @@ -398,7 +400,7 @@ /// Including an XML document using an XPointer element scheme. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void Nist_include_32() { RunAndCompare("nist-include-32.xml", ""); @@ -410,7 +412,7 @@ /// Including an XML document using an XPointer element scheme. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(FatalResourceException))] public void Nist_include_33() { RunAndCompare("nist-include-33.xml", ""); @@ -504,7 +506,7 @@ /// This test should result in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void nist_include_41() { RunAndCompare("nist-include-41.xml", ""); @@ -518,7 +520,7 @@ /// other elements from the xinclude namespace result in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void Nist_include_42() { RunAndCompare("nist-include-42.xml", ""); @@ -531,7 +533,7 @@ /// The content must be one fallback. This test should result in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void Nist_include_43() { RunAndCompare("nist-include-43.xml", ""); @@ -544,7 +546,7 @@ /// This test should result in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XmlException))] public void Nist_include_44() { RunAndCompare("nist-include-44.xml", ""); @@ -557,7 +559,7 @@ /// This test should result in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XmlException))] public void Nist_include_45() { RunAndCompare("nist-include-45.xml", ""); @@ -570,7 +572,7 @@ /// The xinclude element may contain a fallback element; other elements from the xinclude namespace result in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void Nist_include_46() { RunAndCompare("nist-include-46.xml", ""); @@ -583,7 +585,7 @@ /// The xinclude element may contain a fallback element; other elements from the xinclude namespace result in a fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(XIncludeSyntaxError))] public void Nist_include_47() { RunAndCompare("nist-include-47.xml", ""); @@ -660,7 +662,7 @@ /// fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(AttributeOrNamespaceInIncludeLocationError))] public void Nist_include_53() { RunAndCompare("nist-include-53.xml", ""); @@ -673,7 +675,7 @@ /// fatal error. /// </summary> [Test] - [ExpectedException(typeof(Exception))] + [ExpectedException(typeof(AttributeOrNamespaceInIncludeLocationError))] public void Nist_include_54() { RunAndCompare("nist-include-54.xml", ""); |