xref: /aosp_15_r20/external/apache-xml/test/tests/2.7.3_release/2.7.3_release.sh (revision 1212f9a0ffdc28482b8821715d2222bf16dc14e2)
1#!/bin/sh
2#
3#=========================================================================
4# Copyright 2001-2023 The Apache Software Foundation.
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#=========================================================================
18#
19#	Author: [email protected]
20
21#	Setup:
22#         You must set JAVA_HOME, for example,
23#         $ export JAVA_HOME=/etc/alternatives/java_sdk
24
25if [ "$JAVA_HOME" = "" ]; then
26    echo Warning: JAVA_HOME environment variable is not exported
27    echo You may have meant to set it to /etc/alternatives/java_sdk
28    exit 1
29fi
30
31JAVACMD=$JAVA_HOME/bin/java
32
33CLASSPATH=../../java/build/testxsl.jar
34
35XALAN_BUILD_DIR_PATH=../../../xalan-java/build:../../../build
36
37XERCES_ENDORSED_DIR_PATH=../../../xalan-java/lib/endorsed:../../../lib/endorsed
38
39TEST_XSL_DIR=../../java/build:../../../java/build
40
41#Test 1 (Testing XalanJ integer truncation bug fix, with XalanJ XSLTC processor)
42if [ -f "int_trunc.class" ]; then
43  # delete the result XalanJ translet file, if that exists
44  rm int_trunc.class
45fi
46
47$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -XSLTC -IN int_trunc.xml -XSL int_trunc.xsl -SECURE -XX -XT 2>NUL
48
49if [ -f "int_trunc.class" ]; then
50    echo Test failed. Please solve this, before checking in!
51else
52    echo The xalanj integer truncation bug fix test passed!
53fi
54
55#Test 2 (Testing bug fix of the jira issue XALANJ-2584, with XalanJ interpretive processor)
56$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -IN jira_xalanj_2584.xml -XSL jira_xalanj_2584.xsl > jira_xalanj_2584.out
57
58$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XMLParserTestDriver jira_xalanj_2584.out xalan_interpretive
59
60#Test 3 (Testing bug fix of the jira issue XALANJ-2584, with XalanJ XSLTC processor)
61$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -XSLTC -IN jira_xalanj_2584.xml -XSL jira_xalanj_2584.xsl > jira_xalanj_2584.out
62
63$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XMLParserTestDriver jira_xalanj_2584.out xalan_xsltc
64
65rm jira_xalanj_2584.out
66
67#Test 4 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ interpretive processor)
68$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -IN jira_xalanj_2623.xml -XSL jira_xalanj_2623.xsl > jira_xalanj_2623.out
69
70$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XSValidationTestDriver jira_xalanj_2623.out jira_xalanj_2623.xsd xalan_interpretive
71
72#Test 5 (Testing bug fix of the jira issue XALANJ-2623, with XalanJ XSLTC processor)
73$JAVACMD -Djava.endorsed.dirs=$XALAN_BUILD_DIR_PATH:$XERCES_ENDORSED_DIR_PATH org.apache.xalan.xslt.Process -XSLTC -IN jira_xalanj_2623.xml -XSL jira_xalanj_2623.xsl > jira_xalanj_2623.out
74
75$JAVACMD -Djava.endorsed.dirs=$XERCES_ENDORSED_DIR_PATH -classpath $TEST_XSL_DIR/testxsl.jar org.apache.qetest.XSValidationTestDriver jira_xalanj_2623.out jira_xalanj_2623.xsd xalan_xsltc
76
77rm jira_xalanj_2623.out
78