Use the existing framework! It provides lots of useful functionality,
and will help us to maintain your tests.
For example: To write a new TRAX/javax.xml.transform API test:
- open org.apache.qetest.trax.REPLACE_template_for_new_tests.java
- follow directions to rename the file (and put in the correct dom/sax/stream
subdir, if needed) and search-and-replace all REPLACE_* tokens
- write one-time-only setup code in testFileInit()
- write a number of testCasen methods. Each one should
be independent from the other test cases. Try to test between one
and ten or so individual test points (or calls to reporter.check(...)
for each testCase method.
- Never use System.out/.err - always use reporter.log*Msg() (to report
general messages), or reporter.check() (to validate a specific test point)
|This is an important point. Bottlenecking all output from the tests
through a Reporter
allows us to manage and analyze the results much more easily. Reporters also
put all output to both the console and to your logFile.|
- Build the tests, including your new one, as described
- Put your test's supporting xml/xsl files in xml-xalan/test/tests/api/trax or
- Use xml-xalan\test\traxapitest.bat (and APITest.properties) to run your test!
Results will be placed by default into xml-xalan\test\results-api\APITest.xml
The same basic template can be used for other kinds of API tests, with appropriate
changes to the package name, etc.
You can pretty-print the results by using the viewResults.xsl stylesheet to turn
the XML into an HTML format.