XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Testing XML don't use xUnit

On Wed, Apr 10, 2013 at 2:48 PM, Andrew Welch <andrew.j.welch@gmail.com> wrote:
>> I'm not sure what you think you might be missing because your previous
>> response suggested you got it.
>>
>> As far as possible you want your tests to carry on working unchanged
>> if the structure of the XML changes. That will not happen if your test
>> cases expose Xpaths.
>
> Examples please.
>
> if I compare //title in the input, with //title in the output - how
> will that not handle changes in the structures of the XML ?
>
> I've happily used this technique on 2 large projects now (I'm pretty
> confident in how it works : )
>

I'll take your example from the other thread.

Below if as the result of changes to the structure in the XMLe any of
the elements "some" "path" or "to" change, disappear, become reodered,
or now require predicates to be included, changed or removed that test
will not work. Note the multitude of things that the test is
vulnerable to.


String someValue = runQueryOnInput("/some/path/to/val/string(.)");

String valueInResult = runQueryOnOutput("/result/path/to/val/string(.)");

assertEquals(someValue, valueInResult);

Uche correctly identified that it's the ability in Schematron to set a
context that makes it resilient to this problem.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS