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. |