You can subscribe to this list here.
2007 |
Jan
|
Feb
(3) |
Mar
(18) |
Apr
(39) |
May
(15) |
Jun
(12) |
Jul
(3) |
Aug
(23) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(21) |
Feb
(23) |
Mar
(33) |
Apr
(8) |
May
(1) |
Jun
(22) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(6) |
Nov
|
Dec
(11) |
2009 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(24) |
May
(36) |
Jun
(18) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(3) |
Nov
(1) |
Dec
|
2010 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
(15) |
May
(24) |
Jun
(11) |
Jul
(8) |
Aug
(34) |
Sep
(42) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
(13) |
Feb
(32) |
Mar
(35) |
Apr
(31) |
May
(33) |
Jun
(30) |
Jul
(32) |
Aug
(31) |
Sep
(30) |
Oct
(31) |
Nov
(32) |
Dec
(31) |
2012 |
Jan
(35) |
Feb
(31) |
Mar
(31) |
Apr
(30) |
May
(31) |
Jun
(34) |
Jul
(23) |
Aug
(30) |
Sep
(30) |
Oct
(29) |
Nov
(30) |
Dec
(32) |
2013 |
Jan
(25) |
Feb
(39) |
Mar
(1) |
Apr
(18) |
May
(1) |
Jun
|
Jul
(1) |
Aug
(20) |
Sep
(41) |
Oct
(32) |
Nov
(9) |
Dec
(31) |
2014 |
Jan
(31) |
Feb
(30) |
Mar
(34) |
Apr
(60) |
May
(31) |
Jun
(28) |
Jul
(32) |
Aug
(28) |
Sep
(26) |
Oct
(32) |
Nov
(43) |
Dec
(115) |
2015 |
Jan
(106) |
Feb
(101) |
Mar
(51) |
Apr
(32) |
May
(63) |
Jun
(18) |
Jul
|
Aug
(18) |
Sep
|
Oct
(1) |
Nov
(84) |
Dec
(63) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(104) |
Apr
(30) |
May
(6) |
Jun
(30) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(48) |
Dec
(22) |
2017 |
Jan
(15) |
Feb
(29) |
Mar
(43) |
Apr
(29) |
May
(25) |
Jun
(28) |
Jul
(62) |
Aug
(35) |
Sep
(35) |
Oct
(72) |
Nov
(10) |
Dec
(4) |
2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(46) |
May
(20) |
Jun
(12) |
Jul
(9) |
Aug
(42) |
Sep
(4) |
Oct
(17) |
Nov
(32) |
Dec
(31) |
2019 |
Jan
(21) |
Feb
(14) |
Mar
|
Apr
(74) |
May
(25) |
Jun
(43) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2020 |
Jan
(1) |
Feb
|
Mar
(26) |
Apr
(8) |
May
(62) |
Jun
(4) |
Jul
(25) |
Aug
|
Sep
(21) |
Oct
(24) |
Nov
(26) |
Dec
(9) |
2021 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(11) |
Nov
(1) |
Dec
(12) |
2022 |
Jan
(47) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(14) |
2023 |
Jan
(3) |
Feb
|
Mar
(60) |
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
(5) |
Feb
|
Mar
|
Apr
(10) |
May
(1) |
Jun
|
Jul
|
Aug
(17) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
|
Feb
|
Mar
(88) |
Apr
(64) |
May
(47) |
Jun
(20) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bo...@us...> - 2008-12-15 08:46:11
|
Revision: 282 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=282&view=rev Author: bodewig Date: 2008-12-15 08:46:06 +0000 (Mon, 15 Dec 2008) Log Message: ----------- RelaxNG rexperiments broke .NET tests Modified Paths: -------------- trunk/xmlunit/tests/etc/invalidBook.xml Modified: trunk/xmlunit/tests/etc/invalidBook.xml =================================================================== --- trunk/xmlunit/tests/etc/invalidBook.xml 2008-12-15 08:37:05 UTC (rev 281) +++ trunk/xmlunit/tests/etc/invalidBook.xml 2008-12-15 08:46:06 UTC (rev 282) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Book xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" - xmlns="http://www.publishing.org"> + xmlns="http://www.publishing.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.publishing.org tests/etc/Book.xsd"> <Title>Chicken Soup for the Soul</Title> <Author>Jack Canfield</Author> <Author>Mark Victor Hansen</Author> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-12-15 08:37:12
|
Revision: 281 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=281&view=rev Author: bodewig Date: 2008-12-15 08:37:05 +0000 (Mon, 15 Dec 2008) Log Message: ----------- there was more to that change Modified Paths: -------------- trunk/xmlunit/NUnit.ReadMe Modified: trunk/xmlunit/NUnit.ReadMe =================================================================== --- trunk/xmlunit/NUnit.ReadMe 2008-12-12 16:52:49 UTC (rev 280) +++ trunk/xmlunit/NUnit.ReadMe 2008-12-15 08:37:05 UTC (rev 281) @@ -21,7 +21,8 @@ A new flag in DifferenceConfiguration can be used to turn on the old behavior where attribute order was significant. -- xmlns attributes are now no longer treated as normal attributes +- xmlns attributes are now no longer treated as normal attributes and + the namespace of attributes is now sigificant Changes in version 0.3.1: - made it compile and all tests pass on .NET 1.1 as well as 2.0 and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-12-12 16:52:55
|
Revision: 280 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=280&view=rev Author: bodewig Date: 2008-12-12 16:52:49 +0000 (Fri, 12 Dec 2008) Log Message: ----------- port part of the namespaces for attributes logic from the Java version Modified Paths: -------------- trunk/xmlunit/NUnit.ReadMe trunk/xmlunit/src/csharp/XmlDiff.cs Modified: trunk/xmlunit/NUnit.ReadMe =================================================================== --- trunk/xmlunit/NUnit.ReadMe 2008-12-12 15:31:16 UTC (rev 279) +++ trunk/xmlunit/NUnit.ReadMe 2008-12-12 16:52:49 UTC (rev 280) @@ -21,6 +21,7 @@ A new flag in DifferenceConfiguration can be used to turn on the old behavior where attribute order was significant. +- xmlns attributes are now no longer treated as normal attributes Changes in version 0.3.1: - made it compile and all tests pass on .NET 1.1 as well as 2.0 and Modified: trunk/xmlunit/src/csharp/XmlDiff.cs =================================================================== --- trunk/xmlunit/src/csharp/XmlDiff.cs 2008-12-12 15:31:16 UTC (rev 279) +++ trunk/xmlunit/src/csharp/XmlDiff.cs 2008-12-12 16:52:49 UTC (rev 280) @@ -1,10 +1,13 @@ namespace XmlUnit { using System; + using System.Collections; using System.IO; using System.Xml; using System.Xml.Schema; public class XmlDiff { + private const string XMLNS_PREFIX = "xmlns"; + private readonly XmlReader _controlReader; private readonly XmlReader _testReader; private readonly DiffConfiguration _diffConfiguration; @@ -119,48 +122,62 @@ if (!String.Equals(controlTagName, testTagName)) { DifferenceFound(DifferenceType.ELEMENT_TAG_NAME_ID, result); } else { - int controlAttributeCount = _controlReader.AttributeCount; - int testAttributeCount = _testReader.AttributeCount; - if (controlAttributeCount != testAttributeCount) { + XmlAttribute[] controlAttributes = + GetNonSpecialAttributes(_controlReader); + XmlAttribute[] testAttributes = + GetNonSpecialAttributes(_testReader); + if (controlAttributes.Length != testAttributes.Length) { DifferenceFound(DifferenceType.ELEMENT_NUM_ATTRIBUTES_ID, result); } else { - CompareAttributes(result, controlAttributeCount); + CompareAttributes(result, controlAttributes, testAttributes); } } } - private void CompareAttributes(DiffResult result, int controlAttributeCount) { - string controlAttrValue, controlAttrName; - string testAttrValue, testAttrName; - - _controlReader.MoveToFirstAttribute(); - _testReader.MoveToFirstAttribute(); - for (int i=0; i < controlAttributeCount; ++i) { + private void CompareAttributes(DiffResult result, + XmlAttribute[] controlAttributes, + XmlAttribute[] testAttributes) { + ArrayList unmatchedTestAttributes = new ArrayList(); + unmatchedTestAttributes.AddRange(testAttributes); + for (int i=0; i < controlAttributes.Length; ++i) { - controlAttrName = _controlReader.Name; - testAttrName = _testReader.Name; - - controlAttrValue = _controlReader.Value; - testAttrValue = _testReader.Value; - - if (!String.Equals(controlAttrName, testAttrName)) { - if (!_diffConfiguration.IgnoreAttributeOrder) { - DifferenceFound(DifferenceType.ATTR_SEQUENCE_ID, result); + bool controlIsInNs = IsNamespaced(controlAttributes[i]); + string controlAttrName = + GetUnNamespacedNodeName(controlAttributes[i]); + XmlAttribute testAttr = null; + if (!controlIsInNs) { + testAttr = FindAttributeByName(testAttributes, + controlAttrName); + } else { + testAttr = FindAttributeByNameAndNs(testAttributes, + controlAttrName, + controlAttributes[i] + .NamespaceURI); + } + + if (testAttr != null) { + unmatchedTestAttributes.Remove(testAttr); + if (!_diffConfiguration.IgnoreAttributeOrder + && testAttr != testAttributes[i]) { + DifferenceFound(DifferenceType.ATTR_SEQUENCE_ID, + result); } - - if (!_testReader.MoveToAttribute(controlAttrName)) { - DifferenceFound(DifferenceType.ATTR_NAME_NOT_FOUND_ID, result); + + if (controlAttributes[i].Value != testAttr.Value) { + Console.Error.WriteLine("control: {0}, expected {1}, was {2}", + controlAttrName, + controlAttributes[i].Value, testAttr.Value); + DifferenceFound(DifferenceType.ATTR_VALUE_ID, result); } - testAttrValue = _testReader.Value; + + } else { + DifferenceFound(DifferenceType.ATTR_NAME_NOT_FOUND_ID, + result); } - - if (!String.Equals(controlAttrValue, testAttrValue)) { - DifferenceFound(DifferenceType.ATTR_VALUE_ID, result); - } - - _controlReader.MoveToNextAttribute(); - _testReader.MoveToNextAttribute(); } + foreach (XmlAttribute a in unmatchedTestAttributes) { + DifferenceFound(DifferenceType.ATTR_NAME_NOT_FOUND_ID, result); + } } private void CompareText(DiffResult result) { @@ -207,6 +224,68 @@ } } + private XmlAttribute[] GetNonSpecialAttributes(XmlReader r) { + ArrayList l = new ArrayList(); + int length = r.AttributeCount; + if (length > 0) { + XmlDocument doc = new XmlDocument(); + r.MoveToFirstAttribute(); + for (int i = 0; i < length; i++) { + XmlAttribute a = doc.CreateAttribute(r.Name, r.NamespaceURI); + if (!IsXMLNSAttribute(a)) { + l.Add(a); + } + a.Value = r.Value; + r.MoveToNextAttribute(); + } + } + return (XmlAttribute[]) l.ToArray(typeof(XmlAttribute)); + } + + private bool IsXMLNSAttribute(XmlAttribute attribute) { + return XMLNS_PREFIX == attribute.Prefix || + XMLNS_PREFIX == attribute.Name; + } + + private XmlAttribute FindAttributeByName(XmlAttribute[] attrs, + string name) { + foreach (XmlAttribute a in attrs) { + if (GetUnNamespacedNodeName(a) == name) { + return a; + } + } + return null; + } + + private XmlAttribute FindAttributeByNameAndNs(XmlAttribute[] attrs, + string name, + string nsUri) { + foreach (XmlAttribute a in attrs) { + if (GetUnNamespacedNodeName(a) == name + && a.NamespaceURI == nsUri) { + return a; + } + } + return null; + } + + private string GetUnNamespacedNodeName(XmlNode aNode) { + return GetUnNamespacedNodeName(aNode, IsNamespaced(aNode)); + } + + private string GetUnNamespacedNodeName(XmlNode aNode, + bool isNamespacedNode) { + if (isNamespacedNode) { + return aNode.LocalName; + } + return aNode.Name; + } + + private bool IsNamespaced(XmlNode aNode) { + string ns = aNode.NamespaceURI; + return ns != null && ns.Length > 0; + } + private void CheckEndElement(XmlReader reader, ref bool readResult, DiffResult result) { readResult = reader.Read(); if (!readResult || reader.NodeType != XmlNodeType.EndElement) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-12-12 15:31:23
|
Revision: 279 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=279&view=rev Author: bodewig Date: 2008-12-12 15:31:16 +0000 (Fri, 12 Dec 2008) Log Message: ----------- whitespace Modified Paths: -------------- trunk/xmlunit/src/csharp/XmlDiff.cs Modified: trunk/xmlunit/src/csharp/XmlDiff.cs =================================================================== --- trunk/xmlunit/src/csharp/XmlDiff.cs 2008-12-12 15:30:20 UTC (rev 278) +++ trunk/xmlunit/src/csharp/XmlDiff.cs 2008-12-12 15:31:16 UTC (rev 279) @@ -145,7 +145,7 @@ if (!String.Equals(controlAttrName, testAttrName)) { if (!_diffConfiguration.IgnoreAttributeOrder) { - DifferenceFound(DifferenceType.ATTR_SEQUENCE_ID, result); + DifferenceFound(DifferenceType.ATTR_SEQUENCE_ID, result); } if (!_testReader.MoveToAttribute(controlAttrName)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-12-12 15:30:26
|
Revision: 278 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=278&view=rev Author: bodewig Date: 2008-12-12 15:30:20 +0000 (Fri, 12 Dec 2008) Log Message: ----------- attribute order is not relevant, neither in Java (fixed some time ago) nor in .NET Modified Paths: -------------- trunk/xmlunit/NUnit.ReadMe trunk/xmlunit/src/csharp/AssemblyInfo.cs trunk/xmlunit/src/csharp/DiffConfiguration.cs trunk/xmlunit/src/csharp/XmlDiff.cs trunk/xmlunit/xmlunit.nant.build Modified: trunk/xmlunit/NUnit.ReadMe =================================================================== --- trunk/xmlunit/NUnit.ReadMe 2008-06-11 10:05:04 UTC (rev 277) +++ trunk/xmlunit/NUnit.ReadMe 2008-12-12 15:30:20 UTC (rev 278) @@ -5,13 +5,23 @@ - Nunit v2.2 or above (http://nunit.org/) - .NET runtime v1.1 or Mono runtime v1.0 (or above) -If you want to build the source code yourself you will also need NAnt (http://nant.sourceforge.net/) +If you want to build the source code yourself you will also need NAnt +(http://nant.sourceforge.net/) -This build of the source code was prepared using .NET csc 1.1.4322, NUnit2.4.6, and NAnt0.8.5 +This build of the source code was prepared using .NET csc 1.1.4322, +NUnit2.4.8, and NAnt0.8.5 Enjoy! http://xmlunit.sourceforge.net/ +Changes in version 0.4: +- order of attributes is ignored, this means there will never be a + difference of type 4 anymore. + + A new flag in DifferenceConfiguration can be used to turn on the old + behavior where attribute order was significant. + + Changes in version 0.3.1: - made it compile and all tests pass on .NET 1.1 as well as 2.0 and NUnit 2.4 Modified: trunk/xmlunit/src/csharp/AssemblyInfo.cs =================================================================== --- trunk/xmlunit/src/csharp/AssemblyInfo.cs 2008-06-11 10:05:04 UTC (rev 277) +++ trunk/xmlunit/src/csharp/AssemblyInfo.cs 2008-12-12 15:30:20 UTC (rev 278) @@ -23,7 +23,7 @@ // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("0.3.1.0")] +[assembly: AssemblyVersion("0.4.0.0")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. Modified: trunk/xmlunit/src/csharp/DiffConfiguration.cs =================================================================== --- trunk/xmlunit/src/csharp/DiffConfiguration.cs 2008-06-11 10:05:04 UTC (rev 277) +++ trunk/xmlunit/src/csharp/DiffConfiguration.cs 2008-12-12 15:30:20 UTC (rev 278) @@ -2,21 +2,32 @@ using System.Xml; public class DiffConfiguration { - public static readonly WhitespaceHandling DEFAULT_WHITESPACE_HANDLING = WhitespaceHandling.All; - public static readonly string DEFAULT_DESCRIPTION = "XmlDiff"; - public static readonly bool DEFAULT_USE_VALIDATING_PARSER = true; + public const WhitespaceHandling DEFAULT_WHITESPACE_HANDLING = WhitespaceHandling.All; + public const string DEFAULT_DESCRIPTION = "XmlDiff"; + public const bool DEFAULT_USE_VALIDATING_PARSER = true; + public const bool DEFAULT_IGNORE_ATTRIBUTE_ORDER = true; private readonly string _description; private readonly bool _useValidatingParser; private readonly WhitespaceHandling _whitespaceHandling; + private readonly bool ignoreAttributeOrder; public DiffConfiguration(string description, bool useValidatingParser, - WhitespaceHandling whitespaceHandling) { + WhitespaceHandling whitespaceHandling, + bool ignoreAttributeOrder) { _description = description; _useValidatingParser = useValidatingParser; _whitespaceHandling = whitespaceHandling; + this.ignoreAttributeOrder = ignoreAttributeOrder; } + + public DiffConfiguration(string description, + bool useValidatingParser, + WhitespaceHandling whitespaceHandling) + : this (description, useValidatingParser, whitespaceHandling, + DEFAULT_IGNORE_ATTRIBUTE_ORDER) { + } public DiffConfiguration(string description, WhitespaceHandling whitespaceHandling) @@ -62,5 +73,11 @@ return _whitespaceHandling; } } + + public bool IgnoreAttributeOrder { + get { + return ignoreAttributeOrder; + } + } } } Modified: trunk/xmlunit/src/csharp/XmlDiff.cs =================================================================== --- trunk/xmlunit/src/csharp/XmlDiff.cs 2008-06-11 10:05:04 UTC (rev 277) +++ trunk/xmlunit/src/csharp/XmlDiff.cs 2008-12-12 15:30:20 UTC (rev 278) @@ -144,7 +144,9 @@ testAttrValue = _testReader.Value; if (!String.Equals(controlAttrName, testAttrName)) { + if (!_diffConfiguration.IgnoreAttributeOrder) { DifferenceFound(DifferenceType.ATTR_SEQUENCE_ID, result); + } if (!_testReader.MoveToAttribute(controlAttrName)) { DifferenceFound(DifferenceType.ATTR_NAME_NOT_FOUND_ID, result); Modified: trunk/xmlunit/xmlunit.nant.build =================================================================== --- trunk/xmlunit/xmlunit.nant.build 2008-06-11 10:05:04 UTC (rev 277) +++ trunk/xmlunit/xmlunit.nant.build 2008-12-12 15:30:20 UTC (rev 278) @@ -1,5 +1,5 @@ <project name="xmlunit" description="XmlUnit for .Net" default="compile"> - <property name="project.version" value="0.3.1" overwrite="false"/> + <property name="project.version" value="0.4" overwrite="false"/> <property name="base.dir" value="${project::get-base-directory()}" overwrite="false"/> <property name="src.dir" value="${base.dir}/src/csharp" overwrite="false"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2008-12-04 05:32:30
|
Bugs item #2386807, was opened at 2008-12-04 16:30 Message generated for change (Comment added) made by mattw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2386807&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Matthew Watson (mattw) Assigned to: Nobody/Anonymous (nobody) Summary: 1.2 bug comparing missing attributes Initial Comment: There is a bug when comparing 2 xml fragments where one has a missing attribute, the error is reported correctly, but the xpath for the attribute being compared is incorrect. The test below produces: Expected number of element attributes '2' but was '1' - comparing <bar...> at /foo[1]/bar[1] to <bar...> at /foo[1]/bar[1] Expected attribute name 'y' but was 'null' - comparing <bar...> at /foo[1]/bar[1]/@a to <bar...> at /foo[1]/bar[1]/@a The second diff says it is comparing attribute "y", but the xpath indicates attribute "a". Either the attribute in the xpath should be "y", or the xpath should only indicate /foo[1]/bar[1] Matt import java.util.List; import org.custommonkey.xmlunit.DetailedDiff; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.XMLTestCase; public class XmlUnitBug extends XMLTestCase { public void testBug() throws Exception { Diff myDiff = new Diff("<foo><bar a=\"x\" y=\"z\"/></foo>", "<foo><bar a=\"x\"/></foo>"); DetailedDiff myDDiff = new DetailedDiff(myDiff); List allDifferences = myDDiff.getAllDifferences(); for (Object diff : allDifferences) { System.err.println(diff); } assertTrue(myDDiff.similar()); } } ---------------------------------------------------------------------- Comment By: Matthew Watson (mattw) Date: 2008-12-04 16:32 Message: I am using V1.2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2386807&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-12-04 05:30:33
|
Bugs item #2386807, was opened at 2008-12-04 16:30 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2386807&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Matthew Watson (mattw) Assigned to: Nobody/Anonymous (nobody) Summary: 1.2 bug comparing missing attributes Initial Comment: There is a bug when comparing 2 xml fragments where one has a missing attribute, the error is reported correctly, but the xpath for the attribute being compared is incorrect. The test below produces: Expected number of element attributes '2' but was '1' - comparing <bar...> at /foo[1]/bar[1] to <bar...> at /foo[1]/bar[1] Expected attribute name 'y' but was 'null' - comparing <bar...> at /foo[1]/bar[1]/@a to <bar...> at /foo[1]/bar[1]/@a The second diff says it is comparing attribute "y", but the xpath indicates attribute "a". Either the attribute in the xpath should be "y", or the xpath should only indicate /foo[1]/bar[1] Matt import java.util.List; import org.custommonkey.xmlunit.DetailedDiff; import org.custommonkey.xmlunit.Diff; import org.custommonkey.xmlunit.XMLTestCase; public class XmlUnitBug extends XMLTestCase { public void testBug() throws Exception { Diff myDiff = new Diff("<foo><bar a=\"x\" y=\"z\"/></foo>", "<foo><bar a=\"x\"/></foo>"); DetailedDiff myDDiff = new DetailedDiff(myDiff); List allDifferences = myDDiff.getAllDifferences(); for (Object diff : allDifferences) { System.err.println(diff); } assertTrue(myDDiff.similar()); } } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2386807&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-10-21 11:43:35
|
Feature Requests item #2184226, was opened at 2008-10-21 13:43 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2184226&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Bodewig (bodewig) Assigned to: Nobody/Anonymous (nobody) Summary: Allow Schemas and Validators to be cached Initial Comment: https://sourceforge.net/forum/forum.php?thread_id=2136428&forum_id=73273 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2184226&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-10-20 13:34:05
|
Feature Requests item #2141988, was opened at 2008-10-02 10:13 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2141988&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None >Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Christophe DENEUX (cdeneux) Assigned to: Nobody/Anonymous (nobody) Summary: Qualified values and XMLAssert.assertXpathEvaluatesTo Initial Comment: I try to use XMLAssert.assertXpathEvaluatesTo to check a node value (faulcode value of a SOAP Fault). The value is a qualified value. XMLAssert.assertXpathEvaluatesTo does not work correctly with qualified value. In the namespace context, if you set a prefix different than the one in your XML document, you can't be able to have a successfull test, expect if you set the prefix provided by your XML document. My XML: <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>marche pas</faultstring><detail/></env:Fault></env:Body></env:Envelope> My namespace context: final Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("env11", "http://schemas.xmlsoap.org/soap/envelope/"); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); My assert: XMLAssert.assertXpathEvaluatesTo("env11:Server", "//env11:Envelope/env11:Body/env11:Fault/faultcode", faultDocument); ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-10-20 15:33 Message: not as straight forward as it sounds, but a valid enhancement request. Not a bug, I hope you agree. I'm afraid QName doesn't exist prior to Java5 so we'd need to either provide our own abstraction or make the method Java5 only. ---------------------------------------------------------------------- Comment By: Christophe DENEUX (cdeneux) Date: 2008-10-18 10:08 Message: Yes, right, perhaps can you add a new assert to check qualified values: assertXpathEvaluatesTo(QName, String, Document) ? This assert expects that the value is a qualified value, if not the assert fails. If the qualied value is not the expected one, the assert fails. Example: XMLAssert.assertXpathEvaluatesTo(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server"), "//env11:Envelope/env11:Body/env11:Fault/faultcode", faultDocument); ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-10-09 14:47 Message: Hmm, env:Server is just the textual content of an element from a pure XML point of view. How should XMLUnit know that env: inside some arbitrary text is supposed to be the prefix attached to an XML namespace? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2141988&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-10-18 08:08:19
|
Bugs item #2141988, was opened at 2008-10-02 10:13 Message generated for change (Comment added) made by cdeneux You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Christophe DENEUX (cdeneux) Assigned to: Nobody/Anonymous (nobody) Summary: Qualified values and XMLAssert.assertXpathEvaluatesTo Initial Comment: I try to use XMLAssert.assertXpathEvaluatesTo to check a node value (faulcode value of a SOAP Fault). The value is a qualified value. XMLAssert.assertXpathEvaluatesTo does not work correctly with qualified value. In the namespace context, if you set a prefix different than the one in your XML document, you can't be able to have a successfull test, expect if you set the prefix provided by your XML document. My XML: <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>marche pas</faultstring><detail/></env:Fault></env:Body></env:Envelope> My namespace context: final Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("env11", "http://schemas.xmlsoap.org/soap/envelope/"); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); My assert: XMLAssert.assertXpathEvaluatesTo("env11:Server", "//env11:Envelope/env11:Body/env11:Fault/faultcode", faultDocument); ---------------------------------------------------------------------- Comment By: Christophe DENEUX (cdeneux) Date: 2008-10-18 10:08 Message: Yes, right, perhaps can you add a new assert to check qualified values: assertXpathEvaluatesTo(QName, String, Document) ? This assert expects that the value is a qualified value, if not the assert fails. If the qualied value is not the expected one, the assert fails. Example: XMLAssert.assertXpathEvaluatesTo(new QName("http://schemas.xmlsoap.org/soap/envelope/", "Server"), "//env11:Envelope/env11:Body/env11:Fault/faultcode", faultDocument); ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-10-09 14:47 Message: Hmm, env:Server is just the textual content of an element from a pure XML point of view. How should XMLUnit know that env: inside some arbitrary text is supposed to be the prefix attached to an XML namespace? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-10-09 13:27:46
|
Bugs item #2094508, was opened at 2008-09-05 08:46 Message generated for change (Settings changed) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2094508&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.1 Status: Open >Resolution: Wont Fix >Priority: 1 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: HTMLDocumentBuilder and Java 1.6 Initial Comment: HTMLDocumentBuilder fails to parse following (one line) HTML correctly if Java 1.6 is used. Only one of input elements finds its way into the document. It works correctly with Java 1.5. If you add a space between </script> and <input> tags it works also with Java 1.6. String html = "<html><head><title>Test</title></head><form action=\"\"><script language=\"javascript\">alert('test');</script><input type=\"text\"/><input type=\"button\"/></form></html>"; TolerantSaxDocumentBuilder tolerantSaxDocumentBuilder = new TolerantSaxDocumentBuilder(XMLUnit.newTestParser()); HTMLDocumentBuilder htmlDocumentBuilder = new HTMLDocumentBuilder(tolerantSaxDocumentBuilder); Document document = htmlDocumentBuilder.parse(html); ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-10-09 15:27 Message: I can reproduce this, but it is most likely due to changes in javax.swing.html.parser.* - something that I'm personally not familiar with and honestly don't want to become familiar with either. I'd recommend you use a library other than XMLUnit to turn HTML into proper XML since those other libraries do a better job at it anyway. I can't recommend a specific library, but options I've seen used include JTidy <http://jtidy.sourceforge.net/>, TagSoup <http://ccil.org/~cowan/XML/tagsoup/> and NekoHTML <http://nekohtml.sourceforge.net/>. Unless anybody feels like contributing a patch (including tests), this won't get fixes. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2094508&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-10-09 12:47:40
|
Bugs item #2141988, was opened at 2008-10-02 10:13 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Christophe DENEUX (cdeneux) Assigned to: Nobody/Anonymous (nobody) Summary: Qualified values and XMLAssert.assertXpathEvaluatesTo Initial Comment: I try to use XMLAssert.assertXpathEvaluatesTo to check a node value (faulcode value of a SOAP Fault). The value is a qualified value. XMLAssert.assertXpathEvaluatesTo does not work correctly with qualified value. In the namespace context, if you set a prefix different than the one in your XML document, you can't be able to have a successfull test, expect if you set the prefix provided by your XML document. My XML: <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>marche pas</faultstring><detail/></env:Fault></env:Body></env:Envelope> My namespace context: final Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("env11", "http://schemas.xmlsoap.org/soap/envelope/"); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); My assert: XMLAssert.assertXpathEvaluatesTo("env11:Server", "//env11:Envelope/env11:Body/env11:Fault/faultcode", faultDocument); ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-10-09 14:47 Message: Hmm, env:Server is just the textual content of an element from a pure XML point of view. How should XMLUnit know that env: inside some arbitrary text is supposed to be the prefix attached to an XML namespace? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-10-02 08:13:41
|
Bugs item #2141988, was opened at 2008-10-02 10:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Christophe DENEUX (cdeneux) Assigned to: Nobody/Anonymous (nobody) Summary: Qualified values and XMLAssert.assertXpathEvaluatesTo Initial Comment: I try to use XMLAssert.assertXpathEvaluatesTo to check a node value (faulcode value of a SOAP Fault). The value is a qualified value. XMLAssert.assertXpathEvaluatesTo does not work correctly with qualified value. In the namespace context, if you set a prefix different than the one in your XML document, you can't be able to have a successfull test, expect if you set the prefix provided by your XML document. My XML: <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>marche pas</faultstring><detail/></env:Fault></env:Body></env:Envelope> My namespace context: final Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("env11", "http://schemas.xmlsoap.org/soap/envelope/"); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); My assert: XMLAssert.assertXpathEvaluatesTo("env11:Server", "//env11:Envelope/env11:Body/env11:Fault/faultcode", faultDocument); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2141988&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-09-05 06:46:48
|
Bugs item #2094508, was opened at 2008-09-05 06:46 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2094508&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: HTMLDocumentBuilder and Java 1.6 Initial Comment: HTMLDocumentBuilder fails to parse following (one line) HTML correctly if Java 1.6 is used. Only one of input elements finds its way into the document. It works correctly with Java 1.5. If you add a space between </script> and <input> tags it works also with Java 1.6. String html = "<html><head><title>Test</title></head><form action=\"\"><script language=\"javascript\">alert('test');</script><input type=\"text\"/><input type=\"button\"/></form></html>"; TolerantSaxDocumentBuilder tolerantSaxDocumentBuilder = new TolerantSaxDocumentBuilder(XMLUnit.newTestParser()); HTMLDocumentBuilder htmlDocumentBuilder = new HTMLDocumentBuilder(tolerantSaxDocumentBuilder); Document document = htmlDocumentBuilder.parse(html); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=2094508&group_id=23187 |
From: SourceForge.net <no...@so...> - 2008-08-22 11:45:56
|
Feature Requests item #2067321, was opened at 2008-08-22 12:46 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2067321&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: XMLUnit for Java Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Peter Schuebl (schup) Assigned to: Nobody/Anonymous (nobody) Summary: Change Exception for better IDE integration Initial Comment: Currently XMLTestCase.assertXMLEqual results in a junit.framework.AssertionFailedError If no message is specified the output is as follows junit.framework.AssertionFailedError: org.custommonkey.xmlunit.Diff [different] Expected element tag name 'uuid' but was 'localId' - comparing <uuid...> at /msg[1]/uuid[1] to <localId...> at /msg[1]/localId[1] A small change would make use of existing IDE integrations for junit which highlight the text difference (see attached screenshot) The screenshot was create by throwing the following exception: throw new ComparisonFailure( "Expected element tag name 'uuid' but was 'localId' - comparing <uuid...> at /msg[1]/uuid[1] to <localId...> at /msg[1]/localId[1]", "<msg><uuid>0x00435A8C</uuid></msg>", "<msg><localId>2376</localId></msg>"); which resulted in the message: junit.framework.ComparisonFailure: Expected element tag name 'uuid' but was 'localId' - comparing <uuid...> at /msg[1]/uuid[1] to <localId...> at /msg[1]/localId[1] expected:<<msg><[uuid>0x00435A8C</uui]d></msg>> but was:<<msg><[localId>2376</localI]d></msg>> Nothing critical - just an idea :-) btw: good work ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377771&aid=2067321&group_id=23187 |
From: Stefan B. <bo...@ap...> - 2008-06-20 01:46:02
|
To whom it may engage... This is an automated request, but not an unsolicited one. For more information please visit http://gump.apache.org/nagged.html, and/or contact the folk at ge...@gu.... Project xmlunit has an issue affecting its community integration. This issue affects 1 projects. The current state of this project is 'Failed', with reason 'Configuration Failed'. For reference only, the following projects are affected by this: - xmlunit : JUnit extension for XML unit tests. Full details are available at: http://vmgump.apache.org/gump/public/xmlunit/xmlunit/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -DEBUG- Sole output [xmlunit-18062008.jar] identifier set to project name -INFO- Failed with reason configuration failed -ERROR- Bad Dependency. Project: xml-apis : unknown to *this* workspace -DEBUG- Extracted fallback artifacts from Gump Repository To subscribe to this information via syndicated feeds: - RSS: http://vmgump.apache.org/gump/public/xmlunit/xmlunit/rss.xml - Atom: http://vmgump.apache.org/gump/public/xmlunit/xmlunit/atom.xml ============================== Gump Tracking Only === Produced by Gump version 2.3. Gump Run 21001618062008, vmgump:vmgump-public:21001618062008 Gump E-mail Identifier (unique within run) #36. -- Apache Gump http://gump.apache.org/ [Instance: vmgump] |
From: <bo...@us...> - 2008-06-11 10:04:58
|
Revision: 277 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=277&view=rev Author: bodewig Date: 2008-06-11 03:05:04 -0700 (Wed, 11 Jun 2008) Log Message: ----------- Announce release Modified Paths: -------------- trunk/xmlunit/src/site/index.html Modified: trunk/xmlunit/src/site/index.html =================================================================== --- trunk/xmlunit/src/site/index.html 2008-06-10 13:48:04 UTC (rev 276) +++ trunk/xmlunit/src/site/index.html 2008-06-11 10:05:04 UTC (rev 277) @@ -63,8 +63,8 @@ <tr> <td colspan="2"> <p>The current stable release is <a - href="https://sourceforge.net/project/showfiles.php?group_id=23187&package_id=15921&release_id=519570">XMLUnit - 1.1</a>, June 2007.</p> + href="http://sourceforge.net/project/showfiles.php?group_id=23187&package_id=15921&release_id=605991">XMLUnit + 1.2</a>, June 2008.</p> <p>XMLUnit for Java provides two JUnit extension classes, <code>XMLAssert</code> and <code>XMLTestCase</code>, and a set of supporting classes (e.g. <code>Diff</code>, <code>DetailedDiff</code>,<code>Transform</code>,<code>SimpleXpathEngine</code>,<code>Validator</code>,<code>NodeTest</code>) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-06-10 13:48:05
|
Revision: 276 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=276&view=rev Author: bodewig Date: 2008-06-10 06:48:04 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Add a maven-metadata.xml file Modified Paths: -------------- trunk/xmlunit/build.xml Added Paths: ----------- trunk/xmlunit/src/etc/xmlunit-maven-metadata.xml Modified: trunk/xmlunit/build.xml =================================================================== --- trunk/xmlunit/build.xml 2008-06-10 13:41:44 UTC (rev 275) +++ trunk/xmlunit/build.xml 2008-06-10 13:48:04 UTC (rev 276) @@ -215,6 +215,7 @@ <fileset dir="${src.dir}/etc"> <include name="xmlunit.pom"/> <include name="xmlunit-ivy.xml"/> + <include name="xmlunit-maven-metadata.xml"/> </fileset> <mapper type="glob" from="xmlunit*" to="xmlunit-${xmlunit.version}*"/> <filterset> Added: trunk/xmlunit/src/etc/xmlunit-maven-metadata.xml =================================================================== --- trunk/xmlunit/src/etc/xmlunit-maven-metadata.xml (rev 0) +++ trunk/xmlunit/src/etc/xmlunit-maven-metadata.xml 2008-06-10 13:48:04 UTC (rev 276) @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<!-- +Copyright (c) 2007-2008, Jeff Martin, Tim Bacon +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the xmlunit.sourceforge.net nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +--> +<metadata> + <groupId>@GROUP@</groupId> + <artifactId>@ARTIFACT@</artifactId> + <version>@VERSION@</version> + <versioning> + <versions> + <version>0.8</version> + <version>1.0</version> + <version>1.1</version> + <version>1.2</version> + <version>@VERSION@</version> + </versions> + </versioning> +</metadata> Property changes on: trunk/xmlunit/src/etc/xmlunit-maven-metadata.xml ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-06-10 13:42:09
|
Revision: 275 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=275&view=rev Author: bodewig Date: 2008-06-10 06:41:44 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Xavier says: Ivy likes to read and speak British Modified Paths: -------------- trunk/xmlunit/src/etc/xmlunit-ivy.xml Modified: trunk/xmlunit/src/etc/xmlunit-ivy.xml =================================================================== --- trunk/xmlunit/src/etc/xmlunit-ivy.xml 2008-06-10 09:35:15 UTC (rev 274) +++ trunk/xmlunit/src/etc/xmlunit-ivy.xml 2008-06-10 13:41:44 UTC (rev 275) @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. --> <ivy-module version="1.3"> - <info organization="@GROUP@" + <info organisation="@GROUP@" module="@ARTIFACT@" revision="@VERSION@" publication="@DATE@"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-06-10 09:35:12
|
Revision: 274 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=274&view=rev Author: bodewig Date: 2008-06-10 02:35:15 -0700 (Tue, 10 Jun 2008) Log Message: ----------- bump version after tag Modified Paths: -------------- trunk/xmlunit/build.xml trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java Modified: trunk/xmlunit/build.xml =================================================================== --- trunk/xmlunit/build.xml 2008-06-10 09:23:58 UTC (rev 273) +++ trunk/xmlunit/build.xml 2008-06-10 09:35:15 UTC (rev 274) @@ -37,7 +37,7 @@ <property file="build.properties"/> <!-- Version --> - <property name="xmlunit.version" value="1.2"/> + <property name="xmlunit.version" value="1.3alpha"/> <!-- some locations --> <property name="src.dir" value="src"/> Modified: trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java =================================================================== --- trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-06-10 09:23:58 UTC (rev 273) +++ trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-06-10 09:35:15 UTC (rev 274) @@ -558,7 +558,7 @@ * @return current version */ public static String getVersion() { - return "1.2"; + return "1.3alpha"; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-06-10 09:24:04
|
Revision: 273 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=273&view=rev Author: bodewig Date: 2008-06-10 02:23:58 -0700 (Tue, 10 Jun 2008) Log Message: ----------- fix version in tag Modified Paths: -------------- tags/XMLUnit-Java-1.2/build.xml tags/XMLUnit-Java-1.2/src/java/org/custommonkey/xmlunit/XMLUnit.java Modified: tags/XMLUnit-Java-1.2/build.xml =================================================================== --- tags/XMLUnit-Java-1.2/build.xml 2008-06-10 09:22:52 UTC (rev 272) +++ tags/XMLUnit-Java-1.2/build.xml 2008-06-10 09:23:58 UTC (rev 273) @@ -37,7 +37,7 @@ <property file="build.properties"/> <!-- Version --> - <property name="xmlunit.version" value="1.2alpha"/> + <property name="xmlunit.version" value="1.2"/> <!-- some locations --> <property name="src.dir" value="src"/> Modified: tags/XMLUnit-Java-1.2/src/java/org/custommonkey/xmlunit/XMLUnit.java =================================================================== --- tags/XMLUnit-Java-1.2/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-06-10 09:22:52 UTC (rev 272) +++ tags/XMLUnit-Java-1.2/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-06-10 09:23:58 UTC (rev 273) @@ -558,7 +558,7 @@ * @return current version */ public static String getVersion() { - return "1.2alpha"; + return "1.2"; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-06-10 09:22:49
|
Revision: 272 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=272&view=rev Author: bodewig Date: 2008-06-10 02:22:52 -0700 (Tue, 10 Jun 2008) Log Message: ----------- fix version Modified Paths: -------------- trunk/xmlunit/build.xml trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java Modified: trunk/xmlunit/build.xml =================================================================== --- trunk/xmlunit/build.xml 2008-06-10 09:18:42 UTC (rev 271) +++ trunk/xmlunit/build.xml 2008-06-10 09:22:52 UTC (rev 272) @@ -37,7 +37,7 @@ <property file="build.properties"/> <!-- Version --> - <property name="xmlunit.version" value="1.2alpha"/> + <property name="xmlunit.version" value="1.2"/> <!-- some locations --> <property name="src.dir" value="src"/> Modified: trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java =================================================================== --- trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-06-10 09:18:42 UTC (rev 271) +++ trunk/xmlunit/src/java/org/custommonkey/xmlunit/XMLUnit.java 2008-06-10 09:22:52 UTC (rev 272) @@ -558,7 +558,7 @@ * @return current version */ public static String getVersion() { - return "1.2alpha"; + return "1.2"; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2008-06-10 09:18:44
|
Revision: 271 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=271&view=rev Author: bodewig Date: 2008-06-10 02:18:42 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Tag version 1.2 Added Paths: ----------- tags/XMLUnit-Java-1.2/ Copied: tags/XMLUnit-Java-1.2 (from rev 270, trunk/xmlunit) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2008-06-10 09:10:40
|
Bugs item #1985229, was opened at 2008-06-05 10:45 Message generated for change (Comment added) made by bodewig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1985229&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.1 >Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: MATSUHASHI KAZUAKI (kmatsuhashi) Assigned to: Stefan Bodewig (bodewig) Summary: SimpleXpathEngine throws NPE for invalid xpath given Initial Comment: My environment: xmlunit-1.1, Windows 2000, JDK 1.5.0_7 with Xalan-j2.7.0, ant-1.7.0, junit3.8.1 <<What I noticed about xmlunit-1.1>> I modified the org.custommonkey.xmlunit.test_SimpleXpathEngine class: add a test method "testEvaluateInvalidXPath". ============== org.custommonkey.xmlunit.test_SimpleXpathEngine ====================== public void testEvaluateInvalidXPath() throws Exception { String xpath = "count(test//*[@attrOne='open source])"; String result = newXpathEngine().evaluate(xpath, testDocument); } ------------------------------------------------------------------------------------- When I ran the junit, I got the following report: ============== TEST-org.custommonkey.xmlunit.test_SimpleXpathEngine.xml ============= <testcase classname="org.custommonkey.xmlunit.test_SimpleXpathEngine" name="testEvaluateInvalidXPath" time="0.032"> <error type="java.lang.NullPointerException">java.lang.NullPointerException at org.custommonkey.xmlunit.SimpleXpathEngine.performTransform(SimpleXpathEngine.java:136) at org.custommonkey.xmlunit.SimpleXpathEngine.evaluate(SimpleXpathEngine.java:202) at org.custommonkey.xmlunit.test_SimpleXpathEngine.testEvaluateInvalidXPathWith(test_SimpleXpathEngine.java:85) </error> </testcase> ------------------------------------------------------------------------------------- The root cause was obvious: the XPath I gave was syntactically wrong. It had odd number of single quotation. It had to be 'open source' rather than 'open source. Also I noticed some lines of messages from the underlying XSLT processor (in my case, Xalan-j 2.7.0) were written into System.err. These messages were valuable. They told me what was the cause. ============== TEST-org.custommonkey.xmlunit.test_SimpleXpathEngine.xml ============= <system-err><![CDATA[SystemId は不明; 行 #1; 桁 #251; 引用符が誤っているリテラル... 単一引用符が必要でした! SystemId は不明; 行 #1; 桁 #251; ] が必要でしたが、source が見つかりました (エラーのロケーションは不明)java.lang.ClassCastException: org.apache.xpath.objects.XString ]]></system-err> ------------------------------------------------------------------------------------- <<Discussion>> Point.1: NullPointerException is terrible. Why I got a NullPointerException? The XMLunit document says the design idea is to throw org.custommonkey.xmlunit.exceptions.ConfiguratinException when a invalid XPath given rather than NPE. Point.2: Why the XSLT processor diagnostics goes to System.err? I want the message to be carried by the thrown ConfigurationException object rather than immediately swept away into System.err. Let me tell why. I've developed some custom Ant tasks (namely "AntUnit4XML") which drives the xmlunit's SimpleXpathEngine object under the AntUnit assertion mechanism. When I ran my assertion tasks, the messages from XSLT processor behind the SimpleXpathEngine vanished somehow (actually swept away into System.err of the forked process, which is invisible). I tried to figure out how to salvage the diagnostics but I couldn't. Eventually I misses the XSLT processor diagnostics. <<How I investigated>> I changed my testcase to make it more informative: ============== org.custommonkey.xmlunit.test_SimpleXpathEngine ====================== public void testEvaluateInvalidXPath() throws Exception { String xpath = "count(test//*[@attrOne='open 'source'])"; try { String result = newXpathEngine().evaluate(xpath, testDocument); fail("expected Exception to be thrown but not"); } catch (NullPointerException npe) { String msg = "NullPointerException has been thrown." + ((npe.getMessage() != null) ? " with message \"" + npe.getMessage() + "\"" : ""); fail(msg); } catch (ConfigurationException ce) { String msg = ce.getClass().getName() + " has been thrown with message \"" + ce.getMessage() + "\""; //assertTrue(msg + "\", expected \"Error\" contained but not", // ce.getMessage().indexOf("Error")>=0); fail(msg); } catch (Exception e) { String msg = "unexpected " + e.getClass().getName() + ((e.getMessage() != null) ? " " + e.getMessage() : ""); fail(msg); } } ------------------------------------------------------------------------------------- Then I examined Saxon6.5.5 as alternative XSLT processor to see how it deals with my invalid XPath. I put the saxon.jar in the JRE/lib/endorsed dir, and slightly modified the build.xml' test target: ============================= build.xml ================================================= <target name="test" depends="compile" description="runs the tests"> <junit ... <sysproperty key="javax.xml.transform.TransformerFactory" value="com.icl.saxon.TransformerFactoryImpl"/> ... ----------------------------------------------------------------------------------------- When I run the test, I got the following report. ============== TEST-org.custommonkey.xmlunit.test_SimpleXpathEngine.xml ============= <testcase classname="org.custommonkey.xmlunit.test_SimpleXpathEngine" name="testEvaluateInvalidXPath" time="0.25"> <failure message="expected:<...test><nodeWithoutAttributes>intellectual property rights </nodeWithoutAttributes><nodeWithoutAttributes>make us all poorer </nodeWithoutAttributes><nodeWithAttributes attrOne="open source " attrTwo="is the answer ">free your code from its chains</nodeWithAttributes></tes...> but was:<...xpathResult><test><nodeWithoutAttributes>intellectual property rights </nodeWithoutAttributes><nodeWithoutAttributes>make us all poorer </nodeWithoutAttributes><nodeWithAttributes attrOne="open source " attrTwo="is the answer ">free your code from its chains</nodeWithAttributes></test></xpathResul...>" type="junit.framework.ComparisonFailure">junit.framework.ComparisonFailure: expected:<...test><nodeWithoutAttributes>intellectual property rights </nodeWithoutAttributes><nodeWithoutAttributes>make us all poorer </nodeWithoutAttributes><nodeWithAttributes attrOne="open source " attrTwo="is the answer ">free your code from its chains</nodeWithAttributes></tes...> but was:<...xpathResult><test><nodeWithoutAttributes>intellectual property rights </nodeWithoutAttributes><nodeWithoutAttributes>make us all poorer </nodeWithoutAttributes><nodeWithAttributes attrOne="open source " attrTwo="is the answer ">free your code from its chains</nodeWithAttributes></test></xpathResul...> at org.custommonkey.xmlunit.test_SimpleXpathEngine.testGetXPathResultNode(test_SimpleXpathEngine.java:60) </failure> </testcase> ... <system-out><![CDATA[[testEvaluateInvalidXPath] org.custommonkey.xmlunit.exceptions.ConfigurationException has been thrown. message="Failed to compile stylesheet. 1 error detected." ]]></system-out> <system-err><![CDATA[Error at xsl:value-of on line 1 of file:/C:/eclipse/workspace/xmlunit-1.1/: Error in expression count(test//*[@attrOne='open source]): expected "]", found "<name>" ]]></system-err> ------------------------------------------------------------------------------------- Saxon did not throw NPE. Saxon threw TransformerConfigurationException, which was caught by try ... catch ... block in the test method, and wrapped by SimpleXpathEngine into a ConfigurationException. Goodness. This is the way we want it work. This examination proved that it was Xalan who actually threw the NPE. Then my next question I got was how can I make Xalan not to throw NPE? .. well, let me tell about it later. I wanted the ConfigurationException contain the diagnostics from SAXON rather than System.err. Why the diagnostics goes to System.err? I checked the source code of SimpleXpathEngine#performTransform() and found no javax.xml.transform.ErrorListener is set to the TrasnformerFactory. If no ErrorListener is provided, the TransformerFactory will print the messages into System.err. This portion can be improved. I added a SimpleErrorListener class and changed the performTransform() method as follows: ============== org.custommonkey.xmlunit.SimpleXpathEngine =========================== private void performTransform(String xslt, Document document, Result result) throws TransformerException, ConfigurationException { StringWriter sw = new StringWriter(); ErrorListener errorListener = new SimpleErrorListener(new PrintWriter(sw)); try { StreamSource source = new StreamSource(new StringReader(xslt)); TransformerFactory trf = XMLUnit.getTransformerFactory(); trf.setErrorListener(errorListener); Transformer tr = trf.newTransformer(source); tr.setErrorListener(errorListener); tr.transform(new DOMSource(document), result); } catch (javax.xml.transform.TransformerConfigurationException ex) { throw new ConfigurationException(sw.toString()); } } ------------------------------------------------------------------------------------- With this code change applied, the testcase gave me following report ============== TEST-org.custommonkey.xmlunit.test_SimpleXpathEngine.xml ============= <testcase classname="org.custommonkey.xmlunit.test_SimpleXpathEngine" name="testEvaluateInvalidXPath" time="0.0"> <failure message="org.custommonkey.xmlunit.exceptions.ConfigurationException has been thrown with message "Error at xsl:value-of on line 1 of file:/C:/eclipse/workspace/xmlunit-1.1/: Unmatched quote in expression count(test//*[@attrOne='open source])"" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: org.custommonkey.xmlunit.exceptions.ConfigurationException has been thrown with message "Error at xsl:value-of on line 1 of file:/C:/eclipse/workspace/xmlunit-1.1/: Unmatched quote in expression count(test//*[@attrOne='open source])" at org.custommonkey.xmlunit.test_SimpleXpathEngine.testEvaluateInvalidXPath(test_SimpleXpathEngine.java:98) </failure> </testcase> ------------------------------------------------------------------------------------- OK, now the message is wrapped in the ConfigurationException. This is the way things should be. With the changes to performTransform() applied, I tried Xalan to see if the NPE still be raised. This time I got the following report: ============== TEST-org.custommonkey.xmlunit.test_SimpleXpathEngine.xml ============= <testcase classname="org.custommonkey.xmlunit.test_SimpleXpathEngine" name="testEvaluateInvalidXPath" time="0.046"> <failure message="org.custommonkey.xmlunit.exceptions.ConfigurationException has been thrown with message "Error on line 1 column 179: 引用符が誤っているリテラル... 単一引用符が必要でした!Errorjavax.xml.transform.TransformerException: 引用符が誤っているリテラル... 単一引用符が必要でした!Errorjavax.xml.transform.TransformerException: javax.xml.transform.TransformerException: 引用符が誤っているリテラル... 単一引用符が必要でした!"" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: org.custommonkey.xmlunit.exceptions.ConfigurationException has been thrown with message "Error on line 1 column 179: 引用符が誤っているリテラル... 単一引用符が必要でした!Errorjavax.xml.transform.TransformerException: 引用符が誤っているリテラル... 単一引用符が必要でした!Errorjavax.xml.transform.TransformerException: javax.xml.transform.TransformerException: 引用符が誤っているリテラル... 単一引用符が必要でした!" at org.custommonkey.xmlunit.test_SimpleXpathEngine.testEvaluateInvalidXPath(test_SimpleXpathEngine.java:98) </failure> </testcase> ------------------------------------------------------------------------------------- Now Xalan ceased throwing NPE. Fine. It seems that setting a ErrorListener object explicitly to the TransformerFactory fixed the NPE problem of Xalan. The message produced by Xalan tends to be verbose, uselessly repeating a single sentence twice or three times. I wanted to make it concise but could not find how to. <<Summary of changes I propose>> - modify src/java/org.custommonkey.xmlunit.SimpleXpathEngine - add src/java/org.custommonkey.xmlunit.SimpleErrorListener - add src/java/org.custommonkey.xmlunit.SAXSourceLocator - modify tests/java/org.custommonkey.xmlunit.test_SimpleXpathEngine - add tests/java/org.custommonkey.xmlunit.test_SimpleErrorListener ---------------------------------------------------------------------- >Comment By: Stefan Bodewig (bodewig) Date: 2008-06-10 11:10 Message: Logged In: YES user_id=113148 Originator: NO fine, so we can close this issue. Thanks. ---------------------------------------------------------------------- Comment By: MATSUHASHI KAZUAKI (kmatsuhashi) Date: 2008-06-10 10:38 Message: Logged In: YES user_id=823604 Originator: YES Stefan, Thank you for looking at the issue. I totally agree with your idea. ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-06-06 16:23 Message: Logged In: YES user_id=113148 Originator: NO I've introduced an easier mechanism which on Java 1.4 produces org.custommonkey.xmlunit.exceptions.ConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Literalwert mit falschen Anführungszeichen... einfache Anführungszeichen erwartet! for me (the German text means "literal with wrong quotes, single quotes expected") which I think should be good enough. JDK 1.6 produces a generic "couldn't compile stylesheet warning" here, but JAXP13XpathEngine gives the same exception message as 1.4 in the second exception nested into the resulting XpathException. I'd leave it at that, feel free to reopen the issue if you feel trunk could be improved further. http://xmlunit.svn.sourceforge.net/viewvc/xmlunit?view=rev&revision=268 ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-06-06 16:02 Message: Logged In: YES user_id=113148 Originator: NO personally I'd rather expect an XpathException than a ConfigurationException. I've written and committed a testcase based on yours which only expects either an XpathException or a ConfigurationException and it passes on stock JDK 1.4.2, JDK 1.5 and JDK 1.6, so it really only seems to be Xalan 2.7.0 - you might think about upgrading Xalan 2.7.1. The NPE seems to be coming from XMLUnit and occurs because your version of Xalan returns null for TransformerFactory.newTransformer which is evil. I'll add an explicit null guard. While I agree that having better diagnostics here would be nice, I'm more than a bit wary of adding three classes to get at it - in particular since this is more of an implementation specific problem with an obsolete version of Xalan. ---------------------------------------------------------------------- Comment By: Stefan Bodewig (bodewig) Date: 2008-06-05 13:16 Message: Logged In: YES user_id=113148 Originator: NO many thanks for the very thorough analysis, I'll look into your patch later today. For your project you'd probably better use XMLUnit.newXpathEngine which is supposed to provide you with a JAXP 1.3 XPath engine in your setup. In my experience there are too many problems with broken XSLT processors when using SimpleXpathEngine. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=1985229&group_id=23187 |
From: <bo...@us...> - 2008-06-10 09:02:13
|
Revision: 270 http://xmlunit.svn.sourceforge.net/xmlunit/?rev=270&view=rev Author: bodewig Date: 2008-06-10 02:02:22 -0700 (Tue, 10 Jun 2008) Log Message: ----------- set date Modified Paths: -------------- trunk/xmlunit/src/user-guide/XMLUnit-Java.xml Modified: trunk/xmlunit/src/user-guide/XMLUnit-Java.xml =================================================================== --- trunk/xmlunit/src/user-guide/XMLUnit-Java.xml 2008-06-10 08:57:47 UTC (rev 269) +++ trunk/xmlunit/src/user-guide/XMLUnit-Java.xml 2008-06-10 09:02:22 UTC (rev 270) @@ -36,7 +36,7 @@ </revision> <revision> <revnumber>1.2</revnumber> - <date>...</date> + <date>June 2008</date> <revremark>Documentation for XMLUnit Java 1.2</revremark> </revision> </revhistory> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |