From: "Michael Rettig" <[EMAIL PROTECTED]>
> In jellyUnit is there support for using assertEquals with XPath? I have an
xml value that I want to compare like so:
>
> <test:assertEquals xpath="$doc/order/item/@quantity" value="4"/>
>
> I am presently using the assert with xpath...
>
> <test:assert xpath="$doc/order/item/@quantity = '4'"/>
The above is the best way to perform XPath assertions right now.
> This works find, but for failure, it doesn't give me enough information. I
want to know what the actual value was, if anything.
>
> Currently, error messages look like this...
>
> evaluating xpath:
($:docchild::msg/child::order/child::item/attribute::quantity = "4")
The error message is not ideal. We should try tidy that up to show a cleaner
error message...
> Also, is there a way to get line numbers from JellyUnit scripts? When I
get test failures know, I get a stack trace, but I don't know on which line
in the JellyUnit script there was a failure.
Agreed. This needs doing ASAP. Its the same with normal Jexl based unit test
assertions as well - knowing the line number in the JellyUnit script as well
as the expression that failed can really help pinpoint what failed.
The TagScript (the Script object which invokes Tags) has the line number
information. So if a Tag throws an exception it gets wrapped in a
JellyException with the line number information adorned inside it. We just
need a way to make this information available to the JUnit TestRunner. Maybe
we need a LocatorTag interface for Tags which are location-aware. Something
like...
/** defines a location aware tag */
public interface LocationTag {
public void setLineNumber(int number);
public void setColumnNumber(int number);
public void setFilename(String filename);
}
I'll see if I get some cycles this week to look at improving this. By all
means dive in anyone if you've time. I've raised an issue to summarize this
problem...
http://jira.werken.com/secure/ViewIssue.jspa?id=10293
This shouldn't be too hard to fix.
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]>