W3C home > Mailing lists > Public > www-dom-ts@w3.org > April 2001

Thoughts on language independent rep

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Fri, 27 Apr 2001 13:21:47 -0600
Message-ID: <B2C1451A181BD411B88A00E018C1C19C08ABFE@thor.aeathtl.com>
To: "'www-dom-ts@w3.org'" <www-dom-ts@w3.org>
Cc: "'xmlconf-developer@lists.sourceforge.net'" <xmlconf-developer@lists.sourceforge.net>
I'd really like to be able to round-trip the language independent representation (LIR) with JUnit code, that is be able to generate the  LIR from JUnit as well as generate the JUnit from the LIR
without degradation.  This would help rapid development of tests since the tests could be developed within Java IDE's and exported to LIR.

I haven't had any experience with it, but JavaML  (http://www.cs.washington.edu/homes/gjb/JavaML/, related article at http://www-106.ibm.com/developerworks/library/javaml/) could be used to XML-ify
the JUnit based tests and then an XSLT transform could be used to extract the essential core of the tests in a LIR representation.  This would allow pretty rapid iteration of the LIR design against
the existing DOM 1 tests.

I would suggest that there be explicit elements for the various xUnit asserts, for example that there be elements like:


<assertEquals expected="ABCD" actual="somevar">Desc could go here</assertEquals>
<assertNull actual="othervar"/>
<assertNotEquals.../>
<assertNotNull.../>

Fetching a document and binding it to a variable should be a distinct element:

<document var="doc" href="staff.xml"/>

Invoking a method, probably the best approach would be to mimic the best of IDispatch::invoke and java.lang.reflect.Method.invoke.  Maybe a good design criteria would be if you could implement an LIR
interpreter on top of IDispatch::invoke or java.lang.reflect.Method.invoke.

<invoke target="doc" property="documentElement"/>

<invoke target="doc" method="getElementsByTagName" arguments="employee"/>

I had thought about using a $ to distinguish between variable references and literals, but it is probably better to have distinct elements for literals and had everything either take variable
references or work on the result from the last invoke.

<string var="ABCD">ABCD</string>
<int var="FIFTH">4</int>
Received on Friday, 27 April 2001 15:23:53 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:02 UTC