From: <bo...@us...> - 2010-07-15 06:32:51
|
Revision: 415 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=415&view=rev Author: bodewig Date: 2010-07-15 06:32:45 +0000 (Thu, 15 Jul 2010) Log Message: ----------- extract more information from test failure on Mono - Mono seems to resolve the file differently, will need to develop on Windows and Mono in parallel to resolve this - oh my Modified Paths: -------------- trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs Modified: trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs =================================================================== --- trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs 2010-07-15 06:22:44 UTC (rev 414) +++ trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs 2010-07-15 06:32:45 UTC (rev 415) @@ -12,6 +12,7 @@ limitations under the License. */ using System; +using System.Collections.Generic; using NUnit.Framework; using net.sf.xmlunit.exceptions; using net.sf.xmlunit.input; @@ -33,8 +34,13 @@ Validator v = Validator.ForLanguage(Languages.W3C_XML_SCHEMA_NS_URI); v.SchemaSource = new StreamSource("../../../src/tests/resources/Book.xsd"); ValidationResult r = v.ValidateInstance(new StreamSource("../../../src/tests/resources/BookXsdGenerated.xml")); - Assert.IsTrue(r.Valid); - Assert.IsFalse(r.Problems.GetEnumerator().MoveNext()); + IEnumerator<ValidationProblem> problems = r.Problems.GetEnumerator(); + bool haveErrors = problems.MoveNext(); + + Assert.IsTrue(r.Valid, + "Expected validation to pass, first validation error" + + " is " + problems.Current.Message); + Assert.IsFalse(haveErrors); } [Test] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2010-07-15 06:41:16
|
Revision: 416 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=416&view=rev Author: bodewig Date: 2010-07-15 06:41:10 +0000 (Thu, 15 Jul 2010) Log Message: ----------- extra diagnostics cause an error when the test passes Modified Paths: -------------- trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs Modified: trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs =================================================================== --- trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs 2010-07-15 06:32:45 UTC (rev 415) +++ trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs 2010-07-15 06:41:10 UTC (rev 416) @@ -39,7 +39,8 @@ Assert.IsTrue(r.Valid, "Expected validation to pass, first validation error" - + " is " + problems.Current.Message); + + " is " + + (haveErrors ? problems.Current.Message : "unknown")); Assert.IsFalse(haveErrors); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2010-08-10 16:06:49
|
Revision: 422 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=422&view=rev Author: bodewig Date: 2010-08-10 16:06:43 +0000 (Tue, 10 Aug 2010) Log Message: ----------- use XML file without schema location Modified Paths: -------------- trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs Modified: trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs =================================================================== --- trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs 2010-08-10 16:03:53 UTC (rev 421) +++ trunk/xmlunit/src/tests/net-core/validation/ValidatorTest.cs 2010-08-10 16:06:43 UTC (rev 422) @@ -33,7 +33,7 @@ public void ShouldSuccessfullyValidateInstance() { Validator v = Validator.ForLanguage(Languages.W3C_XML_SCHEMA_NS_URI); v.SchemaSource = new StreamSource(TestResources.TESTS_DIR + "Book.xsd"); - ValidationResult r = v.ValidateInstance(new StreamSource(TestResources.TESTS_DIR + "BookXsdGenerated.xml")); + ValidationResult r = v.ValidateInstance(new StreamSource(TestResources.TESTS_DIR + "BookXsdGeneratedNoSchema.xml")); IEnumerator<ValidationProblem> problems = r.Problems.GetEnumerator(); bool haveErrors = problems.MoveNext(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |