xref: /aosp_15_r20/external/apache-xml/test/java/xdocs/sources/tests/submit.xml (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1<?xml version="1.0" standalone="no"?>
2<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
3<!--
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the  "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 *     http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19-->
20<s1 title="Submitting New Tests">
21<ul>
22<li><link anchor="write-API-tests">How to Write API Tests</link></li>
23<li><link anchor="write-xsl-tests">How to Write Stylesheet Tests</link></li>
24</ul>
25
26    <anchor name="write-API-tests"/>
27    <s2 title="How to Write API Tests">
28<p>Use the existing framework!  It provides lots of useful functionality,
29and will help us to maintain your tests.</p>
30<p>For example: To write a new TRAX/javax.xml.transform API test:</p>
31<p>- open org.apache.qetest.trax.REPLACE_template_for_new_tests.java</p>
32<p>- follow directions to rename the file (and put in the correct dom/sax/stream
33 subdir, if needed) and search-and-replace all REPLACE_* tokens</p>
34<p>- write one-time-only setup code in testFileInit()</p>
35<p>- write a number of testCase<ref>n</ref> methods. Each one should
36be independent from the other test cases. Try to test between one
37and ten or so individual test points (or calls to reporter.check(...)
38for each testCase method.</p>
39<p>- Never use System.out/.err - always use reporter.log*Msg() (to report
40general messages), or reporter.check() (to validate a specific test point)</p>
41<note>This is an important point. Bottlenecking all output from the tests
42through a <jump href="apidocs/org/apache/qetest/Reporter.html">Reporter</jump>
43allows us to manage and analyze the results much more easily. Reporters also
44put all output to both the console and to your <link idref="run" anchor="test-options-logfile">logFile</link>.</note>
45<p>- Build the tests, including your new one, <link idref="getstarted" anchor="how-to-build">as described</link></p>
46<p>- Put your test's supporting xml/xsl files in xml-xalan/test/tests/api/trax or
47subdirectories</p>
48<p>- Use xml-xalan\test\traxapitest.bat (and APITest.properties) <link idref="run" anchor="how-to-run">to run your test</link>!
49Results will be placed by default into xml-xalan\test\results-api\APITest.xml</p>
50<p>The same basic template can be used for other kinds of API tests, with appropriate
51changes to the package name, etc.</p>
52<p>You can pretty-print the results by using the <link idref="run" anchor="how-to-view-results">viewResults.xsl stylesheet</link> to turn
53the XML into an HTML format.</p>
54    </s2>
55
56    <anchor name="write-xsl-tests"/>
57    <s2 title="How to Write Stylesheet Tests">
58    <p>Test cases in the "conf" group will ultimately be submitted to OASIS as part of
59their vendor-independent project on XSLT/XPath Conformance Testing. For more
60information about this project, visit
61<jump href="http://www.oasis-open.org/committees/xslt/index.html">http://www.oasis-open.org/committees/xslt/index.html</jump></p>
62
63<p>The OASIS project will combine test cases from different sources and will provide a way to
64customize the set of tests according to design decisions made for each processor
65under test. We expect that when the OASIS test system is delivered, it will supplant
66most or all of the "conf" group provided here. Conformance tests are designed as
67streamlined "atomic" (or at least "molecular") tests, so there are several hundred of them.
68Currently, Lotus/IBM is working on submitting a significant body of Conformance tests
69to OASIS. We also would like to temporarily provide most of the tests here on
70Apache for Xalan developer's use, while OASIS finalizes it's test suite.</p>
71
72<p>You are invited to submit additional test cases by checking them into the "contrib"
73area or mailing them to <jump href="mailto:[email protected]">[email protected]</jump>.
74If you want to help with testing Xalan and wish to be
75assigned to write some cases, send email to David Marston stating your interest.
76Contributed tests may be sent along to the OASIS conformance project if they test
77conformance. Guidelines for comments in tests are still evolving as part of the
78OASIS project, so it may be necessary to add more comments or other annotation
79after the test is submitted. We hope to have a template for contributing
80stylesheet tests available soon that will closely match the eventual OASIS format.</p>
81
82<p>The Xalan team will continue to provide test automation, like the
83StylesheetTestletDriver and various StylesheetTestlet classes, that
84enables a user to easily run large suites of tests with fully rolled-up
85reporting and a rich set of options.</p>
86    </s2>
87</s1>
88