[cddlm] testing, document fragments

Steve Loughran steve_loughran at hpl.hp.com
Fri Dec 2 13:27:24 CST 2005


Ayla Debora Dantas de Souza - Projeto Ourgrid wrote:
> Hi Steve,
> 
> we have seen the test code, but have not started using it yet directly.  
> So, from our part,  feel  free to change it, but  please let  us know  
> when  you finish these more recent changes so that we can use it 
> avoiding rework.

OK. I think I have nearly finished. I've inevitably broken Jun's test 
run, so once we have that working as well then we could say things are 
stable.

More changes
  -comparisons skip over xmlns declaratations
  -more context in error messages
  -added the <cdl:system> wrapper to every response (this was the 
easiest way of handling responses of >1 element in parallel)
  -fixed some quirks related to no namespace elements in xerces having a 
'null' localname

The main thing I've done is delve into the depths of junit and work out 
how it generates tests from methods, and have written the code to 
automatically turn every test document from a test catalog into its own 
test method, with its own success and failure. This is very nice for 
reporting; here is proof that the tests are successfully catching 
resolution failures in my code

http://people.apache.org/~stevel/reports/org/smartfrog/test/unit/sfcore/languages/cdl/standard/14_ResolutionSuccessTest.html

The goal for february will be to get the failure rate in this test suite 
from 100% to 0.


as an aside, this is the first time that I've used the DOM java APIs for 
four years, I had forgotten how awful they are
  -they dont treat namespace declarations as special
  -you cant have an element or attribute outside a document
  -non-namespace behaviour != namespaced element behaviour
  -painful walking through children
  -so painful trying to create a parser, what with java endorsed 
directories.
  -etc etc.

I would strongly discourage anyone from using it in their real code. 
JDom and Xom are both much better. Remember, Dom was originally written 
by netscape for javascript's use; then the w3c committees took it and 
defined it in IDL, C++ and Java. It predates xmlns, and it shows.

> Another point, I always have problems trying to run the ant commands 
> from the cddlm repository because everything is always missing in my 
> machine and than I give up. I wanted to know what are the requirements 
> for running the "ant all" or "ant test".  I have ant 1.6.5, maven 2.0 
> and java 1.5. The current error I have is "Unable to find typedef 
> schemavalidate". Do you know what may be missing?
> 

you need an ant1.7alpha release: http://people.apache.org/~stevel/dist/

If its just the <schemavalidate> task (and it probably is), I could tune 
the build file to not bother validating xsd if the task is not found. As 
long as gump does it every night we can keep track on invalid documents 
without doing it every build.





More information about the cddlm-wg mailing list