From: "Wannheden, Knut" <[EMAIL PROTECTED]> > > From: Michael Rettig [mailto:[EMAIL PROTECTED]] > > > > ----- Original Message ----- > > From: Dominique Devienne <[EMAIL PROTECTED]> > > Date: Mon, 25 Nov 2002 10:43:27 -0600 > > To: "''Jakarta Commons Users List''" <[EMAIL PROTECTED]> > > Subject: RE: [jelly] assertEquals with XPATH > > > This was discussed on the Ant forums a while back, and > > someone pointed to > > > xmlunit on SF, which has assertions for XML documents. Regards, --DD > > > > > > :pserver:[EMAIL PROTECTED]:/cvsroot/xmlunit > > > > > Yes, XMLUnit would be a perfect choice. Everything is already > > implemented. Just the jelly tags have to be created. It > > already has support for comparing xml strings, and input > > streams. Upon failures, it gives meaningful descriptions of > > comparison failures. > > > > Did I hear somebody is going to create the patch? > > > > I have written a simple TagLibrary which uses XMLUnit to compare two XML > documents. There is a <assertDocumentsEqual/> tag which is used either with > only the attributes expected and actual: > > <xu:assertDocumentsEqual expected="${doc1}" actual="${doc2}"/> > > or with nested elements: > > <xu:assertDocumentsEqual> > <xu:expected> > <someDocument/> > </xu:expected> > <xu:actual> > <someOtherDocument/> > </xu:actual> > </xu:assertDocumentsEqual> > > Of course also a combination of attribute and nested element is possible.
Wow! That was fast! > The tag works very much like the <x:parse/> tag. An attribute is assumed to > be of type Document, String, URI, Reader, or InputStream. Whereas when > nested elements are used, the evaluated content is used as the XML document. > > If two documents are not identical, the tag throws an AssertionFailedError > (like <junit:assertEquals/>) with the message provided by XMLUnit. Great! > I was hoping I could add some kind of "execute" attribute to the nested > <xu:expected/> and <xu:actual/> tags, which would indicate that the content > should not be evaluated but passed on as is. But that doesn't seem to be > possible or is it? I don't quite follow. If the body of <xu:expected> were static then it wouldn't matter either way would it? Is it dynamic content that you're thinking of? > Comments? This all sounds great! > Anything that's missing or should be renamed in this initial > version? It all seems fine to me. > What's the best way to contribute this tag library? The proper approach is to post a patch to the commons-dev list with [PATCH][jelly] in the subject name. There's more details here... http://jakarta.apache.org/site/source.html James ------- http://radio.weblogs.com/0112098/ __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
