- From: Curt Arnold <carnold@houston.rr.com>
- Date: Mon, 23 Jul 2001 00:25:01 -0500
- To: <www-dom-ts@w3.org>
- Message-ID: <002501c11337$d2e756f0$a800a8c0@CurtMicron>
I've just updated the CVS with a substantial amount of work that now will now allow a DOM 1 Core test suite to be generated, compiled and run using JUnit. The process assumes that you have populated the tests/level1/core with test definitions and files/level1/core with corresponding data files. I've tested this with an ad-hoc collection of about 200 tests. To build dist/dom1-core.jar which contains the compiled tests, java source code (for test failure analysis) and data files. ant dom1-core-jar To build junit-run.jar which contains the JUnit support classes to run any test jar: ant junit-run To run a test case or test suite: Put dom1-core.jar, junit-run.jar, junit.jar from JUnit 3.7 (http://www.junit.org) and a JAXP 1.1 compatible parser (such as xerces.jar) in one directory (or on the classpath) java -jar junit-run.jar testclassname For example, java -jar junit-run.jar org.w3c.domts.level1.core.attrCreateDocumentFragment To define a suite of tests, create an XML file in the test directory that looks like: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "dom1.dtd"> <suite name="coreAll" targetURI="http://www.w3.org/2001/DOM-Test-Suite/level-1/core/coreAll.xml" xmlns="http://www.w3.org/2001/DOM-Test-Suite/level-1/Test-Definition" package="org.w3c.domts.level1.core"> <suite.member href="attrCreateDocumentFragment.xml"/> <suite.member href="attrCreateTextNode.xml"/> <suite.member href="attrDefaultValue.xml"/> <suite.member href="attrEffectiveValue.xml"/> ... </suite> The test harness will run throw the test suite twice (currently), once with expandEntityReferences, ignoringElementContentWhitespace, namespaceAware, and validating = false and once with all those properties set to true. If a test (or suite) is only appropriate for a particular setting, then the required values need to be asserted in the prolog of the test. For example, <test...> <implementationAttribute name="namespaceAware" value="false"/> The generated code attempts (haven't tested it yet) to change the settings just for this case to be compatible with the requirements of this test. The test-to-java transform will now copy any comment in the test definition that contains the string "Copyright" to the generated Java code.
Received on Monday, 23 July 2001 01:25:11 UTC