DOM Conformance Test Suites build process

This document

Work in progress, will be updated in parallel with the building process acquiring more options. Please check back regularly for updates. For comments, please send mail to the DOM TS mailing list.

Overview

This is preliminary (2003-02-12) documentation on how to build the DOM Test Suite. It explains the most typical use case and will include instructions on how to build other adapters in the near future.

CVS Access

All test files necessary to generate the DOM TS are on the W3C CVS repository in a publically available hierarchy, allowing for anonymous checkout.

In order to do this, you need to set the following in your environment:

CVSROOT=:pserver:anonymous@dev.w3.org:/sources/public

First, log on

cvs logon

When prompted for a password, give

anonymous

Check out the entire DOM-Test-Suite branch (or any part thereof you're interested in).

cvs checkout 2001/DOM-Test-Suite

After checking out the source, log out of CVS.

cvs logout

Software needed prior to build

You will need the following software to build the DOM TS (the Java and ECMA Script code, the DOM TS Markup Language in W3C Schema and DTD form.

You will also need the following softwares to generate SVG DOMTSML which is experimental:

Make sure you have included apache-ant-<version>/bin — and optionally sed and patch — in your PATH and set JAVA_HOME:

> echo %PATH%
C:\Program Files\Apache.org\apache-ant-1.6.1\bin;[...]
> echo %JAVA_HOME%
C:\Program Files\Sun\j2sdk1.4.2_04
      

or

> echo $PATH
/usr/local/apache-ant-1.6.1/bin:[...]
> echo $JAVA_HOME
/usr/local/j2sdk1.4.2_04
      

Any Java VM 1.1 or later should work.

Make DOM-Test-Suite the current directory (or, if you just want to test the build, copy all files from the DOM-Test-Suite directory to a location of your choosing) and do:

ant usage

to see what options you have to build the DOM TS.

Ant tasks

Note: If you get a out of memory error (very likely if you build the DOM Level 3 Core tests), you can increase heap size on most Sun VM's by setting:

set ANT_OPTS=-Xmx512M

(or any higher number that would do)

The tasks you will probably most oftenly use are:

<dom-version>-<module>-jar
to build the java tests of the DOM module with a specific DOM Level.
junit-run
download JUnit and build the adapter needed to run tests using JUnit.
<dom-version>-<module>-gen-ecmascript
to generate the ECMA script tests.
<dom-version>-<module>-gen-jsunit
creates the html files containing the ECMA script tests for running with JsUnit.
<dom-version>-schema
to generate the DOM TS ML from the DOM specification.
<dom-version>-validate-tests
to validate the XML test descriptions before building.

with the possible choices:

<dom-version>
dom1, dom2.
<module>
core, html.

Example:

ant dom2-core-jar

The builds take approximately 10 minutes each and begin by Ant downloading the DOM specifications from the W3C server. Please make sure that you have a proper internet connection.

Ant will generate the following directories (all within the current directory):

lib
which contains Junit and the DOM specifications that are be downloaded by Ant.
dist
which contains dom1-core-jar, junit-jar and junit-run.jar.
build
which contains the generated schema files, metadata about the tests and the matrix which states what tests exist and what their intended purpose is. This directory contains the following subdirectories:
ecmascript
containing the ECMAScript (ECMA-262) files
java
containing the java code

Running the test suite

There are more than one ways to run the DOM TS. If you have built the test suite following the instructions in this document, you will be most interested in running it with JUnit and JsUnit, respectively. There are also adaptors for Avalon, if you prefer this framework (instructions on how to run the test suite using Avalon will be added shortly).

JUnit

First, make sure to have Junit on your system by running the following command:

ant junit-run

You need to generate a jar file from the test suite. For example, to generate the jar file for DOM Level 2 Core tests:

ant dom2-core-jar

Make sure to have the appropriate interfaces for the DOM module you're testing in your CLASSPATH.

Then go in the build directory, and install your DOM implementation there (by copying it in the directory if it's a JAXP-compliant or DOM Level 3 Core-compliant implementation), or by adding it in the CLASSPATH. At this stage, you build directory looks like as follow:

dom2-core-interfaces.xml  dom2.dtd       junit.jar
dom2-core.jar             java           xercesImpl.jar
dom2-interfaces.xml       junit-run.jar  xml-apis.jar

Finally, run the tests:

java -jar dom2-core.jar

The output will give you a clue as to what goes wrong, for which test, and so on (check an example of output). This has been tested with Xerces, Crimson and XMLParserv2.

JsUnit

First, download jsunit.zip from http://www.jsunit.net and place it in the 2001/DOM-Test-Suite/lib directory.

You need to generate the tests from the test suite. For example, to generate the jar file for DOM Level 1 core tests:

ant dom1-core-gen-jsunit

Open the file testRunner.html from the 2001/DOM-Test-Suite/build/ecmascript/jsunit directory in the user agent that you would like to test. Using the "browse" button, select the file you want to test in the 2001/DOM-Test-Suite/build/ecmascript/level<version> directory and run it in JsUnit. You can also use the file alltests.html in the same directory if you want to run all the tests. You will see an error log after the run.

CVS Organisation

We will organise the contents for easier accessibility before release. All folders carry fairly self-evident names; if you want to browse the stylesheets that are used, go to transforms, if you want to look at the XML test source files, go to tests, and so forth.

Notes

If you build the DOM Test Suite, bear in mind that it has not been officially released; you can and should therefore not use the results to make any claims as far as DOM conformance is concerned. The DOM TS will be officially released shortly, in the meanwhile we welcome your comments to the DOM TS mailing list.


The DOM Test Suite Team