Forum Discussion
Frank_Cohen
13 years agoOccasional Contributor
I'm making a little progress here using this code:
WsdlTestCaseRunner runner = testcase.run(pmap, false);
if (TestRunner.Status.FAILED.compareTo(runner.getStatus()) != 0) {
// We never get here. Appears to be a bug.
}
if (TestRunner.Status.FINISHED.compareTo(runner.getStatus()) != 0) {
Iterator it=runner.getResults().iterator();
while(it.hasNext())
{
TestStepResult tsr=(TestStepResult)it.next();
System.out.println( "Frankolo3: " + tsr.getError() );
for(String n: tsr.getMessages())
{
System.out.println( "frankolo5: " + n+" ");
}
}
}
I added an XPath assertion that purposely fails. Here's what I see logged:
Frankolo3: null
frankolo5: [XPath Match] XPathContains assertion failed for path [//part[1]] : Exception:org.custommonkey.xmlunit.Diff
[different] Expected attribute value '20' but was '10' - comparing <part location="20"...> at /part[1]/@location to <part location="10"...> at /part[1]/@location
Next I'm going to look for how to detect this as an exception.
Hey! At 34 views of this thread, someone else should have solve this! Anyone?!#@ :-)
-Frank
WsdlTestCaseRunner runner = testcase.run(pmap, false);
if (TestRunner.Status.FAILED.compareTo(runner.getStatus()) != 0) {
// We never get here. Appears to be a bug.
}
if (TestRunner.Status.FINISHED.compareTo(runner.getStatus()) != 0) {
Iterator it=runner.getResults().iterator();
while(it.hasNext())
{
TestStepResult tsr=(TestStepResult)it.next();
System.out.println( "Frankolo3: " + tsr.getError() );
for(String n: tsr.getMessages())
{
System.out.println( "frankolo5: " + n+" ");
}
}
}
I added an XPath assertion that purposely fails. Here's what I see logged:
Frankolo3: null
frankolo5: [XPath Match] XPathContains assertion failed for path [//part[1]] : Exception:org.custommonkey.xmlunit.Diff
[different] Expected attribute value '20' but was '10' - comparing <part location="20"...> at /part[1]/@location to <part location="10"...> at /part[1]/@location
Next I'm going to look for how to detect this as an exception.
Hey! At 34 views of this thread, someone else should have solve this! Anyone?!#@ :-)
-Frank