[xquery-talk] BumbleBee XQuery Test Harness

Jason Hunter jhunter at xquery.com
Wed Oct 15 15:46:37 PDT 2003


Per Bothner wrote:

> I think it is very useful to have a standard framework for
> writing tests 

Absolutely!  In my mind, the most likely achilles heel of XQuery is its 
portability.  BumbleBee should help keep that in check.

> Here are some (I hope constructive) questions:
> 
> The most obvious question is the format of the test cases, and the
> obvious sub-question is why not XML?  Look at the use-cases.xml
> in Kawa's gnu/xquery/testsuite directory.  That is an xml file
> that contains a subset of the XQuery uses-cases.  The file
> TestSuite.java (which extends TestMisc.java) is the driver.
> 
> There are pluses and minus on both sides.  The bee format is
> slightly easier for humans to read and write, and it is probably
> easier to write a bee parser than an xml parser.  On the other hand,
> you presumably already have an xml parser (doesn't jdk 1.4 include
> one, or does it just have the interfaces?), and having the test file
> be xml allows yoo to filter and process it - perhaps using xquery.

I believe it's all too common to use XML just for the sake of using XML. 
  That's especially true for technologies related in some way to XML. 
In this situation, looking at the plusses and minuses, we see XML as a 
more difficult format to author in, and the primary goal here is to 
author tests.  We should remove as many burdens as we can toward that goal.

Side note: It's especially difficult to author tests in XML not just 
because XML is more verbose, but because the query and result contents 
themselves use XML.  Thus the tests would have to be escaped or in CDATA 
sections, and neither of those solutions is human friendly.  What's 
more, when the query or result use CDATA sections themselves, then it 
gets extremely difficult to decipher what's what.

> Why do you require jdk 1.4 to run bumblebee?  What features do
> you need not in earlier jdks?  Have you tried gcj or kaffe?

The Saxon engine and the Cerisent adapter both require JDK 1.4.  JDK 1.4 
has been out for several years and has been widely ported, and using JDK 
1.4 makes XML work much more reliable (no need to shuffle JARs), so we 
thought it natural to set JDK 1.4 as the current minimum level.  We 
could change that, but it would require discussions with a customer 
having that need.

> Why do you use JAVA_HOME?  It seems you only use it to get
> the java executable.  Why not just use a $JAVA variable,
> which defaults to the java in PATH?  That seems more portable,
> given that JAVA_HOME isn't even a Sun standard.

JAVA_HOME seems the most widely used name for this type of variable.  I 
remember seeing it even back in 1996.  Just looking at my current code 
bases I see it used by Ant, Tomcat, JDOM, and Xindice.

> Have you written any adapters to XQuery implementations that
> are *not* Java-based?  I see hints of it - the manual implies
> the cerisent adapter connects over the network.

The Cerisent and Ipedo adapters connect over the network.  Cerisent is 
not written in Java.

Thanks for the feedback!

-jh-




More information about the talk mailing list