# DOM Conformance Test Suite, Level 1 Core

## This document

This document describes how to run the DOM Level 1 Core Test Suite. It also includes pointers to relevant software as well as relevant resources.

The DOM TS has been developed in accordance with the DOM Conformance Test Suites Process Document. For additional information and to download other DOM Test Suites, visit the DOM Conformance Test Suites page.

## Overview

The DOM Conformance Test Suite consist of a series of tests that have been generated from XML test descriptions, then transformed into the two official DOM bindings, Java and ECMA. In order to run the test suite, we have provided the possibility to run the tests using the JUnit and JsUnit testing frameworks, both included in this distribution.

The DOM Level 1 Core TS was released on February 13, 2002.

## Latest Version

Download the latest version of the DOM Level 1 Core Test Suite.

## Distribution

This distribution is organized as follows:

index.html | This file
dom1-core-matrix.html | A cross reference of the tests to the DOM 1 Core Recommendation, pointers to the tests and documentation.
ecmascript/testRunner.html | A modified JSUnit 1.2.6 test runner. JSUnit is licensed under the GNU Public License
ecmascript/app, ecmascript/docs, ecmascript/images, ecmascript/jsunit-self-tests | JSUnit 1.2.6 support files
ecmascript/tests | DOM tests for use with JSUnit
java/dom1-core.jar | DOM tests for Java implementations, includes source code.
java/junit-run.jar | A test framework adapter that supports running dom1-core.jar with the JUnit 3.7 test framework.
java/junit.jar | JUnit 3.7. JUnit 3.7 is licensed under the IBM Public License.
tests/*.xml | Test definitions in XML.
tests/dom1.dtd | Document Type Definition for DOM 1 Core tests.
tests/dom1.xsd | XML Schema for DOM 1 Core tests.
tests/files/ | Test documents
doxygen/ | Documentation generated by doxygen from the generated Java code. Useful in diagnosing test failures. Click here for a class hierarchy.

## Running the ECMAScript tests

The DOM TS currently tests XML and SVG implementations of DOM Level 1 Core. Later revisions will provide testing of HTML implementation conformance with DOM Level 1.

To run the ECMAScript tests, open the JsUnit test runner in the browser you want to test, press the browse button and look for the file "ecmascript/tests/alltests.html". After that, press Run to run all DOM 1 tests compatible with the implementation. If you choose to run individual tests, the above procedure works similarly, just browse for the test you want to run in the "ecmascript/tests" directory.

These tests have been run with Microsoft Internet Explorer 5.0 and later for Microsoft Windows and Mozilla 0.9.8 and Netscape Navigator 6.2 and later for Microsoft Windows, Linux and Apple OS X. Use on Apple OS X required replacing colon (:) in the test case name with slashes (/).

To test the DOM implementation of the Adobe SVG Viewer, select "ecmascript/tests/svg-alltests.html" and press Run.

For JsUnit reference, please visit the JsUnit home page. JsUnit will provide output with indication on how many tests that were run, how many failed and how many errors were found while running. The error log points to the actual test, so identifying what you need to do in your implementation is simplified.

## Running the Java tests

Running the Java tests will require placing a JAXP 1.1 compatible parser on the classpath or placing a common JAXP 1.1 parser (Apache Xerces, Apache Crimson, Oracle XML Developer Kit, or GNUJAXP) in the java/ directory.

Running "java -jar dom1-core.jar" from the java/ directory will write to the console a summary of the parser under test and the results of the tests run in two distinct configurations. The parser under test can be selected by any mechanism supported by JAXP 1.1.

The Java tests may also be run using from JUnit TestRunner's. To run all tests against the default JAXP parser in a default configuration from the JUnit text user interface, run " java -classpath dom1-core.jar junit.textui.TestRunner org.w3c.domts.level1.core.TestDefaultParser". The run the Swing or AWT user interfaces, replace "textui" with "swingui" or "awtui" and add "-noloading" before the test case to not use JUnit's custom ClassLoader, for example, "java -classpath dom1-core.jar junit.swingui.TestRunner -noloading org.w3c.domts.level1.core.TestDefaultParser"

Running "java -jar junit-run.jar" will launch the JUnit SwingUI without the custom ClassLoader.

The following TestSuite's are provided for use within JUnit TestRunner's. These provide the only mechanism for testing implementations that do not support JAXP 1.1 such as Batik or DOM4J.

org.w3c.domts.level1.core.TestBatik | Tests the Apache Batik SVG project (currently fails loading test documents).
org.w3c.domts.level1.core.TestCrimson | Tests the Apache Crimson Parser in the default configuration.
org.w3c.domts.level1.core.TestCrimsonAltConfig | Tests the Apache Crimson Parser in an alternative configuration.
org.w3c.domts.level1.core.TestDefaultParser | Tests the current JAXP 1.1 Parser in the default configuration.
org.w3c.domts.level1.core.TestDefaultParserAltConfig | Tests the current JAXP 1.1 Parser in an alternative configuration.
org.w3c.domts.level1.core.TestDOM4J | Tests DOM4J.
org.w3c.domts.level1.core.TestGNUJAXP | Tests the GNUJAXP Parser in the default configuration.
org.w3c.domts.level1.core.TestGNUJAXPAltConfig | Tests the GNUJAXP Parser in an alternative configuration.
org.w3c.domts.level1.core.TestOracle | Tests the Oracle XML Parser in the default configuration.
org.w3c.domts.level1.core.TestOracleAltConfig | Tests the Oracle XML Parser in an alternative configuration.
org.w3c.domts.level1.core.TestXerces | Tests the Apache Xerces Parser in the default configuration.
org.w3c.domts.level1.core.TestXercesAltConfig | Tests the Apache Xerces Parser in an alternative configuration.

## Feedback

We look forward to your comments. The DOM TS Group communicates primarily through the DOM TS mailing list (archive).

## Copyright

Tests in this table are released under the W3C Software Copyright Notice and license:
Copyright (c) 2002 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. This program is distributed under the W3C's Software Intellectual Property License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See W3C License http://www.w3.org/Consortium/Legal/ for more details.

## Acknowledgments

The DOM TS was jointly launched by the W3C and NIST. It is, however, a publically developed and open framework. Reaching the point of being able to finalize and release the DOM TS would not have been possible were it not for the contribution from several people in the developer community, especially Curt Arnold and Fred Drake.